adobe-reader: Unpack to $out/libexec/adobe-reader

This prevents polluting Nix profiles.
This commit is contained in:
Eelco Dolstra 2012-11-08 14:49:54 +01:00
parent 892180306d
commit 704f7d6a2c

View File

@ -3,35 +3,40 @@ source $stdenv/setup
echo "unpacking $src..."
tar xvfa $src
mkdir -p $out/Adobe/Reader9
echo "unpacking reader..."
set +e
p=$out/libexec/adobe-reader
mkdir -p $out/libexec
tar xvf AdobeReader/COMMON.TAR -C $out
tar xvf AdobeReader/ILINXR.TAR -C $out
set -e
mv $out/Adobe/Reader9 $p
rmdir $out/Adobe
# Disable this plugin for now (it needs LDAP, and I'm too lazy to add it).
rm $out/Adobe/Reader*/Reader/intellinux/plug_ins/PPKLite.api
rm $p/Reader/intellinux/plug_ins/PPKLite.api
# More pointless files.
rm $p/bin/UNINSTALL
patchelf --interpreter "$(cat $NIX_GCC/nix-support/dynamic-linker)" \
--set-rpath $libPath \
$out/Adobe/Reader*/Reader/intellinux/bin/acroread
$p/Reader/intellinux/bin/acroread
# The "xargs -r" is to shut up a warning when Mozilla can't be found.
substituteInPlace $out/Adobe/Reader*/bin/acroread \
substituteInPlace $p/bin/acroread \
--replace /bin/pwd $(type -P pwd) \
--replace /bin/ls $(type -P ls) \
--replace xargs "xargs -r"
mkdir -p $out/bin
ln -s $out/Adobe/Reader*/bin/acroread $out/bin/acroread
ln -s $p/bin/acroread $out/bin/acroread
mkdir -p $out/share/applications
mv $out/Adobe/Reader9/Resource/Support/AdobeReader.desktop $out/share/applications/
mv $p/Resource/Support/AdobeReader.desktop $out/share/applications/
icon=$p/Resource/Icons/128x128/AdobeReader9.png
[ -e $icon ]
sed -i $out/share/applications/AdobeReader.desktop \
-e "s|Icon=.*|Icon=$out/Adobe/Reader9/Resource/Icons/128x128/AdobeReader9.png|"
-e "s|Icon=.*|Icon=$icon|"
# Not sure if this works.
mkdir -p $out/share/mimelnk/application
mv $out/Adobe/Reader9/Resource/Support/vnd*.desktop $out/share/mimelnk/application
mv $p/Resource/Support/vnd*.desktop $out/share/mimelnk/application