about summary refs log tree commit diff
path: root/pkgs/tools/compression
diff options
context:
space:
mode:
authorVladimír Čunát <vcunat@gmail.com>2016-01-05 09:50:10 +0100
committerVladimír Čunát <vcunat@gmail.com>2016-01-05 09:50:10 +0100
commit7c879d342d58833174d2df9b7e7eae8fd0ecbf3d (patch)
treea7985026bc2fba244f0686066374aa8b9ee04b99 /pkgs/tools/compression
parent1ebff73b8865606ff4bc14e372e07d22a260d819 (diff)
parentaa4562596f4cc5a53eae70fdf75a8995cc001c86 (diff)
downloadnixlib-7c879d342d58833174d2df9b7e7eae8fd0ecbf3d.tar
nixlib-7c879d342d58833174d2df9b7e7eae8fd0ecbf3d.tar.gz
nixlib-7c879d342d58833174d2df9b7e7eae8fd0ecbf3d.tar.bz2
nixlib-7c879d342d58833174d2df9b7e7eae8fd0ecbf3d.tar.lz
nixlib-7c879d342d58833174d2df9b7e7eae8fd0ecbf3d.tar.xz
nixlib-7c879d342d58833174d2df9b7e7eae8fd0ecbf3d.tar.zst
nixlib-7c879d342d58833174d2df9b7e7eae8fd0ecbf3d.zip
Merge #10816: improve FreeBSD support
Diffstat (limited to 'pkgs/tools/compression')
-rw-r--r--pkgs/tools/compression/bzip2/default.nix5
-rw-r--r--pkgs/tools/compression/lz4/default.nix4
-rw-r--r--pkgs/tools/compression/lz4/install-on-freebsd.patch54
3 files changed, 60 insertions, 3 deletions
diff --git a/pkgs/tools/compression/bzip2/default.nix b/pkgs/tools/compression/bzip2/default.nix
index 3e835c30e3d7..bb04049d8a66 100644
--- a/pkgs/tools/compression/bzip2/default.nix
+++ b/pkgs/tools/compression/bzip2/default.nix
@@ -58,8 +58,9 @@ in stdenv.mkDerivation {
     ln -s bzip2 $out/bin/bzcat
   '';
 
-  patchPhase = stdenv.lib.optionalString stdenv.isDarwin ''
-    substituteInPlace Makefile --replace 'CC=gcc' 'CC=clang'
+  patchPhase = ''
+    substituteInPlace Makefile --replace CC=gcc CC=cc
+    substituteInPlace Makefile-libbz2_so --replace CC=gcc CC=cc
   '';
 
   preConfigure = ''
diff --git a/pkgs/tools/compression/lz4/default.nix b/pkgs/tools/compression/lz4/default.nix
index e91fae778fdb..13236da5ab44 100644
--- a/pkgs/tools/compression/lz4/default.nix
+++ b/pkgs/tools/compression/lz4/default.nix
@@ -20,6 +20,8 @@ stdenv.mkDerivation rec {
   doCheck = false; # tests take a very long time
   checkTarget = "test";
 
+  patches = [ ./install-on-freebsd.patch ] ;
+
   meta = with stdenv.lib; {
     inherit version;
     description = "Extremely fast compression algorithm";
@@ -32,7 +34,7 @@ stdenv.mkDerivation rec {
     '';
     homepage = https://code.google.com/p/lz4/;
     license = with licenses; [ bsd2 gpl2Plus ];
-    platforms = platforms.linux;
+    platforms = platforms.unix;
     maintainers = with maintainers; [ nckx ];
   };
 }
diff --git a/pkgs/tools/compression/lz4/install-on-freebsd.patch b/pkgs/tools/compression/lz4/install-on-freebsd.patch
new file mode 100644
index 000000000000..12a2bf72f4ed
--- /dev/null
+++ b/pkgs/tools/compression/lz4/install-on-freebsd.patch
@@ -0,0 +1,54 @@
+diff --git a/Makefile b/Makefile
+index d1b0d0c..f8d6a2d 100644
+--- a/Makefile
++++ b/Makefile
+@@ -80,8 +80,6 @@ clean:
+ 
+ 
+ #------------------------------------------------------------------------
+-#make install is validated only for Linux, OSX, kFreeBSD and Hurd targets
+-ifneq (,$(filter $(shell uname),Linux Darwin GNU/kFreeBSD GNU))
+ 
+ install:
+ 	@cd $(LZ4DIR); $(MAKE) -e install
+@@ -129,4 +127,3 @@ examples:
+ prg-travis:
+ 	@cd $(PRGDIR); $(MAKE) -e test-travis
+ 
+-endif
+diff --git a/lib/Makefile b/lib/Makefile
+index 02ddd3b..26ed18f 100644
+--- a/lib/Makefile
++++ b/lib/Makefile
+@@ -80,8 +80,6 @@ clean:
+ 
+ 
+ #------------------------------------------------------------------------
+-#make install is validated only for Linux, OSX, kFreeBSD and Hurd targets
+-ifneq (,$(filter $(shell uname),Linux Darwin GNU/kFreeBSD GNU))
+ 
+ liblz4.pc: liblz4.pc.in Makefile
+ 	@echo creating pkgconfig
+@@ -114,4 +112,3 @@ uninstall:
+ 	@[ -f $(DESTDIR)$(INCLUDEDIR)/lz4frame.h ] && rm -f $(DESTDIR)$(INCLUDEDIR)/lz4frame.h
+ 	@echo lz4 libraries successfully uninstalled
+ 
+-endif
+diff --git a/programs/Makefile b/programs/Makefile
+index f422902..6943363 100644
+--- a/programs/Makefile
++++ b/programs/Makefile
+@@ -113,8 +113,6 @@ clean:
+ 
+ 
+ #------------------------------------------------------------------------
+-#make install is validated only for Linux, OSX, kFreeBSD and Hurd targets
+-ifneq (,$(filter $(shell uname),Linux Darwin GNU/kFreeBSD GNU))
+ 
+ install: lz4 lz4c
+ 	@echo Installing binaries
+@@ -307,4 +305,3 @@ test-mem: lz4 datagen fuzzer frametest fullbench
+ test-mem32: lz4c32 datagen
+ # unfortunately, valgrind doesn't seem to work with non-native binary. If someone knows how to do a valgrind-test on a 32-bits exe with a 64-bits system...
+ 
+-endif