astc-encoder: fix darwin build

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