lcevcdec: only enable avx2 when supported in hostPlatform: ffmpeg-full: renable lcevcdec (#379413)

authored by jopejoe1 and committed by GitHub 5ecb880a fe79e24f

+20 -7
+19 -6
pkgs/by-name/lc/lcevcdec/package.nix
··· 42 }) 43 ]; 44 45 - postPatch = '' 46 - substituteInPlace cmake/tools/version_files.py \ 47 - --replace-fail "args.git_version" '"${finalAttrs.version}"' \ 48 - --replace-fail "args.git_hash" '"${finalAttrs.src.rev}"' \ 49 - --replace-fail "args.git_date" '"1970-01-01"' 50 - ''; 51 52 env = { 53 includedir = "${placeholder "dev"}/include"; 54 libdir = "${placeholder "out"}/lib"; 55 }; 56 57 pkgconfigItems = [ ··· 95 (lib.cmakeFeature "VN_SDK_FFMPEG_LIBS_PACKAGE" "") 96 (lib.cmakeBool "VN_SDK_UNIT_TESTS" false) 97 (lib.cmakeBool "VN_SDK_SAMPLE_SOURCE" false) 98 ]; 99 100 passthru = {
··· 42 }) 43 ]; 44 45 + postPatch = 46 + '' 47 + substituteInPlace cmake/tools/version_files.py \ 48 + --replace-fail "args.git_version" '"${finalAttrs.version}"' \ 49 + --replace-fail "args.git_hash" '"${finalAttrs.src.rev}"' \ 50 + --replace-fail "args.git_date" '"1970-01-01"' 51 + 52 + '' 53 + + lib.optionalString (!stdenv.hostPlatform.avxSupport) '' 54 + substituteInPlace cmake/modules/Compiler/GNU.cmake \ 55 + --replace-fail "-mavx" "" 56 + 57 + substituteInPlace src/core/decoder/src/common/simd.c \ 58 + --replace-fail "((_xgetbv(kControlRegister) & kOSXSaveMask) == kOSXSaveMask)" "false" 59 + ''; 60 61 env = { 62 includedir = "${placeholder "dev"}/include"; 63 libdir = "${placeholder "out"}/lib"; 64 + NIX_CFLAGS_COMPILE = "-Wno-error=unused-variable"; 65 }; 66 67 pkgconfigItems = [ ··· 105 (lib.cmakeFeature "VN_SDK_FFMPEG_LIBS_PACKAGE" "") 106 (lib.cmakeBool "VN_SDK_UNIT_TESTS" false) 107 (lib.cmakeBool "VN_SDK_SAMPLE_SOURCE" false) 108 + (lib.cmakeBool "VN_CORE_AVX2" stdenv.hostPlatform.avx2Support) 109 + # Requires avx for checking on runtime 110 + (lib.cmakeBool "VN_CORE_SSE" stdenv.hostPlatform.avxSupport) 111 ]; 112 113 passthru = {
+1 -1
pkgs/development/libraries/ffmpeg/generic.nix
··· 90 withKvazaar ? withFullDeps, # HEVC encoding 91 withLadspa ? withFullDeps, # LADSPA audio filtering 92 withLc3 ? withFullDeps && lib.versionAtLeast version "7.1", # LC3 de/encoding 93 - withLcevcdec ? false && lib.versionAtLeast version "7.1", # LCEVC decoding # FIXME currently makes ffmpeg crash in any operation on non-AVX CPUs 94 withLcms2 ? withFullDeps, # ICC profile support via lcms2 95 withLzma ? withHeadlessDeps, # xz-utils 96 withMetal ? false, # Unfree and requires manual downloading of files
··· 90 withKvazaar ? withFullDeps, # HEVC encoding 91 withLadspa ? withFullDeps, # LADSPA audio filtering 92 withLc3 ? withFullDeps && lib.versionAtLeast version "7.1", # LC3 de/encoding 93 + withLcevcdec ? withFullDeps && lib.versionAtLeast version "7.1", # LCEVC decoding 94 withLcms2 ? withFullDeps, # ICC profile support via lcms2 95 withLzma ? withHeadlessDeps, # xz-utils 96 withMetal ? false, # Unfree and requires manual downloading of files