astc-encoder: fix darwin build
This commit is contained in:
parent
d0ea6eada2
commit
80cb5e65f8
1 changed files with 9 additions and 10 deletions
|
@ -1,5 +1,5 @@
|
||||||
{ lib
|
{ lib
|
||||||
, gccStdenv
|
, stdenv
|
||||||
, fetchFromGitHub
|
, fetchFromGitHub
|
||||||
, cmake
|
, cmake
|
||||||
, simdExtensions ? null
|
, simdExtensions ? null
|
||||||
|
@ -8,7 +8,7 @@
|
||||||
with rec {
|
with rec {
|
||||||
# SIMD instruction sets to compile for. If none are specified by the user,
|
# SIMD instruction sets to compile for. If none are specified by the user,
|
||||||
# an appropriate one is selected based on the detected host system
|
# an appropriate one is selected based on the detected host system
|
||||||
isas = with gccStdenv.hostPlatform;
|
isas = with stdenv.hostPlatform;
|
||||||
if simdExtensions != null then lib.toList simdExtensions
|
if simdExtensions != null then lib.toList simdExtensions
|
||||||
else if avx2Support then [ "AVX2" ]
|
else if avx2Support then [ "AVX2" ]
|
||||||
else if sse4_1Support then [ "SSE41" ]
|
else if sse4_1Support then [ "SSE41" ]
|
||||||
|
@ -16,7 +16,7 @@ with rec {
|
||||||
else if isAarch64 then [ "NEON" ]
|
else if isAarch64 then [ "NEON" ]
|
||||||
else [ "NONE" ];
|
else [ "NONE" ];
|
||||||
|
|
||||||
archFlags = lib.optionals gccStdenv.hostPlatform.isAarch64 [ "-DARCH=aarch64" ];
|
archFlags = lib.optionals stdenv.hostPlatform.isAarch64 [ "-DARCH=aarch64" ];
|
||||||
|
|
||||||
# CMake Build flags for the selected ISAs. For a list of flags, see
|
# CMake Build flags for the selected ISAs. For a list of flags, see
|
||||||
# https://github.com/ARM-software/astc-encoder/blob/main/Docs/Building.md
|
# https://github.com/ARM-software/astc-encoder/blob/main/Docs/Building.md
|
||||||
|
@ -24,12 +24,12 @@ with rec {
|
||||||
|
|
||||||
# The suffix of the binary to link as 'astcenc'
|
# The suffix of the binary to link as 'astcenc'
|
||||||
mainBinary = builtins.replaceStrings
|
mainBinary = builtins.replaceStrings
|
||||||
[ "AVX2" "SSE41" "SSE2" "NEON" "NONE" ]
|
[ "AVX2" "SSE41" "SSE2" "NEON" "NONE" "NATIVE" ]
|
||||||
[ "avx2" "sse4.1" "sse2" "neon" "none" ]
|
[ "avx2" "sse4.1" "sse2" "neon" "none" "native" ]
|
||||||
( builtins.head isas );
|
( builtins.head isas );
|
||||||
};
|
};
|
||||||
|
|
||||||
gccStdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
pname = "astc-encoder";
|
pname = "astc-encoder";
|
||||||
version = "4.2.0";
|
version = "4.2.0";
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@ gccStdenv.mkDerivation rec {
|
||||||
nativeBuildInputs = [ cmake ];
|
nativeBuildInputs = [ cmake ];
|
||||||
|
|
||||||
cmakeFlags = isaFlags ++ archFlags ++ [
|
cmakeFlags = isaFlags ++ archFlags ++ [
|
||||||
"-DCMAKE_BUILD_TYPE=Release"
|
"-DCMAKE_BUILD_TYPE=RelWithDebInfo"
|
||||||
];
|
];
|
||||||
|
|
||||||
# Set a fixed build year to display within help output (otherwise, it would be 1980)
|
# Set a fixed build year to display within help output (otherwise, it would be 1980)
|
||||||
|
@ -52,9 +52,8 @@ gccStdenv.mkDerivation rec {
|
||||||
--replace 'string(TIMESTAMP astcencoder_YEAR "%Y")' 'set(astcencoder_YEAR "2022")'
|
--replace 'string(TIMESTAMP astcencoder_YEAR "%Y")' 'set(astcencoder_YEAR "2022")'
|
||||||
'';
|
'';
|
||||||
|
|
||||||
# Link binaries into environment and provide 'astcenc' link
|
# Provide 'astcenc' link to main executable
|
||||||
postInstall = ''
|
postInstall = ''
|
||||||
mv $out/astcenc $out/bin
|
|
||||||
ln -s $out/bin/astcenc-${mainBinary} $out/bin/astcenc
|
ln -s $out/bin/astcenc-${mainBinary} $out/bin/astcenc
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
@ -73,6 +72,6 @@ gccStdenv.mkDerivation rec {
|
||||||
platforms = platforms.unix;
|
platforms = platforms.unix;
|
||||||
license = licenses.asl20;
|
license = licenses.asl20;
|
||||||
maintainers = with maintainers; [ dasisdormax ];
|
maintainers = with maintainers; [ dasisdormax ];
|
||||||
broken = !gccStdenv.is64bit;
|
broken = !stdenv.is64bit;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue