summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAdam J. Stewart <ajstewart426@gmail.com>2019-09-08 10:48:50 -0500
committerGitHub <noreply@github.com>2019-09-08 10:48:50 -0500
commitbff667051b1d23ebd2e8222f7458b980390c1c37 (patch)
tree77e00a78cd18bda6143a394d3322fe1de70a9e3c /lib
parent5a21c781f3fb9c190ab43f6f6245bf822db55ef2 (diff)
downloadspack-bff667051b1d23ebd2e8222f7458b980390c1c37.tar.gz
spack-bff667051b1d23ebd2e8222f7458b980390c1c37.tar.bz2
spack-bff667051b1d23ebd2e8222f7458b980390c1c37.tar.xz
spack-bff667051b1d23ebd2e8222f7458b980390c1c37.zip
Fix PyQt installation (#12479)
* Fix PyQt installation * Switch dependency type * Replace SIP dependency with resource * Relax py-pyqt4 Qt dependency
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/docs/build_systems/sippackage.rst12
-rw-r--r--lib/spack/spack/build_systems/sip.py44
2 files changed, 41 insertions, 15 deletions
diff --git a/lib/spack/docs/build_systems/sippackage.rst b/lib/spack/docs/build_systems/sippackage.rst
index cb744e858f..1f0fb7b426 100644
--- a/lib/spack/docs/build_systems/sippackage.rst
+++ b/lib/spack/docs/build_systems/sippackage.rst
@@ -51,15 +51,21 @@ Build system dependencies
``SIPPackage`` requires several dependencies. Python is needed to run
the ``configure.py`` build script, and to run the resulting Python
libraries. Qt is needed to provide the ``qmake`` command. SIP is also
-needed to build the package. All of these dependencies are automatically
-added via the base class
+needed to build the package. SIP is an unusual dependency in that it
+must be installed in the same installation directory as the package,
+so instead of a ``depends_on``, we use a ``resource``. All of these
+dependencies are automatically added via the base class
.. code-block:: python
extends('python')
depends_on('qt', type='build')
- depends_on('py-sip', type='build')
+
+ resource(name='sip',
+ url='https://www.riverbankcomputing.com/static/Downloads/sip/4.19.18/sip-4.19.18.tar.gz',
+ sha256='c0bd863800ed9b15dcad477c4017cdb73fa805c25908b0240564add74d697e1e',
+ destination='.')
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
diff --git a/lib/spack/spack/build_systems/sip.py b/lib/spack/spack/build_systems/sip.py
index 6d51ff57bd..da2c770ba7 100644
--- a/lib/spack/spack/build_systems/sip.py
+++ b/lib/spack/spack/build_systems/sip.py
@@ -4,11 +4,10 @@
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import inspect
-import os
from llnl.util.filesystem import working_dir
-from spack.directives import depends_on, extends
-from spack.package import PackageBase, run_after
+from spack.directives import depends_on, extends, resource
+from spack.package import PackageBase, run_before, run_after
class SIPPackage(PackageBase):
@@ -32,22 +31,46 @@ class SIPPackage(PackageBase):
# build-system class we are using
build_system_class = 'SIPPackage'
+ #: Name of private sip module to install alongside package
+ sip_module = 'sip'
+
#: Callback names for install-time test
install_time_test_callbacks = ['import_module_test']
extends('python')
depends_on('qt')
- depends_on('py-sip')
- def configure_file(self):
- """Returns the name of the configure file to use."""
- return 'configure.py'
+ resource(name='sip',
+ url='https://www.riverbankcomputing.com/static/Downloads/sip/4.19.18/sip-4.19.18.tar.gz',
+ sha256='c0bd863800ed9b15dcad477c4017cdb73fa805c25908b0240564add74d697e1e',
+ destination='.')
def python(self, *args, **kwargs):
"""The python ``Executable``."""
inspect.getmodule(self).python(*args, **kwargs)
+ @run_before('configure')
+ def install_sip(self):
+ args = [
+ '--sip-module={0}'.format(self.sip_module),
+ '--bindir={0}'.format(self.prefix.bin),
+ '--destdir={0}'.format(inspect.getmodule(self).site_packages_dir),
+ '--incdir={0}'.format(inspect.getmodule(self).python_include_dir),
+ '--sipdir={0}'.format(self.prefix.share.sip),
+ '--stubsdir={0}'.format(inspect.getmodule(self).site_packages_dir),
+ ]
+
+ with working_dir('sip-4.19.18'):
+ self.python('configure.py', *args)
+
+ inspect.getmodule(self).make()
+ inspect.getmodule(self).make('install')
+
+ def configure_file(self):
+ """Returns the name of the configure file to use."""
+ return 'configure.py'
+
def configure(self, spec, prefix):
"""Configure the package."""
configure = self.configure_file()
@@ -58,11 +81,8 @@ class SIPPackage(PackageBase):
'--verbose',
'--confirm-license',
'--qmake', spec['qt'].prefix.bin.qmake,
- '--sip', spec['py-sip'].prefix.bin.sip,
- '--sip-incdir', os.path.join(
- spec['py-sip'].prefix,
- spec['python'].package.python_include_dir
- ),
+ '--sip', prefix.bin.sip,
+ '--sip-incdir', inspect.getmodule(self).python_include_dir,
'--bindir', prefix.bin,
'--destdir', inspect.getmodule(self).site_packages_dir,
])