summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorJohn Ericson <git@JohnEricson.me>2018-12-13 18:28:05 -0500
committerGitHub <noreply@github.com>2018-12-13 18:28:05 -0500
commite0a4d1083f574291f139dc7d1a1307b9c80adff2 (patch)
tree22b5d32bff8c413dcf5b643df849ddebb9f9ff42 /pkgs
parent71b3f931a9f6fed9e657e4629dfbdb20618c091d (diff)
parentcb5a7bdc3a486054003d2fb0ed06451af872fd30 (diff)
downloadnixpkgs-e0a4d1083f574291f139dc7d1a1307b9c80adff2.tar
nixpkgs-e0a4d1083f574291f139dc7d1a1307b9c80adff2.tar.gz
nixpkgs-e0a4d1083f574291f139dc7d1a1307b9c80adff2.tar.bz2
nixpkgs-e0a4d1083f574291f139dc7d1a1307b9c80adff2.tar.lz
nixpkgs-e0a4d1083f574291f139dc7d1a1307b9c80adff2.tar.xz
nixpkgs-e0a4d1083f574291f139dc7d1a1307b9c80adff2.tar.zst
nixpkgs-e0a4d1083f574291f139dc7d1a1307b9c80adff2.zip
Merge pull request #51965 from vaibhavsagar/fix-static-lz4
lz4: Fix pkgsStatic build
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/tools/compression/lz4/default.nix19
-rw-r--r--pkgs/top-level/static.nix4
2 files changed, 20 insertions, 3 deletions
diff --git a/pkgs/tools/compression/lz4/default.nix b/pkgs/tools/compression/lz4/default.nix
index 1cd4c30a388..41ed46794a0 100644
--- a/pkgs/tools/compression/lz4/default.nix
+++ b/pkgs/tools/compression/lz4/default.nix
@@ -1,4 +1,6 @@
-{ stdenv, fetchFromGitHub, valgrind }:
+{ stdenv, fetchFromGitHub, valgrind
+, enableStatic ? false, enableShared ? true
+}:
 
 stdenv.mkDerivation rec {
   name = "lz4-${version}";
@@ -17,12 +19,23 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
-  makeFlags = [ "PREFIX=$(out)" "INCLUDEDIR=$(dev)/include" ];
+  makeFlags = [
+    "PREFIX=$(out)"
+    "INCLUDEDIR=$(dev)/include"
+    # TODO do this instead
+    #"BUILD_STATIC=${if enableStatic then "yes" else "no"}"
+    #"BUILD_SHARED=${if enableShared then "yes" else "no"}"
+  ]
+    # TODO delete and do above
+    ++ stdenv.lib.optional (enableStatic) "BUILD_STATIC=yes"
+    ++ stdenv.lib.optional (!enableShared) "BUILD_SHARED=no"
+    ;
 
   doCheck = false; # tests take a very long time
   checkTarget = "test";
 
-  postInstall = "rm $out/lib/*.a";
+  # TODO remove
+  postInstall = stdenv.lib.optionalString (!enableStatic) "rm $out/lib/*.a";
 
   meta = with stdenv.lib; {
     description = "Extremely fast compression algorithm";
diff --git a/pkgs/top-level/static.nix b/pkgs/top-level/static.nix
index 687e38dcc3a..e6ef50e7ee9 100644
--- a/pkgs/top-level/static.nix
+++ b/pkgs/top-level/static.nix
@@ -139,6 +139,10 @@ in {
     # it doesn’t like the --disable-shared flag
     stdenv = super.stdenv;
   };
+  lz4 = super.lz4.override {
+    enableShared = false;
+    enableStatic = true;
+  };
 
   darwin = super.darwin // {
     libiconv = super.darwin.libiconv.override {