summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorSinan <sbulutw@gmail.com>2020-03-18 11:19:46 -0700
committerGitHub <noreply@github.com>2020-03-18 13:19:46 -0500
commit3bcb5b3a590331b2d1bbdf19fc2d1ca27618357a (patch)
tree6f517385eb7063ddc7180b9eea707cafcb13477c /var
parent056fc996760a6b0085308848bea5d9d316fb3e56 (diff)
downloadspack-3bcb5b3a590331b2d1bbdf19fc2d1ca27618357a.tar.gz
spack-3bcb5b3a590331b2d1bbdf19fc2d1ca27618357a.tar.bz2
spack-3bcb5b3a590331b2d1bbdf19fc2d1ca27618357a.tar.xz
spack-3bcb5b3a590331b2d1bbdf19fc2d1ca27618357a.zip
package/QGIS: fix cmake/FindPyqt.py (#15455)
* fix cmake/FindPyqt.py * apply patch * generalize patch * rename patch * fix typo Co-authored-by: Sinan81 <sbulut@3vgeomatics.com> Co-authored-by: Sinan81 <Sinan81@github>
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/qgis/package.py2
-rw-r--r--var/spack/repos/builtin/packages/qgis/pyqt5.patch25
2 files changed, 27 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/qgis/package.py b/var/spack/repos/builtin/packages/qgis/package.py
index af3fe5db3e..4a6d6a3583 100644
--- a/var/spack/repos/builtin/packages/qgis/package.py
+++ b/var/spack/repos/builtin/packages/qgis/package.py
@@ -114,6 +114,8 @@ class Qgis(CMakePackage):
depends_on('qtkeychain@:1.5.99', when='^qt@4')
depends_on('qt@:4', when='@2')
+ patch('pyqt5.patch', when='^qt@5')
+
def cmake_args(self):
spec = self.spec
args = []
diff --git a/var/spack/repos/builtin/packages/qgis/pyqt5.patch b/var/spack/repos/builtin/packages/qgis/pyqt5.patch
new file mode 100644
index 0000000000..1e6b7e6149
--- /dev/null
+++ b/var/spack/repos/builtin/packages/qgis/pyqt5.patch
@@ -0,0 +1,25 @@
+diff --git a/cmake/FindPyQt5.py b/cmake/FindPyQt5.py
+index 6a55a0f801..d6eda1fa1e 100644
+--- a/cmake/FindPyQt5.py
++++ b/cmake/FindPyQt5.py
+@@ -40,6 +40,7 @@ except ImportError:
+ import sys
+ cfg = sipconfig.Configuration()
+ sip_dir = cfg.default_sip_dir
++ pyqt_prefix = os.sep.join(PyQt5.QtCore.__file__.split(os.sep)[0:-5])
+ if sys.platform.startswith('freebsd'):
+ py_version = str(sys.version_info.major) + str(sys.version_info.minor)
+ sip_dir = sip_dir.replace(py_version, '')
+@@ -53,9 +54,9 @@ except ImportError:
+ 'pyqt_version': PyQt5.QtCore.PYQT_VERSION,
+ 'pyqt_version_str': PyQt5.QtCore.PYQT_VERSION_STR,
+ 'pyqt_sip_flags': PyQt5.QtCore.PYQT_CONFIGURATION['sip_flags'],
+- 'pyqt_mod_dir': os.path.join(cfg.default_mod_dir, "PyQt5"),
+- 'pyqt_sip_dir': sip_dir,
+- 'pyqt_bin_dir': cfg.default_bin_dir,
++ 'pyqt_mod_dir': os.path.dirname(PyQt5.QtCore.__file__),
++ 'pyqt_sip_dir': os.path.join(pyqt_prefix,'share','sip','PyQt5'),
++ 'pyqt_bin_dir': os.path.join(pyqt_prefix,'bin'),
+ }
+ pyqtcfg = sipconfig.Configuration([cfg])
+