guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

02/02: gnu: python-qscintilla: Fix build.


From: guix-commits
Subject: 02/02: gnu: python-qscintilla: Fix build.
Date: Mon, 17 Apr 2023 09:51:54 -0400 (EDT)

glv pushed a commit to branch core-updates
in repository guix.

commit d3c7ca3c40fd613cfb3fb8f41e8ea064b438414a
Author: Guillaume Le Vaillant <glv@posteo.net>
AuthorDate: Mon Apr 17 15:16:56 2023 +0200

    gnu: python-qscintilla: Fix build.
    
    * gnu/packages/qt.scm (python-qscintilla)[build-system]: Swith to
      pyproject-build-system.
      [arguments]: Update 'configure-flags'. Delete custom 'configure' phase. 
Add
      'prepare-build' and 'set-include-dirs' phases.
      [native-inputs]: Add python-pyqt-builder and qtbase-5.
      [inputs]: Add python-sip.
---
 gnu/packages/qt.scm | 61 ++++++++++++++++++++++++-----------------------------
 1 file changed, 28 insertions(+), 33 deletions(-)

diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index d0ea6e1f3b..a296adb599 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -21,7 +21,7 @@
 ;;; Copyright © 2020 Michael Rohleder <mike@rohleder.de>
 ;;; Copyright © 2020, 2021, 2022, 2023 Maxim Cournoyer 
<maxim.cournoyer@gmail.com>
 ;;; Copyright © 2021, 2022 Brendan Tildesley <mail@brendan.scot>
-;;; Copyright © 2021, 2022 Guillaume Le Vaillant <glv@posteo.net>
+;;; Copyright © 2021, 2022, 2023 Guillaume Le Vaillant <glv@posteo.net>
 ;;; Copyright © 2021 Nicolò Balzarotti <nicolo@nixo.xyz>
 ;;; Copyright © 2022 Foo Chuan Wei <chuanwei.foo@hotmail.com>
 ;;; Copyright © 2022 Zhu Zihao <all_but_last@163.com>
@@ -3533,40 +3533,35 @@ indicators, code completion and call tips.")
 (define-public python-qscintilla
   (package/inherit qscintilla
     (name "python-qscintilla")
+    (build-system pyproject-build-system)
     (arguments
-     `(#:configure-flags
-       (list "--pyqt=PyQt5"
-             (string-append "--pyqt-sipdir="
-                            (assoc-ref %build-inputs "python-pyqt")
-                            "/share/sip")
-             (string-append "--qsci-incdir="
-                            (assoc-ref %build-inputs "qscintilla")
-                            "/include")
-             (string-append "--qsci-libdir="
-                            (assoc-ref %build-inputs "qscintilla")
-                            "/lib"))
-       #:phases
-       (modify-phases %standard-phases
-         (replace 'configure
-           (lambda* (#:key inputs outputs configure-flags #:allow-other-keys)
-             (let ((out    (assoc-ref outputs "out"))
-                   (python (assoc-ref inputs "python")))
-               (chdir "Python")
-               (apply invoke "python3" "configure.py"
-                      configure-flags)
-               ;; Install to the right directory
-               (substitute* '("Makefile"
-                              "Qsci/Makefile")
-                 (("\\$\\(INSTALL_ROOT\\)/gnu/store/[^/]+") out)
-                 (((string-append python "/lib"))
-                  (string-append out "/lib")))
-               ;; And fix the installed.txt file
-               (substitute* "installed.txt"
-                 (("/gnu/store/[^/]+") out))))))))
+     (list #:tests? #f
+           #:configure-flags
+           #~`(@ ("--qsci-include-dir" . ,(string-append
+                                           #$(this-package-input "qscintilla")
+                                           "/include"))
+                 ("--qsci-library-dir" . ,(string-append
+                                           #$(this-package-input "qscintilla")
+                                           "/lib")))
+           #:phases
+           #~(modify-phases %standard-phases
+               (add-after 'unpack 'prepare-build
+                 (lambda _
+                   (chdir "Python")
+                   (symlink "pyproject-qt5.toml" "pyproject.toml")))
+               (add-after 'unpack 'set-include-dirs
+                 (lambda* (#:key inputs outputs #:allow-other-keys)
+                   (let* ((python (assoc-ref inputs "python"))
+                          (python-pyqt (assoc-ref inputs "python-pyqt"))
+                          (sip-include-dirs (string-append
+                                             python-pyqt "/lib/python"
+                                             (python-version python)
+                                             "/site-packages/PyQt5/bindings")))
+                     (setenv "SIP_INCLUDE_DIRS" sip-include-dirs)))))))
+    (native-inputs
+     (list python-pyqt-builder qtbase-5))
     (inputs
-     `(("qscintilla" ,qscintilla)
-       ("python" ,python)
-       ("python-pyqt" ,python-pyqt)))
+     (list python-pyqt python-sip qscintilla))
     (description "QScintilla is a port to Qt of Neil Hodgson's Scintilla C++
 editor control.  QScintilla includes features especially useful when editing
 and debugging source code.  These include support for syntax styling, error



reply via email to

[Prev in Thread] Current Thread [Next in Thread]