biome: 1.9.2 -> 1.9.3
[NixPkgs.git] / pkgs / applications / misc / adobe-reader / builder.sh
blob4291da80576d09b54375721a22b088b0908f78ea
1 if [ -e "$NIX_ATTRS_SH_FILE" ]; then . "$NIX_ATTRS_SH_FILE"; elif [ -f .attrs.sh ]; then . .attrs.sh; fi
2 source $stdenv/setup
4 echo "unpacking $src..."
5 tar xvfa $src
7 echo "unpacking reader..."
8 p=$out/libexec/adobe-reader
9 mkdir -p $out/libexec
10 tar xvf AdobeReader/COMMON.TAR -C $out
11 tar xvf AdobeReader/ILINXR.TAR -C $out
12 mv $out/Adobe/Reader9 $p
13 rmdir $out/Adobe
15 # Disable this plugin for now (it needs LDAP, and I'm too lazy to add it).
16 rm $p/Reader/intellinux/plug_ins/PPKLite.api
18 # More pointless files.
19 rm $p/bin/UNINSTALL
21 patchelf --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
22 --set-rpath $libPath \
23 $p/Reader/intellinux/bin/acroread
25 # The "xargs -r" is to shut up a warning when Mozilla can't be found.
26 substituteInPlace $p/bin/acroread \
27 --replace /bin/pwd $(type -P pwd) \
28 --replace /bin/ls $(type -P ls) \
29 --replace xargs "xargs -r"
31 mkdir -p $out/bin
32 ln -s $p/bin/acroread $out/bin/acroread
34 mkdir -p $out/share/applications
35 mv $p/Resource/Support/AdobeReader.desktop $out/share/applications/
36 icon=$p/Resource/Icons/128x128/AdobeReader9.png
37 [ -e $icon ]
38 sed -i $out/share/applications/AdobeReader.desktop \
39 -e "s|Icon=.*|Icon=$icon|"
41 # Not sure if this works.
42 mkdir -p $out/share/mimelnk/application
43 mv $p/Resource/Support/vnd*.desktop $out/share/mimelnk/application