diff options
author | Philip Taron <philip.taron@gmail.com> | 2024-03-19 16:46:30 -0700 |
---|---|---|
committer | Valentin Gagarin <valentin.gagarin@tweag.io> | 2024-03-28 21:30:46 +0100 |
commit | 5b0905b8eaf258dcd5c0d4c04c132ad7296c0023 (patch) | |
tree | e0fe7cab54fc57e25c0da298e26834174b810acd /pkgs/tools | |
parent | 98d0412811bd28e2e06edb50d22d98cbd0f5af6a (diff) |
Avoid top-level `with ...;` in pkgs/tools/graphics/astc-encoder/default.nix
Diffstat (limited to 'pkgs/tools')
-rw-r--r-- | pkgs/tools/graphics/astc-encoder/default.nix | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/pkgs/tools/graphics/astc-encoder/default.nix b/pkgs/tools/graphics/astc-encoder/default.nix index 0a227a1781aea..463f7e85e7eae 100644 --- a/pkgs/tools/graphics/astc-encoder/default.nix +++ b/pkgs/tools/graphics/astc-encoder/default.nix @@ -5,11 +5,20 @@ , simdExtensions ? null }: -with rec { +let + inherit (lib) + head + licenses + maintainers + platforms + replaceStrings + toList + ; + # SIMD instruction sets to compile for. If none are specified by the user, # an appropriate one is selected based on the detected host system isas = with stdenv.hostPlatform; - if simdExtensions != null then lib.toList simdExtensions + if simdExtensions != null then toList simdExtensions else if avx2Support then [ "AVX2" ] else if sse4_1Support then [ "SSE41" ] else if isx86_64 then [ "SSE2" ] @@ -21,11 +30,11 @@ with rec { isaFlags = map ( isa: "-DASTCENC_ISA_${isa}=ON" ) isas; # The suffix of the binary to link as 'astcenc' - mainBinary = builtins.replaceStrings + mainBinary = replaceStrings [ "AVX2" "SSE41" "SSE2" "NEON" "NONE" "NATIVE" ] [ "avx2" "sse4.1" "sse2" "neon" "none" "native" ] - ( builtins.head isas ); -}; + ( head isas ); +in stdenv.mkDerivation rec { pname = "astc-encoder"; @@ -57,7 +66,7 @@ stdenv.mkDerivation rec { ln -s $out/bin/astcenc-${mainBinary} $out/bin/astcenc ''; - meta = with lib; { + meta = { homepage = "https://github.com/ARM-software/astc-encoder"; description = "An encoder for the ASTC texture compression format"; longDescription = '' |