summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/spack/spack/cmd/create.py4
-rw-r--r--var/spack/repos/builtin/packages/hepmc/package.py34
-rw-r--r--var/spack/repos/builtin/packages/py-setproctitle/package.py18
-rw-r--r--var/spack/repos/builtin/packages/silo/package.py28
4 files changed, 67 insertions, 17 deletions
diff --git a/lib/spack/spack/cmd/create.py b/lib/spack/spack/cmd/create.py
index f9b7a382ea..304b531b49 100644
--- a/lib/spack/spack/cmd/create.py
+++ b/lib/spack/spack/cmd/create.py
@@ -245,7 +245,9 @@ class PythonPackageTemplate(PackageTemplate):
base_class_name = 'PythonPackage'
dependencies = """\
- # FIXME: Add dependencies if required.
+ # FIXME: Add dependencies if required. Only add the python dependency
+ # if you need specific versions. A generic python dependency is
+ # added implicity by the PythonPackage class.
# depends_on('python@2.X:2.Y,3.Z:', type=('build', 'run'))
# depends_on('py-setuptools', type='build')
# depends_on('py-foo', type=('build', 'run'))"""
diff --git a/var/spack/repos/builtin/packages/hepmc/package.py b/var/spack/repos/builtin/packages/hepmc/package.py
index 2828a179ff..d208e7ecde 100644
--- a/var/spack/repos/builtin/packages/hepmc/package.py
+++ b/var/spack/repos/builtin/packages/hepmc/package.py
@@ -28,24 +28,46 @@ class Hepmc(CMakePackage):
variant('python', default=False, description='Enable Python bindings')
variant('rootio', default=False, description='Enable ROOT I/O')
+ variant('interfaces', default=False, description='Install interfaces for some Monte-Carlo Event Gens')
depends_on('cmake@2.8.9:', type='build')
- # FIXME: Officially supports Python3, but the build system doesn't find it
- depends_on('python@:2.99.99', when='+python')
+ depends_on('python', when='+python')
depends_on('root', when='+rootio')
- conflicts('+python', when='@:3.1.99')
- conflicts('+rootio', when='@:2.99.99')
+ conflicts('+python', when='@:3.1')
+ conflicts('+rootio', when='@:2')
+ conflicts('+interfaces', when='@:2')
+ @when('@:2')
+ def cmake_args(self):
+ return ['-Dmomentum:STRING=GEV', '-Dlength:STRING=MM']
+
+ @when('@3:')
def cmake_args(self):
spec = self.spec
- return [
+ args = [
'-Dmomentum:STRING=GEV',
'-Dlength:STRING=MM',
'-DHEPMC3_ENABLE_PYTHON={0}'.format(spec.satisfies('+python')),
- '-DHEPMC3_ENABLE_ROOTIO={0}'.format(spec.satisfies('+rootio'))
+ '-DHEPMC3_ENABLE_ROOTIO={0}'.format(spec.satisfies('+rootio')),
+ '-DHEPMC3_INSTALL_INTERFACES={0}'.format(
+ spec.satisfies('+interfaces')),
]
+ if self.spec.satisfies('+python'):
+ py_ver = spec['python'].version.up_to(2)
+ py_sitepkg = join_path(self.prefix, site_packages_dir)
+ args.extend([
+ '-DHEPMC3_PYTHON_VERSIONS={0}'.format(py_ver),
+ '-DHEPMC3_Python_SITEARCH{0}={1}'.format(
+ py_ver.joined, py_sitepkg)
+ ])
+
+ if self.spec.satisfies('+rootio'):
+ args.append('-DROOT_DIR={0}'.format(self.spec['root'].prefix))
+
+ return args
+
def url_for_version(self, version):
if version > Version("3.0.0"):
url = "http://hepmc.web.cern.ch/hepmc/releases/HepMC3-{0}.tar.gz"
diff --git a/var/spack/repos/builtin/packages/py-setproctitle/package.py b/var/spack/repos/builtin/packages/py-setproctitle/package.py
new file mode 100644
index 0000000000..972e595cad
--- /dev/null
+++ b/var/spack/repos/builtin/packages/py-setproctitle/package.py
@@ -0,0 +1,18 @@
+# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
+# Spack Project Developers. See the top-level COPYRIGHT file for details.
+#
+# SPDX-License-Identifier: (Apache-2.0 OR MIT)
+
+from spack import *
+
+
+class PySetproctitle(PythonPackage):
+ """The setproctitle module allows a process to change its title (as
+ displayed by system tools such as ps and top)."""
+
+ homepage = "https://github.com/dvarrazzo/py-setproctitle"
+ url = "https://pypi.io/packages/source/s/setproctitle/setproctitle-1.1.10.tar.gz"
+
+ version('1.1.10', sha256='6283b7a58477dd8478fbb9e76defb37968ee4ba47b05ec1c053cb39638bd7398')
+
+ depends_on('py-setuptools', type='build')
diff --git a/var/spack/repos/builtin/packages/silo/package.py b/var/spack/repos/builtin/packages/silo/package.py
index ef39dfdaaf..9b980ba0ac 100644
--- a/var/spack/repos/builtin/packages/silo/package.py
+++ b/var/spack/repos/builtin/packages/silo/package.py
@@ -31,14 +31,22 @@ class Silo(AutotoolsPackage):
depends_on('hdf5~mpi', when='~mpi')
depends_on('mpi', when='+mpi')
depends_on('hdf5+mpi', when='+mpi')
- depends_on('qt', when='+silex')
+ depends_on('qt~framework@4.8:4.9', when='+silex')
+ depends_on('libx11', when='+silex')
+ depends_on('readline')
depends_on('zlib')
patch('remove-mpiposix.patch', when='@4.8:4.10.2')
def flag_handler(self, name, flags):
- if name == 'ldflags' and self.spec['hdf5'].satisfies('~shared'):
- flags.append('-ldl')
+ spec = self.spec
+ if name == 'ldflags':
+ if spec['hdf5'].satisfies('~shared'):
+ flags.append('-ldl')
+ flags.append(spec['readline'].libs.search_flags)
+ elif name in ('cflags', 'cxxflags', 'fcflags'):
+ if '+pic' in spec:
+ flags.append(self.compiler.pic_flag)
return (flags, None, None)
@when('%clang@9:')
@@ -81,13 +89,13 @@ class Silo(AutotoolsPackage):
]
if '+silex' in spec:
- config_args.append('--with-Qt-dir=%s' % spec['qt'].prefix)
-
- if '+pic' in spec:
- config_args += [
- 'CFLAGS={0}'.format(self.compiler.pic_flag),
- 'CXXFLAGS={0}'.format(self.compiler.pic_flag),
- 'FCFLAGS={0}'.format(self.compiler.pic_flag)]
+ x = spec['libx11']
+ config_args.extend([
+ '--with-Qt-dir=' + spec['qt'].prefix,
+ '--with-Qt-lib=QtGui -lQtCore',
+ '--x-includes=' + x.prefix.include,
+ '--x-libraries=' + x.prefix.lib,
+ ])
if '+mpi' in spec:
config_args.append('CC=%s' % spec['mpi'].mpicc)