From 41840af6894bf718a1038ba1045adef26a687919 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra <eelco.dolstra@logicblox.com> Date: Sat, 19 May 2012 02:52:36 +0000 Subject: [PATCH] =?UTF-8?q?*=20Add=20a=20setup=20hook=20=E2=80=98autorecon?= =?UTF-8?q?fHook=E2=80=99=20to=20simplify=20packages=20that=20need=20to=20?= =?UTF-8?q?=20=20run=20autoreconf:?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit buildInputs = [ autoreconfHook ]; is essentially equivalent to buildInputs = [ autoconf automake libtool ]; preConfigure = "autoreconf -i"; svn path=/nixpkgs/branches/x-updates/; revision=34181 --- pkgs/build-support/setup-hooks/autoreconf.sh | 11 +++++++++++ .../{make-wrapper => setup-hooks}/make-wrapper.sh | 0 pkgs/os-specific/linux/mountall/default.nix | 6 ++---- pkgs/os-specific/linux/usbutils/default.nix | 4 ++-- pkgs/tools/networking/sitecopy/default.nix | 6 ++---- pkgs/top-level/all-packages.nix | 10 ++++++---- 6 files changed, 23 insertions(+), 14 deletions(-) create mode 100644 pkgs/build-support/setup-hooks/autoreconf.sh rename pkgs/build-support/{make-wrapper => setup-hooks}/make-wrapper.sh (100%) diff --git a/pkgs/build-support/setup-hooks/autoreconf.sh b/pkgs/build-support/setup-hooks/autoreconf.sh new file mode 100644 index 000000000000..027c83221633 --- /dev/null +++ b/pkgs/build-support/setup-hooks/autoreconf.sh @@ -0,0 +1,11 @@ +preConfigurePhases+=" autoreconfPhase" + +for i in @autoconf@ @automake@ @libtool@; do + findInputs $i nativePkgs propagated-build-native-inputs +done + +autoreconfPhase() { + runHook preAutoreconf + autoreconf ${autoreconfFlags:---install --force} + runHook postAutoreconf +} diff --git a/pkgs/build-support/make-wrapper/make-wrapper.sh b/pkgs/build-support/setup-hooks/make-wrapper.sh similarity index 100% rename from pkgs/build-support/make-wrapper/make-wrapper.sh rename to pkgs/build-support/setup-hooks/make-wrapper.sh diff --git a/pkgs/os-specific/linux/mountall/default.nix b/pkgs/os-specific/linux/mountall/default.nix index b563b80f9a9f..3d72b0a258ed 100644 --- a/pkgs/os-specific/linux/mountall/default.nix +++ b/pkgs/os-specific/linux/mountall/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, pkgconfig, libnih, dbus, udev, autoconf, automake, libtool, gettext }: +{ stdenv, fetchurl, pkgconfig, libnih, dbus, udev, gettext, autoreconfHook }: stdenv.mkDerivation { name = "mountall-2.35"; @@ -10,9 +10,7 @@ stdenv.mkDerivation { patches = [ ./no-plymouth.patch ./fix-usr1-race.patch ]; - preConfigure = "rm -R aclocal.m4; gettextize -f; autoreconf -vfi"; - - buildInputs = [ pkgconfig libnih dbus.libs udev autoconf automake libtool gettext ]; + buildInputs = [ pkgconfig libnih dbus.libs udev gettext autoreconfHook ]; makeFlags = "initramfshookdir=$(out)/share/initramfs-tools/hooks upstart_jobs_initramfs_configdir=$(out)/share/initramfs-tools/event-driven/upstart-jobs"; diff --git a/pkgs/os-specific/linux/usbutils/default.nix b/pkgs/os-specific/linux/usbutils/default.nix index ed8cc56d2676..5614f55a6223 100644 --- a/pkgs/os-specific/linux/usbutils/default.nix +++ b/pkgs/os-specific/linux/usbutils/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, pkgconfig, libusb1, zlib, autoconf, automake, libtool }: +{ stdenv, fetchurl, pkgconfig, libusb1, zlib, autoreconfHook }: let @@ -18,7 +18,7 @@ stdenv.mkDerivation rec { sha256 = "05sxkm7b7lj8p8kr8kw68m49h66351s803z42233b8lssmc3wlra"; }; - buildInputs = [ pkgconfig libusb1 autoconf automake libtool zlib ]; + buildInputs = [ pkgconfig libusb1 autoreconfHook ]; preConfigure = "autoreconf -i"; diff --git a/pkgs/tools/networking/sitecopy/default.nix b/pkgs/tools/networking/sitecopy/default.nix index 6beaff56aeab..5667744ef221 100644 --- a/pkgs/tools/networking/sitecopy/default.nix +++ b/pkgs/tools/networking/sitecopy/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, neon, zlib, openssl, autoconf, automake, libtool }: +{ stdenv, fetchurl, neon, zlib, openssl, autoreconfHook }: stdenv.mkDerivation rec { name = "sitecopy-0.16.6"; @@ -10,9 +10,7 @@ stdenv.mkDerivation rec { patches = [ ./neon-29.patch ]; - preConfigure = "autoreconf"; - - buildInputs = [ openssl neon zlib autoconf automake libtool ]; + buildInputs = [ openssl neon zlib autoreconfHook ]; configureFlags= "--with-ssl=openssl"; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index c5b8dde2624d..4ec940b6393e 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -245,6 +245,10 @@ let theAttrSet = arg; }; + autoreconfHook = makeSetupHook + { substitutions = { inherit autoconf automake libtool; }; } + ../build-support/setup-hooks/autoreconf.sh; + buildEnv = import ../build-support/buildenv { inherit (pkgs) runCommand perl; }; @@ -327,7 +331,7 @@ let inherit stdenv perl cpio contents ubootChooser; }; - makeWrapper = makeSetupHook {} ../build-support/make-wrapper/make-wrapper.sh; + makeWrapper = makeSetupHook { } ../build-support/setup-hooks/make-wrapper.sh; makeModulesClosure = {kernel, rootModules, allowMissing ? false}: import ../build-support/kernel/modules-closure.nix { @@ -5824,9 +5828,7 @@ let module_init_tools = callPackage ../os-specific/linux/module-init-tools { }; - mountall = callPackage ../os-specific/linux/mountall { - automake = automake111x; - }; + mountall = callPackage ../os-specific/linux/mountall { }; aggregateModules = modules: import ../os-specific/linux/module-init-tools/aggregator.nix {