* aclocal wrapper: skip directories in ACLOCAL_PATH that don't exist,

otherwise aclocal barfs.  Updated the builder to use makeWrapper
* Made Automake 1.10 the default.
* Fixed `make check' in Automake by turning off indented logging in
  Make (there is a flag for that now).
* Disabled the `make check' in Automake by default because it takes a
  REALLY long time (e.g. more than 2 hours on Cygwin, 50 minutes on
  Darwin, 25 minutes on Linux) which is a lot for a package that
  otherwise takes 10 seconds to build.  We can add a Hydra job with
  doCheck enabled to do regression testing.
* make-wrapper: allow --run commands to add additional flags to the
  invocation of the wrapped program.  An example is the aclocal
  wrapper: it adds additional -I ... flags.
* make-wrapper: call the wrapped program .foo-wrapped instead of
  .wrapped-foo to make it easier to tell programs apart in `ps'
  output.

svn path=/nixpkgs/branches/stdenv-updates/; revision=14885
This commit is contained in:
Eelco Dolstra 2009-04-05 18:13:59 +00:00
parent 723dfe4240
commit e01be47e53
7 changed files with 49 additions and 62 deletions

View File

@ -66,7 +66,9 @@ makeWrapper() {
fi fi
done done
echo "exec \"$original\" $flagsBefore \"\$@\"" >> $wrapper # Note: extraFlagsArray is an array containing additional flags
# that may be set by --run actions.
echo exec "$original" $flagsBefore '"${extraFlagsArray[@]}"' '"$@"' >> $wrapper
chmod +x $wrapper chmod +x $wrapper
} }
@ -90,7 +92,7 @@ filterExisting() {
# Syntax: wrapProgram <PROGRAM> <MAKE-WRAPPER FLAGS...> # Syntax: wrapProgram <PROGRAM> <MAKE-WRAPPER FLAGS...>
wrapProgram() { wrapProgram() {
local prog="$1" local prog="$1"
local hidden="$(dirname "$prog")/.wrapped-$(basename "$prog")" local hidden="$(dirname "$prog")/.$(basename "$prog")"-wrapped
mv $prog $hidden mv $prog $hidden
makeWrapper $hidden $prog "$@" makeWrapper $hidden $prog "$@"
} }

View File

@ -1,9 +1,10 @@
{stdenv, fetchurl, perl, autoconf}: {stdenv, fetchurl, perl, autoconf, makeWrapper, doCheck ? false}:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
name = "automake-1.10.2"; name = "automake-1.10.2";
builder = ./builder.sh; builder = ./builder.sh;
setupHook = ./setup-hook.sh; setupHook = ./setup-hook.sh;
src = fetchurl { src = fetchurl {
@ -11,12 +12,14 @@ stdenv.mkDerivation rec {
sha256 = "03v4gsvi71nhqvnxxbhkrksdg5icrn8yda021852njfragzck2n3"; sha256 = "03v4gsvi71nhqvnxxbhkrksdg5icrn8yda021852njfragzck2n3";
}; };
patches = [ ./test-broken-make.patch ]; buildInputs = [perl autoconf makeWrapper];
buildInputs = [perl autoconf]; inherit doCheck;
doCheck = true;
# Disable indented log output from Make, otherwise "make.test" will
# fail.
preCheck = "unset NIX_INDENT_MAKE";
# Don't fixup "#! /bin/sh" in Libtool, otherwise it will use the # Don't fixup "#! /bin/sh" in Libtool, otherwise it will use the
# "fixed" path in generated files! # "fixed" path in generated files!
dontPatchShebangs = true; dontPatchShebangs = true;

View File

@ -1,14 +1,16 @@
{stdenv, fetchurl, perl, autoconf}: {stdenv, fetchurl, perl, autoconf, makeWrapper}:
stdenv.mkDerivation { stdenv.mkDerivation {
name = "automake-1.7.9"; name = "automake-1.7.9";
builder = ./builder.sh; builder = ./builder.sh;
setupHook = ./setup-hook.sh;
src = fetchurl { src = fetchurl {
url = http://nixos.org/tarballs/automake-1.7.9.tar.bz2; url = http://nixos.org/tarballs/automake-1.7.9.tar.bz2;
md5 = "571fd0b0598eb2a27dcf68adcfddfacb"; md5 = "571fd0b0598eb2a27dcf68adcfddfacb";
}; };
buildInputs = [perl autoconf];
buildInputs = [perl autoconf makeWrapper];
# Don't fixup "#! /bin/sh" in Libtool, otherwise it will use the # Don't fixup "#! /bin/sh" in Libtool, otherwise it will use the
# "fixed" path in generated files! # "fixed" path in generated files!

View File

@ -1,16 +1,33 @@
{stdenv, fetchurl, perl, autoconf}: {stdenv, fetchurl, perl, autoconf, makeWrapper}:
stdenv.mkDerivation { stdenv.mkDerivation {
name = "automake-1.9.6"; name = "automake-1.9.6";
builder = ./builder.sh; builder = ./builder.sh;
setupHook = ./setup-hook.sh; setupHook = ./setup-hook.sh;
src = fetchurl { src = fetchurl {
url = ftp://ftp.gnu.org/gnu/automake/automake-1.9.6.tar.gz; url = ftp://ftp.gnu.org/gnu/automake/automake-1.9.6.tar.gz;
md5 = "c60f77a42f103606981d456f1615f5b4"; md5 = "c60f77a42f103606981d456f1615f5b4";
}; };
buildInputs = [perl autoconf];
buildInputs = [perl autoconf makeWrapper];
# Don't fixup "#! /bin/sh" in Libtool, otherwise it will use the # Don't fixup "#! /bin/sh" in Libtool, otherwise it will use the
# "fixed" path in generated files! # "fixed" path in generated files!
dontPatchShebangs = true; dontPatchShebangs = true;
meta = {
homepage = http://www.gnu.org/software/automake/;
description = "GNU Automake, a GNU standard-compliant makefile generator";
longDescription = ''
GNU Automake is a tool for automatically generating
`Makefile.in' files compliant with the GNU Coding
Standards. Automake requires the use of Autoconf.
'';
license = "GPLv2+";
};
} }

