diff options
author | Adam J. Stewart <ajstewart426@gmail.com> | 2016-08-10 10:39:49 -0500 |
---|---|---|
committer | Adam J. Stewart <ajstewart426@gmail.com> | 2016-08-11 10:33:43 -0500 |
commit | b6fad65f52c781e63065e68e9d42be5f3dfc8ace (patch) | |
tree | 1ce6cec0cf7a31a1dec7915b781d4ea67bbb596d | |
parent | 1363b05e93dc5ba48cdfe73d2f9ad4c2cc68b08a (diff) | |
download | spack-b6fad65f52c781e63065e68e9d42be5f3dfc8ace.tar.gz spack-b6fad65f52c781e63065e68e9d42be5f3dfc8ace.tar.bz2 spack-b6fad65f52c781e63065e68e9d42be5f3dfc8ace.tar.xz spack-b6fad65f52c781e63065e68e9d42be5f3dfc8ace.zip |
Combine patch for all versions
Patch doesn't work with @when unless you specify a patch for every
version. When running `spack patch` for a version without a patch,
spack thinks that a patch exists, tries to apply it, but it doesn't
exist. Spack gets very confused.
-rw-r--r-- | var/spack/repos/builtin/packages/qt/package.py | 52 |
1 files changed, 25 insertions, 27 deletions
diff --git a/var/spack/repos/builtin/packages/qt/package.py b/var/spack/repos/builtin/packages/qt/package.py index 44dbc7f709..ba701d5253 100644 --- a/var/spack/repos/builtin/packages/qt/package.py +++ b/var/spack/repos/builtin/packages/qt/package.py @@ -114,34 +114,32 @@ class Qt(Package): def setup_dependent_environment(self, spack_env, run_env, dspec): spack_env.set('QTDIR', self.prefix) - @when('@4') - def patch(self): - # Fix qmake compilers in the default mkspec - filter_file('^QMAKE_CC .*', 'QMAKE_CC = cc', - 'mkspecs/common/g++-base.conf') - filter_file('^QMAKE_CXX .*', 'QMAKE_CXX = c++', - 'mkspecs/common/g++-base.conf') - - # Necessary to build with GCC 6 and other modern compilers - # http://stackoverflow.com/questions/10354371/ - filter_file('(^QMAKE_CXXFLAGS .*)', r'\1 -std=gnu++98', - 'mkspecs/common/gcc-base.conf') - - filter_file('^QMAKE_LFLAGS_NOUNDEF .*', 'QMAKE_LFLAGS_NOUNDEF = ', - 'mkspecs/common/g++-unix.conf') - - @when('@5:') def patch(self): - # Fix qmake compilers in the default mkspec - filter_file('^QMAKE_COMPILER .*', 'QMAKE_COMPILER = cc', - 'qtbase/mkspecs/common/g++-base.conf') - filter_file('^QMAKE_CC .*', 'QMAKE_CC = cc', - 'qtbase/mkspecs/common/g++-base.conf') - filter_file('^QMAKE_CXX .*', 'QMAKE_CXX = c++', - 'qtbase/mkspecs/common/g++-base.conf') - - filter_file('^QMAKE_LFLAGS_NOUNDEF .*', 'QMAKE_LFLAGS_NOUNDEF = ', - 'qtbase/mkspecs/common/g++-unix.conf') + if self.spec.satisfies('@4'): + # Fix qmake compilers in the default mkspec + filter_file('^QMAKE_CC .*', 'QMAKE_CC = cc', + 'mkspecs/common/g++-base.conf') + filter_file('^QMAKE_CXX .*', 'QMAKE_CXX = c++', + 'mkspecs/common/g++-base.conf') + + # Necessary to build with GCC 6 and other modern compilers + # http://stackoverflow.com/questions/10354371/ + filter_file('(^QMAKE_CXXFLAGS .*)', r'\1 -std=gnu++98', + 'mkspecs/common/gcc-base.conf') + + filter_file('^QMAKE_LFLAGS_NOUNDEF .*', 'QMAKE_LFLAGS_NOUNDEF = ', + 'mkspecs/common/g++-unix.conf') + elif self.spec.satisfies('@5:'): + # Fix qmake compilers in the default mkspec + filter_file('^QMAKE_COMPILER .*', 'QMAKE_COMPILER = cc', + 'qtbase/mkspecs/common/g++-base.conf') + filter_file('^QMAKE_CC .*', 'QMAKE_CC = cc', + 'qtbase/mkspecs/common/g++-base.conf') + filter_file('^QMAKE_CXX .*', 'QMAKE_CXX = c++', + 'qtbase/mkspecs/common/g++-base.conf') + + filter_file('^QMAKE_LFLAGS_NOUNDEF .*', 'QMAKE_LFLAGS_NOUNDEF = ', + 'qtbase/mkspecs/common/g++-unix.conf') @property def common_config_args(self): |