about summary refs log tree commit diff
path: root/pkgs/tools/compression/bzip2/builder.sh
blob: 00deff9e2c07f6cc6a685ead314133d9f775e73f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
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