View File

@ -2,46 +2,25 @@ source $stdenv/setup
postInstall() { postInstall() {
# Create a wrapper around `aclocal' that converts every element in # Create a wrapper around `aclocal' that converts every element in
# `ACLOCAL_PATH' into a `-I dir' option. This way `aclocal' # `ACLOCAL_PATH' into a `-I dir' option. This way `aclocal'
# becomes modular; M4 macros do not need to be stored in a single # becomes modular; M4 macros do not need to be stored in a single
# global directory, while callers of `aclocal' do not need to pass # global directory, while callers of `aclocal' do not need to pass
# `-I' options explicitly. # `-I' options explicitly.
mv $out/bin/aclocal $out/bin/_tmp for prog in $out/bin/aclocal*; do
wrapProgram $prog --run \
for i in $out/bin/aclocal*; do '
rm $i oldIFS=$IFS
ln -s aclocal $i
done
cat > $out/bin/aclocal <<EOF
#! $SHELL -e
oldIFS=\$IFS
IFS=: IFS=:
extra= for dir in $ACLOCAL_PATH; do
for i in \$ACLOCAL_PATH; do if test -n "$dir" -a -d "$dir"; then
if test -n "\$i"; then extraFlagsArray=("${extraFlagsArray[@]}" "-I" "$dir")
extra="\$extra -I \$i"
fi fi
done done
IFS=\$oldIFS IFS=$oldIFS'
done
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 genericBuild

View File

@ -1,16 +0,0 @@
The version of GNU Make in Nixpkgs is "broken" in the sense that it
produces additional output, making `AM_MAKE_INCLUDE' (tested by `make.test')
fail. Thus, we just disable `make.test' for now.
See http://article.gmane.org/gmane.comp.sysutils.automake.bugs/4234 .
--- automake-1.10/tests/Makefile.in 2006-10-15 19:25:25.000000000 +0200
+++ automake-1.10/tests/Makefile.in 2008-07-02 16:40:35.000000000 +0200
@@ -482,7 +482,6 @@ ltdeps.test \
ltlibobjs.test \
ltlibsrc.test \
maintclean.test \
-make.test \
makej.test \
makevars.test \
man.test \

View File

@ -2271,18 +2271,18 @@ let
inherit fetchurl stdenv perl m4 lzma; inherit fetchurl stdenv perl m4 lzma;
}; };
automake = automake19x; automake = automake110x;
automake17x = import ../development/tools/misc/automake/automake-1.7.x.nix { automake17x = import ../development/tools/misc/automake/automake-1.7.x.nix {
inherit fetchurl stdenv perl autoconf; inherit fetchurl stdenv perl autoconf makeWrapper;
}; };
automake19x = import ../development/tools/misc/automake/automake-1.9.x.nix { automake19x = import ../development/tools/misc/automake/automake-1.9.x.nix {
inherit fetchurl stdenv perl autoconf; inherit fetchurl stdenv perl autoconf makeWrapper;
}; };
automake110x = import ../development/tools/misc/automake/automake-1.10.x.nix { automake110x = import ../development/tools/misc/automake/automake-1.10.x.nix {
inherit fetchurl stdenv perl autoconf; inherit fetchurl stdenv perl autoconf makeWrapper;
}; };
avrdude = import ../development/tools/misc/avrdude { avrdude = import ../development/tools/misc/avrdude {