summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMilton Woods <miltonjwoods@gmail.com>2017-05-24 01:06:59 +1000
committerAdam J. Stewart <ajstewart426@gmail.com>2017-05-23 10:06:59 -0500
commit4553b1400cd6432ecadfb80e3ef6c44f098481b4 (patch)
treed0d78ee1df3953c90fe0f0b2a806b95fb5668af3
parent1469cfd0e7b470704091ac0848bb8aebd1a23ccb (diff)
downloadspack-4553b1400cd6432ecadfb80e3ef6c44f098481b4.tar.gz
spack-4553b1400cd6432ecadfb80e3ef6c44f098481b4.tar.bz2
spack-4553b1400cd6432ecadfb80e3ef6c44f098481b4.tar.xz
spack-4553b1400cd6432ecadfb80e3ef6c44f098481b4.zip
Magics with eccodes variant (#4320)
* magics: use filter_file to avoid using system python in all versions * magics: add eccodes variant to switch between eccodes and grib-api
-rw-r--r--var/spack/repos/builtin/packages/magics/no_hardcoded_python.patch5
-rw-r--r--var/spack/repos/builtin/packages/magics/package.py26
2 files changed, 15 insertions, 16 deletions
diff --git a/var/spack/repos/builtin/packages/magics/no_hardcoded_python.patch b/var/spack/repos/builtin/packages/magics/no_hardcoded_python.patch
deleted file mode 100644
index e2e2a5d1ba..0000000000
--- a/var/spack/repos/builtin/packages/magics/no_hardcoded_python.patch
+++ /dev/null
@@ -1,5 +0,0 @@
---- a/tools/xml2mv.py 2016-06-27 17:49:27.000000000 +0200
-+++ a/tools/xml2mv.py 2016-09-13 16:25:17.246960456 +0200
-@@ -1 +1 @@
--#!/usr/bin/python
-+#!/usr/bin/env python
diff --git a/var/spack/repos/builtin/packages/magics/package.py b/var/spack/repos/builtin/packages/magics/package.py
index fca92d69d4..1b3e3e87bf 100644
--- a/var/spack/repos/builtin/packages/magics/package.py
+++ b/var/spack/repos/builtin/packages/magics/package.py
@@ -41,10 +41,6 @@ class Magics(Package):
version('2.29.4', '91c561f413316fb665b3bb563f3878d1')
version('2.29.0', 'db20a4d3c51a2da5657c31ae3de59709', preferred=True)
- # The patch changes the hardcoded path to python in shebang to enable the
- # usage of the first python installation that appears in $PATH
- patch('no_hardcoded_python.patch', when='@:2.29.6')
-
# The patch reorders includes and adds namespaces where necessary to
# resolve ambiguity of invocations of isnan and isinf functions. The
# patch is not needed since the version 2.29.1
@@ -55,6 +51,7 @@ class Magics(Package):
variant('cairo', default=True, description='Enable cairo support[png/jpeg]')
variant('metview', default=False, description='Enable metview support')
variant('qt', default=False, description='Enable metview support with qt')
+ variant('eccodes', default=False, description='Use eccodes instead of grib-api')
depends_on('cmake', type='build')
depends_on('pkg-config', type='build')
@@ -64,8 +61,8 @@ class Magics(Package):
depends_on('python', type='build')
depends_on('perl', type='build')
depends_on('perl-xml-parser', type='build')
- depends_on('eccodes', when='@2.30.0:')
- depends_on('grib-api', when='@:2.29.6')
+ depends_on('eccodes', when='+eccodes')
+ depends_on('grib-api', when='~eccodes')
depends_on('proj')
depends_on('boost')
depends_on('expat')
@@ -74,9 +71,14 @@ class Magics(Package):
depends_on('libemos', when='+bufr')
depends_on('qt', when='+metview+qt')
+ conflicts('+eccodes', when='@:2.29.0')
+
+ # Replace system python and perl by spack versions:
def patch(self):
for plfile in glob.glob('*/*.pl'):
filter_file('#!/usr/bin/perl', '#!/usr/bin/env perl', plfile)
+ for pyfile in glob.glob('*/*.py'):
+ filter_file('#!/usr/bin/python', '#!/usr/bin/env python', pyfile)
def install(self, spec, prefix):
options = []
@@ -87,11 +89,6 @@ class Magics(Package):
options.append('-DPROJ4_PATH=%s' % spec['proj'].prefix)
options.append('-DENABLE_TESTS=OFF')
- if self.version >= Version('2.30.0'):
- options.append('-DECCODES_PATH=%s' % spec['eccodes'].prefix)
- else:
- options.append('-DGRIB_API_PATH=%s' % spec['grib-api'].prefix)
-
if '+bufr' in spec:
options.append('-DENABLE_BUFR=ON')
options.append('-DLIBEMOS_PATH=%s' % spec['libemos'].prefix)
@@ -119,6 +116,13 @@ class Magics(Package):
else:
options.append('-DENABLE_METVIEW=OFF')
+ if '+eccodes' in spec:
+ options.append('-DENABLE_ECCODES=ON')
+ options.append('-DECCODES_PATH=%s' % spec['eccodes'].prefix)
+ else:
+ options.append('-DENABLE_ECCODES=OFF')
+ options.append('-DGRIB_API_PATH=%s' % spec['grib-api'].prefix)
+
if (self.compiler.f77 is None) or (self.compiler.fc is None):
options.append('-DENABLE_FORTRAN=OFF')