about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPhilip Taron <philip.taron@gmail.com>2024-03-19 16:46:30 -0700
committerValentin Gagarin <valentin.gagarin@tweag.io>2024-03-28 21:30:46 +0100
commit5b0905b8eaf258dcd5c0d4c04c132ad7296c0023 (patch)
treee0fe7cab54fc57e25c0da298e26834174b810acd
parent98d0412811bd28e2e06edb50d22d98cbd0f5af6a (diff)
downloadnixlib-5b0905b8eaf258dcd5c0d4c04c132ad7296c0023.tar
nixlib-5b0905b8eaf258dcd5c0d4c04c132ad7296c0023.tar.gz
nixlib-5b0905b8eaf258dcd5c0d4c04c132ad7296c0023.tar.bz2
nixlib-5b0905b8eaf258dcd5c0d4c04c132ad7296c0023.tar.lz
nixlib-5b0905b8eaf258dcd5c0d4c04c132ad7296c0023.tar.xz
nixlib-5b0905b8eaf258dcd5c0d4c04c132ad7296c0023.tar.zst
nixlib-5b0905b8eaf258dcd5c0d4c04c132ad7296c0023.zip
Avoid top-level `with ...;` in pkgs/tools/graphics/astc-encoder/default.nix
-rw-r--r--pkgs/tools/graphics/astc-encoder/default.nix21
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 0a227a1781ae..463f7e85e7ea 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 = ''