about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--pkgs/tools/compression/bzip2/builder.sh31
1 files changed, 31 insertions, 0 deletions
diff --git a/pkgs/tools/compression/bzip2/builder.sh b/pkgs/tools/compression/bzip2/builder.sh
index 49028c0e5a1ea..00deff9e2c07f 100644
--- a/pkgs/tools/compression/bzip2/builder.sh
+++ b/pkgs/tools/compression/bzip2/builder.sh
@@ -1,3 +1,34 @@
 . $stdenv/setup
 installFlags="PREFIX=$out"
+
+preBuild=preBuild
+preBuild() {
+    make -f Makefile-libbz2_so
+}
+
+patchELF() {
+    # Patch all ELF executables and shared libraries.
+    header "patching ELF executables and libraries (BLA)"
+    find "$prefix" \( \
+        \( -type f -a -name "*.so*" \) -o \
+        \( -type f -a -perm +0100 \) \
+        \) -exec patchelf --shrink-rpath {} \;
+    stopNest
+}
+
+preInstall=preInstall
+preInstall() {
+    ensureDir $out/lib
+    cp -pd libbz2.so* $out/lib
+    ln -s libbz2.so.*.*.* $out/lib/libbz2.so
+}
+
+postInstall=postInstall
+postInstall() {
+    rm $out/bin/bunzip2 $out/bin/bzcat
+    ln -s bzip2 $out/bin/bunzip2
+    ln -s bzip2 $out/bin/bzcat
+}
+
 genericBuild
+