gnu: Add python-pyqt.

* gnu/packages/qt.scm (python-pyqt, python2-pyqt): New variables.
* gnu/packages/patches/pyqt-configure.patch: New file.
* gnu-system.am (dist_patch_DATA): Register patch.
master
Andreas Enge 2015-01-25 20:07:08 +01:00
parent 84ef83dd05
commit 014e7dd8f0
3 changed files with 80 additions and 0 deletions

View File

@ -462,6 +462,7 @@ dist_patch_DATA = \
gnu/packages/patches/pulseaudio-fix-mult-test.patch \
gnu/packages/patches/pybugz-encode-error.patch \
gnu/packages/patches/pybugz-stty.patch \
gnu/packages/patches/pyqt-configure.patch \
gnu/packages/patches/python-fix-tests.patch \
gnu/packages/patches/python-libffi-mips-n32-fix.patch \
gnu/packages/patches/python-sqlite-3.8.4-test-fix.patch \

View File

@ -0,0 +1,15 @@
Have configure.py modify internal variables depending on the --qml-plugindir
configure option.
diff -u PyQt-gpl-5.4.alt/configure.py PyQt-gpl-5.4/configure.py
--- PyQt-gpl-5.4.alt/configure.py 2015-01-25 17:27:50.000000000 +0100
+++ PyQt-gpl-5.4/configure.py 2015-01-25 17:56:41.000000000 +0100
@@ -904,6 +904,9 @@
if opts.pyuicinterpreter is not None:
self.pyuic_interpreter = opts.pyuicinterpreter
+ if opts.qmlplugindir is not None:
+ self.qml_plugin_dir = opts.qmlplugindir
+
if opts.qsciapidir is not None:
self.qsci_api_dir = opts.qsciapidir

View File

@ -334,3 +334,67 @@ module provides support functions to the automatically generated code.")
(name "python2-sip")
(native-inputs
`(("python" ,python-2)))))
(define-public python-pyqt
(package
(name "python-pyqt")
(version "5.4")
(source
(origin
(method url-fetch)
(uri
(string-append "mirror://sourceforge/pyqt/PyQt5/"
"PyQt-" version "/PyQt-gpl-"
version ".tar.gz"))
(sha256
(base32
"0cbpa63whi8a5akff4pcnfwzpzx7ycac2ynj00ly52m6zbsn80kn"))
(patches (list (search-patch "pyqt-configure.patch")))))
(build-system gnu-build-system)
(native-inputs
`(("python-sip" ,python-sip)
("qt" ,qt))) ; for qmake
(inputs
`(("python" ,python-wrapper)))
(arguments
`(#:phases
(alist-replace
'configure
(lambda* (#:key inputs outputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out"))
(bin (string-append out "/bin"))
(sip (string-append out "/share/sip"))
(plugins (string-append out "/plugins"))
(designer (string-append plugins "/designer"))
(qml (string-append plugins "/PyQt5"))
(python-version
(string-take
(string-take-right (assoc-ref inputs "python") 5)
3))
(lib (string-append out "/lib/python"
python-version
"/site-packages")))
(zero? (system* "python" "configure.py"
"--confirm-license"
"--bindir" bin
"--destdir" lib
"--designer-plugindir" designer
"--qml-plugindir" qml
"--sipdir" sip))))
%standard-phases)))
(home-page "http://www.riverbankcomputing.com/software/pyqt/intro")
(synopsis "Python bindings for Qt")
(description
"PyQt is a set of Python v2 and v3 bindings for the Qt application
framework. The bindings are implemented as a set of Python modules and
contain over 620 classes.")
(license gpl3)))
(define-public python2-pyqt
(package (inherit python-pyqt)
(name "python2-pyqt")
(native-inputs
`(("python-sip" ,python2-sip)
("qt" ,qt)))
(inputs
`(("python" ,python-2)))))