From acd90145539191595b51189195816668ba51b3bd Mon Sep 17 00:00:00 2001 From: alalazo Date: Sun, 26 Jun 2016 17:36:33 +0200 Subject: [PATCH] autotools : set Executable() in dependent modules --- .../builtin/packages/autoconf/package.py | 28 +++++++++++++++---- .../builtin/packages/automake/package.py | 20 ++++++++++--- .../repos/builtin/packages/libtool/package.py | 23 +++++++++++---- 3 files changed, 56 insertions(+), 15 deletions(-) diff --git a/var/spack/repos/builtin/packages/autoconf/package.py b/var/spack/repos/builtin/packages/autoconf/package.py index d920855a2f..770ceed48b 100644 --- a/var/spack/repos/builtin/packages/autoconf/package.py +++ b/var/spack/repos/builtin/packages/autoconf/package.py @@ -24,18 +24,36 @@ ############################################################################## from spack import * + class Autoconf(Package): - """Autoconf -- system configuration part of autotools""" - homepage = "https://www.gnu.org/software/autoconf/" - url = "http://ftp.gnu.org/gnu/autoconf/autoconf-2.69.tar.gz" + """ + Autoconf -- system configuration part of autotools + """ + homepage = 'https://www.gnu.org/software/autoconf/' + url = 'http://ftp.gnu.org/gnu/autoconf/autoconf-2.69.tar.gz' version('2.69', '82d05e03b93e45f5a39b828dc9c6c29b') version('2.62', '6c1f3b3734999035d77da5024aab4fbd') - depends_on("m4") + depends_on('m4') + + def _make_executable(self, name): + return Executable(join_path(self.prefix.bin, name)) + + def setup_dependent_package(self, module, dependent_spec): + # Autoconf is very likely to be a build dependency, + # so we add the tools it provides to the dependent module + executables = ['autoconf', + 'autoheader', + 'autom4te', + 'autoreconf', + 'autoscan', + 'autoupdate', + 'ifnames'] + for name in executables: + setattr(module, name, self._make_executable(name)) def install(self, spec, prefix): configure("--prefix=%s" % prefix) - make() make("install") diff --git a/var/spack/repos/builtin/packages/automake/package.py b/var/spack/repos/builtin/packages/automake/package.py index 331b364496..78b0a5b34f 100644 --- a/var/spack/repos/builtin/packages/automake/package.py +++ b/var/spack/repos/builtin/packages/automake/package.py @@ -24,10 +24,13 @@ ############################################################################## from spack import * + class Automake(Package): - """Automake -- make file builder part of autotools""" - homepage = "http://www.gnu.org/software/automake/" - url = "http://ftp.gnu.org/gnu/automake/automake-1.14.tar.gz" + """ + Automake -- make file builder part of autotools + """ + homepage = 'http://www.gnu.org/software/automake/' + url = 'http://ftp.gnu.org/gnu/automake/automake-1.14.tar.gz' version('1.15', '716946a105ca228ab545fc37a70df3a3') version('1.14.1', 'd052a3e884631b9c7892f2efce542d75') @@ -35,8 +38,17 @@ class Automake(Package): depends_on('autoconf') + def _make_executable(self, name): + return Executable(join_path(self.prefix.bin, name)) + + def setup_dependent_package(self, module, dependent_spec): + # Automake is very likely to be a build dependency, + # so we add the tools it provides to the dependent module + executables = ['aclocal', 'automake'] + for name in executables: + setattr(module, name, self._make_executable(name)) + def install(self, spec, prefix): configure("--prefix=%s" % prefix) - make() make("install") diff --git a/var/spack/repos/builtin/packages/libtool/package.py b/var/spack/repos/builtin/packages/libtool/package.py index 90e7b3b643..05db3c07c9 100644 --- a/var/spack/repos/builtin/packages/libtool/package.py +++ b/var/spack/repos/builtin/packages/libtool/package.py @@ -25,17 +25,28 @@ from spack import * class Libtool(Package): - """libtool -- library building part of autotools""" - homepage = "https://www.gnu.org/software/libtool/" - url = "http://ftpmirror.gnu.org/libtool/libtool-2.4.2.tar.gz" + """ + libtool -- library building part of autotools + """ + homepage = 'https://www.gnu.org/software/libtool/' + url = 'http://ftpmirror.gnu.org/libtool/libtool-2.4.2.tar.gz' - version('2.4.6' , 'addf44b646ddb4e3919805aa88fa7c5e') - version('2.4.2' , 'd2f3b7d4627e69e13514a40e72a24d50') + version('2.4.6', 'addf44b646ddb4e3919805aa88fa7c5e') + version('2.4.2', 'd2f3b7d4627e69e13514a40e72a24d50') depends_on('m4') + def _make_executable(self, name): + return Executable(join_path(self.prefix.bin, name)) + + def setup_dependent_package(self, module, dependent_spec): + # Automake is very likely to be a build dependency, + # so we add the tools it provides to the dependent module + executables = ['libtoolize', 'libtool'] + for name in executables: + setattr(module, name, self._make_executable(name)) + def install(self, spec, prefix): configure("--prefix=%s" % prefix) - make() make("install")