summary refs log tree commit diff
path: root/pkgs/tools/compression
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2019-11-12 19:47:47 +0000
committerJohn Ericson <John.Ericson@Obsidian.Systems>2019-11-13 20:40:15 +0000
commit774e88cd86c2682f2482ee7a611c8cde517df803 (patch)
tree71d4556c28ddf51db0d6ec779e760c66eb5a0f83 /pkgs/tools/compression
parented56d04c8e970b7ad2d945d1849f8d0fcc0a3ee1 (diff)
downloadnixpkgs-774e88cd86c2682f2482ee7a611c8cde517df803.tar
nixpkgs-774e88cd86c2682f2482ee7a611c8cde517df803.tar.gz
nixpkgs-774e88cd86c2682f2482ee7a611c8cde517df803.tar.bz2
nixpkgs-774e88cd86c2682f2482ee7a611c8cde517df803.tar.lz
nixpkgs-774e88cd86c2682f2482ee7a611c8cde517df803.tar.xz
nixpkgs-774e88cd86c2682f2482ee7a611c8cde517df803.tar.zst
nixpkgs-774e88cd86c2682f2482ee7a611c8cde517df803.zip
lz4: Fix MinGW build
Diffstat (limited to 'pkgs/tools/compression')
-rw-r--r--pkgs/tools/compression/lz4/default.nix17
1 files changed, 14 insertions, 3 deletions
diff --git a/pkgs/tools/compression/lz4/default.nix b/pkgs/tools/compression/lz4/default.nix
index 3f2497cd8d2..3ce0eac3fc5 100644
--- a/pkgs/tools/compression/lz4/default.nix
+++ b/pkgs/tools/compression/lz4/default.nix
@@ -21,6 +21,7 @@ stdenv.mkDerivation rec {
     })
   ];
 
+  # TODO(@Ericson2314): Separate binaries and libraries
   outputs = [ "out" "dev" ];
 
   buildInputs = stdenv.lib.optional doCheck valgrind;
@@ -33,17 +34,27 @@ stdenv.mkDerivation rec {
     # TODO do this instead
     #"BUILD_STATIC=${if enableStatic then "yes" else "no"}"
     #"BUILD_SHARED=${if enableShared then "yes" else "no"}"
+    #"WINDRES:=${stdenv.cc.bintools.targetPrefix}windres"
   ]
     # TODO delete and do above
     ++ stdenv.lib.optional (enableStatic) "BUILD_STATIC=yes"
     ++ stdenv.lib.optional (!enableShared) "BUILD_SHARED=no"
+    ++ stdenv.lib.optional stdenv.hostPlatform.isMinGW "WINDRES:=${stdenv.cc.bintools.targetPrefix}windres"
+    # TODO make full dictionary
+    ++ stdenv.lib.optional stdenv.hostPlatform.isMinGW "TARGET_OS=MINGW"
     ;
 
   doCheck = false; # tests take a very long time
   checkTarget = "test";
 
-  # TODO remove
-  postInstall = stdenv.lib.optionalString (!enableStatic) "rm $out/lib/*.a";
+  # TODO(@Ericson2314): Make resusable setup hook for this issue on Windows.
+  postInstall =
+    stdenv.lib.optionalString stdenv.hostPlatform.isWindows ''
+      mv $out/bin/*.dll $out/lib
+      ln -s $out/lib/*.dll
+    ''
+    # TODO remove
+    + stdenv.lib.optionalString (!enableStatic) "rm $out/lib/*.a";
 
   meta = with stdenv.lib; {
     description = "Extremely fast compression algorithm";
@@ -56,6 +67,6 @@ stdenv.mkDerivation rec {
     '';
     homepage = https://lz4.github.io/lz4/;
     license = with licenses; [ bsd2 gpl2Plus ];
-    platforms = platforms.unix;
+    platforms = platforms.all;
   };
 }