Allow spack create to detect packages that need to run autoreconf (#2848)
This commit is contained in:
parent
a040c8c743
commit
f0f230d480
@ -136,7 +136,8 @@ def write(self, pkg_path):
|
||||
|
||||
|
||||
class AutotoolsPackageTemplate(PackageTemplate):
|
||||
"""Provides appropriate overrides for Autotools-based packages"""
|
||||
"""Provides appropriate overrides for Autotools-based packages
|
||||
that *do* come with a ``configure`` script"""
|
||||
|
||||
base_class_name = 'AutotoolsPackage'
|
||||
|
||||
@ -152,6 +153,33 @@ def configure_args(self):
|
||||
return args"""
|
||||
|
||||
|
||||
class AutoreconfPackageTemplate(PackageTemplate):
|
||||
"""Provides appropriate overrides for Autotools-based packages
|
||||
that *do not* come with a ``configure`` script"""
|
||||
|
||||
base_class_name = 'AutotoolsPackage'
|
||||
|
||||
dependencies = """\
|
||||
depends_on('autoconf', type='build')
|
||||
depends_on('automake', type='build')
|
||||
depends_on('libtool', type='build')
|
||||
depends_on('m4', type='build')
|
||||
|
||||
# FIXME: Add additional dependencies if required.
|
||||
# depends_on('foo')"""
|
||||
|
||||
body = """\
|
||||
def autoreconf(self, spec, prefix):
|
||||
# FIXME: Modify the autoreconf method as necessary
|
||||
autoreconf('--install', '--verbose', '--force')
|
||||
|
||||
def configure_args(self):
|
||||
# FIXME: Add arguments other than --prefix
|
||||
# FIXME: If not needed delete this function
|
||||
args = []
|
||||
return args"""
|
||||
|
||||
|
||||
class CMakePackageTemplate(PackageTemplate):
|
||||
"""Provides appropriate overrides for CMake-based packages"""
|
||||
|
||||
@ -269,14 +297,15 @@ def __init__(self, name, *args):
|
||||
|
||||
|
||||
templates = {
|
||||
'autotools': AutotoolsPackageTemplate,
|
||||
'cmake': CMakePackageTemplate,
|
||||
'scons': SconsPackageTemplate,
|
||||
'bazel': BazelPackageTemplate,
|
||||
'python': PythonPackageTemplate,
|
||||
'r': RPackageTemplate,
|
||||
'octave': OctavePackageTemplate,
|
||||
'generic': PackageTemplate
|
||||
'autotools': AutotoolsPackageTemplate,
|
||||
'autoreconf': AutoreconfPackageTemplate,
|
||||
'cmake': CMakePackageTemplate,
|
||||
'scons': SconsPackageTemplate,
|
||||
'bazel': BazelPackageTemplate,
|
||||
'python': PythonPackageTemplate,
|
||||
'r': RPackageTemplate,
|
||||
'octave': OctavePackageTemplate,
|
||||
'generic': PackageTemplate
|
||||
}
|
||||
|
||||
|
||||
@ -326,12 +355,14 @@ def __call__(self, stage, url):
|
||||
# uses. If the regular expression matches a file contained in the
|
||||
# archive, the corresponding build system is assumed.
|
||||
clues = [
|
||||
(r'/configure$', 'autotools'),
|
||||
(r'/CMakeLists.txt$', 'cmake'),
|
||||
(r'/SConstruct$', 'scons'),
|
||||
(r'/setup.py$', 'python'),
|
||||
(r'/NAMESPACE$', 'r'),
|
||||
(r'/WORKSPACE$', 'bazel')
|
||||
(r'/configure$', 'autotools'),
|
||||
(r'/configure.(in|ac)$', 'autoreconf'),
|
||||
(r'/Makefile.am$', 'autoreconf'),
|
||||
(r'/CMakeLists.txt$', 'cmake'),
|
||||
(r'/SConstruct$', 'scons'),
|
||||
(r'/setup.py$', 'python'),
|
||||
(r'/NAMESPACE$', 'r'),
|
||||
(r'/WORKSPACE$', 'bazel')
|
||||
]
|
||||
|
||||
# Peek inside the compressed file.
|
||||
@ -356,6 +387,7 @@ def __call__(self, stage, url):
|
||||
for pattern, bs in clues:
|
||||
if any(re.search(pattern, l) for l in lines):
|
||||
build_system = bs
|
||||
break
|
||||
|
||||
self.build_system = build_system
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user