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):
|
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'
|
base_class_name = 'AutotoolsPackage'
|
||||||
|
|
||||||
@ -152,6 +153,33 @@ def configure_args(self):
|
|||||||
return args"""
|
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):
|
class CMakePackageTemplate(PackageTemplate):
|
||||||
"""Provides appropriate overrides for CMake-based packages"""
|
"""Provides appropriate overrides for CMake-based packages"""
|
||||||
|
|
||||||
@ -269,14 +297,15 @@ def __init__(self, name, *args):
|
|||||||
|
|
||||||
|
|
||||||
templates = {
|
templates = {
|
||||||
'autotools': AutotoolsPackageTemplate,
|
'autotools': AutotoolsPackageTemplate,
|
||||||
'cmake': CMakePackageTemplate,
|
'autoreconf': AutoreconfPackageTemplate,
|
||||||
'scons': SconsPackageTemplate,
|
'cmake': CMakePackageTemplate,
|
||||||
'bazel': BazelPackageTemplate,
|
'scons': SconsPackageTemplate,
|
||||||
'python': PythonPackageTemplate,
|
'bazel': BazelPackageTemplate,
|
||||||
'r': RPackageTemplate,
|
'python': PythonPackageTemplate,
|
||||||
'octave': OctavePackageTemplate,
|
'r': RPackageTemplate,
|
||||||
'generic': PackageTemplate
|
'octave': OctavePackageTemplate,
|
||||||
|
'generic': PackageTemplate
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -326,12 +355,14 @@ def __call__(self, stage, url):
|
|||||||
# uses. If the regular expression matches a file contained in the
|
# uses. If the regular expression matches a file contained in the
|
||||||
# archive, the corresponding build system is assumed.
|
# archive, the corresponding build system is assumed.
|
||||||
clues = [
|
clues = [
|
||||||
(r'/configure$', 'autotools'),
|
(r'/configure$', 'autotools'),
|
||||||
(r'/CMakeLists.txt$', 'cmake'),
|
(r'/configure.(in|ac)$', 'autoreconf'),
|
||||||
(r'/SConstruct$', 'scons'),
|
(r'/Makefile.am$', 'autoreconf'),
|
||||||
(r'/setup.py$', 'python'),
|
(r'/CMakeLists.txt$', 'cmake'),
|
||||||
(r'/NAMESPACE$', 'r'),
|
(r'/SConstruct$', 'scons'),
|
||||||
(r'/WORKSPACE$', 'bazel')
|
(r'/setup.py$', 'python'),
|
||||||
|
(r'/NAMESPACE$', 'r'),
|
||||||
|
(r'/WORKSPACE$', 'bazel')
|
||||||
]
|
]
|
||||||
|
|
||||||
# Peek inside the compressed file.
|
# Peek inside the compressed file.
|
||||||
@ -356,6 +387,7 @@ def __call__(self, stage, url):
|
|||||||
for pattern, bs in clues:
|
for pattern, bs in clues:
|
||||||
if any(re.search(pattern, l) for l in lines):
|
if any(re.search(pattern, l) for l in lines):
|
||||||
build_system = bs
|
build_system = bs
|
||||||
|
break
|
||||||
|
|
||||||
self.build_system = build_system
|
self.build_system = build_system
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user