astc-encoder: fix darwin build

+9 -10
+9 -10
pkgs/tools/graphics/astc-encoder/default.nix
··· 1 { lib 2 - , gccStdenv 3 , fetchFromGitHub 4 , cmake 5 , simdExtensions ? null ··· 8 with rec { 9 # SIMD instruction sets to compile for. If none are specified by the user, 10 # an appropriate one is selected based on the detected host system 11 - isas = with gccStdenv.hostPlatform; 12 if simdExtensions != null then lib.toList simdExtensions 13 else if avx2Support then [ "AVX2" ] 14 else if sse4_1Support then [ "SSE41" ] ··· 16 else if isAarch64 then [ "NEON" ] 17 else [ "NONE" ]; 18 19 - archFlags = lib.optionals gccStdenv.hostPlatform.isAarch64 [ "-DARCH=aarch64" ]; 20 21 # CMake Build flags for the selected ISAs. For a list of flags, see 22 # https://github.com/ARM-software/astc-encoder/blob/main/Docs/Building.md ··· 24 25 # The suffix of the binary to link as 'astcenc' 26 mainBinary = builtins.replaceStrings 27 - [ "AVX2" "SSE41" "SSE2" "NEON" "NONE" ] 28 - [ "avx2" "sse4.1" "sse2" "neon" "none" ] 29 ( builtins.head isas ); 30 }; 31 32 - gccStdenv.mkDerivation rec { 33 pname = "astc-encoder"; 34 version = "4.2.0"; 35 ··· 43 nativeBuildInputs = [ cmake ]; 44 45 cmakeFlags = isaFlags ++ archFlags ++ [ 46 - "-DCMAKE_BUILD_TYPE=Release" 47 ]; 48 49 # Set a fixed build year to display within help output (otherwise, it would be 1980) ··· 52 --replace 'string(TIMESTAMP astcencoder_YEAR "%Y")' 'set(astcencoder_YEAR "2022")' 53 ''; 54 55 - # Link binaries into environment and provide 'astcenc' link 56 postInstall = '' 57 - mv $out/astcenc $out/bin 58 ln -s $out/bin/astcenc-${mainBinary} $out/bin/astcenc 59 ''; 60 ··· 73 platforms = platforms.unix; 74 license = licenses.asl20; 75 maintainers = with maintainers; [ dasisdormax ]; 76 - broken = !gccStdenv.is64bit; 77 }; 78 }
··· 1 { lib 2 + , stdenv 3 , fetchFromGitHub 4 , cmake 5 , simdExtensions ? null ··· 8 with rec { 9 # SIMD instruction sets to compile for. If none are specified by the user, 10 # an appropriate one is selected based on the detected host system 11 + isas = with stdenv.hostPlatform; 12 if simdExtensions != null then lib.toList simdExtensions 13 else if avx2Support then [ "AVX2" ] 14 else if sse4_1Support then [ "SSE41" ] ··· 16 else if isAarch64 then [ "NEON" ] 17 else [ "NONE" ]; 18 19 + archFlags = lib.optionals stdenv.hostPlatform.isAarch64 [ "-DARCH=aarch64" ]; 20 21 # CMake Build flags for the selected ISAs. For a list of flags, see 22 # https://github.com/ARM-software/astc-encoder/blob/main/Docs/Building.md ··· 24 25 # The suffix of the binary to link as 'astcenc' 26 mainBinary = builtins.replaceStrings 27 + [ "AVX2" "SSE41" "SSE2" "NEON" "NONE" "NATIVE" ] 28 + [ "avx2" "sse4.1" "sse2" "neon" "none" "native" ] 29 ( builtins.head isas ); 30 }; 31 32 + stdenv.mkDerivation rec { 33 pname = "astc-encoder"; 34 version = "4.2.0"; 35 ··· 43 nativeBuildInputs = [ cmake ]; 44 45 cmakeFlags = isaFlags ++ archFlags ++ [ 46 + "-DCMAKE_BUILD_TYPE=RelWithDebInfo" 47 ]; 48 49 # Set a fixed build year to display within help output (otherwise, it would be 1980) ··· 52 --replace 'string(TIMESTAMP astcencoder_YEAR "%Y")' 'set(astcencoder_YEAR "2022")' 53 ''; 54 55 + # Provide 'astcenc' link to main executable 56 postInstall = '' 57 ln -s $out/bin/astcenc-${mainBinary} $out/bin/astcenc 58 ''; 59 ··· 72 platforms = platforms.unix; 73 license = licenses.asl20; 74 maintainers = with maintainers; [ dasisdormax ]; 75 + broken = !stdenv.is64bit; 76 }; 77 }