summary refs log tree commit diff
path: root/pkgs/tools/compression/zstd/default.nix
diff options
context:
space:
mode:
authorEmery Hemingway <ehmry@posteo.net>2021-04-10 13:10:23 +0200
committerEmery Hemingway <ehmry@posteo.net>2021-04-10 17:10:50 +0200
commit9e4a925caf5d5649686402b52815503bddadd457 (patch)
treed5eed86924af918615e59159e0f72a2e67b30c3c /pkgs/tools/compression/zstd/default.nix
parent29bc87e961c0ab878b364cbc338898b2842d82db (diff)
downloadnixpkgs-9e4a925caf5d5649686402b52815503bddadd457.tar
nixpkgs-9e4a925caf5d5649686402b52815503bddadd457.tar.gz
nixpkgs-9e4a925caf5d5649686402b52815503bddadd457.tar.bz2
nixpkgs-9e4a925caf5d5649686402b52815503bddadd457.tar.lz
nixpkgs-9e4a925caf5d5649686402b52815503bddadd457.tar.xz
nixpkgs-9e4a925caf5d5649686402b52815503bddadd457.tar.zst
nixpkgs-9e4a925caf5d5649686402b52815503bddadd457.zip
zstd: do not cross-compile tests
Diffstat (limited to 'pkgs/tools/compression/zstd/default.nix')
-rw-r--r--pkgs/tools/compression/zstd/default.nix18
1 files changed, 10 insertions, 8 deletions
diff --git a/pkgs/tools/compression/zstd/default.nix b/pkgs/tools/compression/zstd/default.nix
index 6394ea3338d..e890518a45a 100644
--- a/pkgs/tools/compression/zstd/default.nix
+++ b/pkgs/tools/compression/zstd/default.nix
@@ -36,13 +36,15 @@ stdenv.mkDerivation rec {
       tests/playTests.sh
   '';
 
-  cmakeFlags = [
-    "-DZSTD_BUILD_SHARED:BOOL=${if (!static) then "ON" else "OFF"}"
-    "-DZSTD_BUILD_STATIC:BOOL=${if static then "ON" else "OFF"}"
-    "-DZSTD_PROGRAMS_LINK_SHARED:BOOL=${if (!static) then "ON" else "OFF"}"
-    "-DZSTD_LEGACY_SUPPORT:BOOL=${if legacySupport then "ON" else "OFF"}"
-    "-DZSTD_BUILD_TESTS:BOOL=ON"
-  ];
+  cmakeFlags = lib.attrsets.mapAttrsToList
+    (name: value: "-DZSTD_${name}:BOOL=${if value then "ON" else "OFF"}") {
+      BUILD_SHARED = !static;
+      BUILD_STATIC = static;
+      PROGRAMS_LINK_SHARED = !static;
+      LEGACY_SUPPORT = legacySupport;
+      BUILD_TESTS = doCheck;
+    };
+
   cmakeDir = "../build/cmake";
   dontUseCmakeBuildDir = true;
   preConfigure = ''
@@ -50,7 +52,7 @@ stdenv.mkDerivation rec {
   '';
 
   checkInputs = [ file ];
-  doCheck = true;
+  doCheck = stdenv.hostPlatform == stdenv.buildPlatform;
   checkPhase = ''
     runHook preCheck
     # Patch shebangs for playTests