nixpkgs/pkgs/development/tools/misc/automake/builder.sh
Eelco Dolstra 817d1b27ef * Provide a wrapper around `aclocal' (in Automake) that automatically
adds all directories specified in `ACLOCAL_PATH' to the `aclocal'
  command line as `-I' flags.  Also, it provides a setup hook that
  adds the `.../share/aclocal' directory of every build input to
  `ACLOCAL_PATH'.

* Upgraded Libtool.

* Graphviz requires the X Athena widgets, which in turn requires the X
  miscellaneous utilities library; added those.  However it doesn't
  work yet since libXt is broken.
  

svn path=/nixpkgs/trunk/; revision=888
2004-03-31 22:47:06 +00:00

48 lines
1 KiB
Bash

. $stdenv/setup
postInstall() {
# Create a wrapper around `aclocal' that converts every element in
# `ACLOCAL_PATH' into a `-I dir' option. This way `aclocal'
# becomes modular; M4 macros do not need to be stored in a single
# global directory, while callers of `aclocal' do not need to pass
# `-I' options explicitly.
mv $out/bin/aclocal $out/bin/_tmp
for i in $out/bin/aclocal*; do
rm $i
ln -s aclocal $i
done
cat > $out/bin/aclocal <<EOF
#! $SHELL -e
oldIFS=\$IFS
IFS=:
extra=
for i in \$ACLOCAL_PATH; do
if test -n "\$i"; then
extra="\$extra -I \$i"
fi
done
IFS=\$oldIFS
exec $out/bin/aclocal-orig \${extra[@]} "\$@"
EOF
chmod +x $out/bin/aclocal
mv $out/bin/_tmp $out/bin/aclocal-orig
# Automatically let `ACLOCAL_PATH' include all build inputs that
# have a `.../share/aclocal' directory.
test -x $out/nix-support || mkdir $out/nix-support
cp -p $setupHook $out/nix-support/setup-hook
}
postInstall=postInstall
genericBuild