~ruther/guix-local

014e7dd8f0d5add1a1aa234399c499099a2b2885 — Andreas Enge 11 years ago 84ef83d
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.
3 files changed, 80 insertions(+), 0 deletions(-)

M gnu-system.am
A gnu/packages/patches/pyqt-configure.patch
M gnu/packages/qt.scm
M gnu-system.am => gnu-system.am +1 -0
@@ 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	\

A gnu/packages/patches/pyqt-configure.patch => gnu/packages/patches/pyqt-configure.patch +15 -0
@@ 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
 

M gnu/packages/qt.scm => gnu/packages/qt.scm +64 -0
@@ 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)))))