git.iko.soy/typeable/nixpkgs
on master help sign in
lz4: Fix MinGW build
commit774e88cd86c2682f2482ee7a611c8cde517df803 authorJohn Ericson <John.Ericson@Obsidian.Systems> dateTue 12 Nov 2019, 19:47 (7 years ago) parented56d04
1 file changed+14−3
pkgs/tools/compression/lz4/default.nix+14−3
pkgs/tools/compression/lz4/default.nix+14−3
@@ -21,6 +21,7 @@ stdenv.mkDerivation rec {
2121 })
2222 ];
2323
24+ # TODO(@Ericson2314): Separate binaries and libraries
2425 outputs = [ "out" "dev" ];
2526
2627 buildInputs = stdenv.lib.optional doCheck valgrind;
@@ -33,17 +34,27 @@ stdenv.mkDerivation rec {
3334 # TODO do this instead
3435 #"BUILD_STATIC=${if enableStatic then "yes" else "no"}"
3536 #"BUILD_SHARED=${if enableShared then "yes" else "no"}"
37+ #"WINDRES:=${stdenv.cc.bintools.targetPrefix}windres"
3638 ]
3739 # TODO delete and do above
3840 ++ stdenv.lib.optional (enableStatic) "BUILD_STATIC=yes"
3941 ++ stdenv.lib.optional (!enableShared) "BUILD_SHARED=no"
42+ ++ stdenv.lib.optional stdenv.hostPlatform.isMinGW "WINDRES:=${stdenv.cc.bintools.targetPrefix}windres"
43+ # TODO make full dictionary
44+ ++ stdenv.lib.optional stdenv.hostPlatform.isMinGW "TARGET_OS=MINGW"
4045 ;
4146
4247 doCheck = false; # tests take a very long time
4348 checkTarget = "test";
4449
45− # TODO remove
46− postInstall = stdenv.lib.optionalString (!enableStatic) "rm $out/lib/*.a";
50+ # TODO(@Ericson2314): Make resusable setup hook for this issue on Windows.
51+ postInstall =
52+ stdenv.lib.optionalString stdenv.hostPlatform.isWindows ''
53+ mv $out/bin/*.dll $out/lib
54+ ln -s $out/lib/*.dll
55+ ''
56+ # TODO remove
57+ + stdenv.lib.optionalString (!enableStatic) "rm $out/lib/*.a";
4758
4859 meta = with stdenv.lib; {
4960 description = "Extremely fast compression algorithm";
@@ -56,6 +67,6 @@ stdenv.mkDerivation rec {
5667 '';
5768 homepage = https://lz4.github.io/lz4/;
5869 license = with licenses; [ bsd2 gpl2Plus ];
59− platforms = platforms.unix;
70+ platforms = platforms.all;
6071 };
6172}