summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMassimiliano Culpo <massimiliano.culpo@gmail.com>2020-10-12 16:35:52 +0200
committerGitHub <noreply@github.com>2020-10-12 16:35:52 +0200
commit2399c2e78d2ae0f28040ca345c80d11ef42e060e (patch)
tree944d367258fee44cc6a2d43a36bcc90a813b68e5
parent2d9f692d6ce8303ea719c0477add3c6f1f693947 (diff)
downloadspack-2399c2e78d2ae0f28040ca345c80d11ef42e060e.tar.gz
spack-2399c2e78d2ae0f28040ca345c80d11ef42e060e.tar.bz2
spack-2399c2e78d2ae0f28040ca345c80d11ef42e060e.tar.xz
spack-2399c2e78d2ae0f28040ca345c80d11ef42e060e.zip
autotools: refactor search paths for aclocal in its own method (#19258)
This commit refactors the computation of the search path for aclocal in its own method, so that it's easier to reuse for packages that need to have a custom autoreconf phase. Co-authored-by: Toyohisa Kameyama <kameyama@riken.jp>
-rw-r--r--lib/spack/spack/build_systems/autotools.py15
-rw-r--r--var/spack/repos/builtin/packages/audacious/package.py9
2 files changed, 15 insertions, 9 deletions
diff --git a/lib/spack/spack/build_systems/autotools.py b/lib/spack/spack/build_systems/autotools.py
index 50f0208741..e4b9f566ae 100644
--- a/lib/spack/spack/build_systems/autotools.py
+++ b/lib/spack/spack/build_systems/autotools.py
@@ -266,14 +266,19 @@ class AutotoolsPackage(PackageBase):
# This line is what is needed most of the time
# --install, --verbose, --force
autoreconf_args = ['-ivf']
- for dep in spec.dependencies(deptype='build'):
- if os.path.exists(dep.prefix.share.aclocal):
- autoreconf_args.extend([
- '-I', dep.prefix.share.aclocal
- ])
+ autoreconf_args += self.autoreconf_search_path_args
autoreconf_args += self.autoreconf_extra_args
m.autoreconf(*autoreconf_args)
+ @property
+ def autoreconf_search_path_args(self):
+ """Arguments to autoreconf to modify the search paths"""
+ search_path_args = []
+ for dep in self.spec.dependencies(deptype='build'):
+ if os.path.exists(dep.prefix.share.aclocal):
+ search_path_args.extend(['-I', dep.prefix.share.aclocal])
+ return search_path_args
+
@run_after('autoreconf')
def set_configure_or_die(self):
"""Checks the presence of a ``configure`` file after the
diff --git a/var/spack/repos/builtin/packages/audacious/package.py b/var/spack/repos/builtin/packages/audacious/package.py
index 1b50bfef8a..a38fb18d96 100644
--- a/var/spack/repos/builtin/packages/audacious/package.py
+++ b/var/spack/repos/builtin/packages/audacious/package.py
@@ -2,10 +2,6 @@
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
-
-from spack import *
-
-
class Audacious(AutotoolsPackage):
"""A lightweight and versatile audio player."""
@@ -27,6 +23,11 @@ class Audacious(AutotoolsPackage):
depends_on('glib')
depends_on('qt')
+ def patch(self):
+ search_path_args = ' '.join(self.autoreconf_search_path_args)
+ search_path_str = '-I m4 {0}'.format(search_path_args)
+ filter_file('-I m4', search_path_str, 'autogen.sh')
+
def autoreconf(self, spec, prefix):
bash = which('bash')
bash('./autogen.sh')