gnu: python-shiboken-2: Use G-expressions.

* gnu/packages/qt.scm (python-shiboken-2)[arguments]: Use G-expressions.
<#:phases>: In phase "set-build-env", Replace (assoc-ref inputs ...) with
(this-package-input ...).

Signed-off-by: Marius Bakke <marius@gnu.org>
This commit is contained in:
Zhu Zihao 2022-08-24 16:50:14 +08:00 committed by Marius Bakke
parent 453cbb9f06
commit f1bbdefd9e
No known key found for this signature in database
GPG key ID: A2A06DF2A33A54FA

View file

@ -24,6 +24,7 @@
;;; Copyright © 2021, 2022 Guillaume Le Vaillant <glv@posteo.net> ;;; Copyright © 2021, 2022 Guillaume Le Vaillant <glv@posteo.net>
;;; Copyright © 2021 Nicolò Balzarotti <nicolo@nixo.xyz> ;;; Copyright © 2021 Nicolò Balzarotti <nicolo@nixo.xyz>
;;; Copyright © 2022 Foo Chuan Wei <chuanwei.foo@hotmail.com> ;;; Copyright © 2022 Foo Chuan Wei <chuanwei.foo@hotmail.com>
;;; Copyright © 2022 Zhu Zihao <all_but_last@163.com>
;;; ;;;
;;; This file is part of GNU Guix. ;;; This file is part of GNU Guix.
;;; ;;;
@ -3746,6 +3747,9 @@ (define-public qcustomplot
"QCustomPlot is a Qt C++ widget providing 2D plots, graphs and charts.") "QCustomPlot is a Qt C++ widget providing 2D plots, graphs and charts.")
(license license:gpl3+))) (license license:gpl3+)))
;; TODO: Split shiboken2 binding generator into a dedicated output.
;; This executable requires libxml2, libxslt, clang-toolchain at runtime.
;; The libshiboken library only requires Qt and Python at runtime.
(define-public python-shiboken-2 (define-public python-shiboken-2
(package (package
(name "python-shiboken-2") (name "python-shiboken-2")
@ -3768,30 +3772,31 @@ (define-public python-shiboken-2
qtbase-5 qtbase-5
qtxmlpatterns)) qtxmlpatterns))
(arguments (arguments
`(#:tests? #f (list
;; FIXME: Building tests fails #:tests? #f
#:configure-flags '("-DBUILD_TESTS=off") ;; FIXME: Building tests fails
#:phases #:configure-flags #~(list "-DBUILD_TESTS=off")
(modify-phases %standard-phases #:phases
(add-after 'unpack 'use-shiboken-dir-only #~(modify-phases %standard-phases
(lambda _ (chdir "sources/shiboken2") #t)) (add-after 'unpack 'use-shiboken-dir-only
(add-before 'configure 'make-files-writable-and-update-timestamps (lambda _ (chdir "sources/shiboken2") #t))
(lambda _ (add-before 'configure 'make-files-writable-and-update-timestamps
;; The build scripts need to modify some files in (lambda _
;; the read-only source directory, and also attempts ;; The build scripts need to modify some files in
;; to create Zip files which fails because the Zip ;; the read-only source directory, and also attempts
;; format does not support timestamps before 1980. ;; to create Zip files which fails because the Zip
(let ((circa-1980 (* 10 366 24 60 60))) ;; format does not support timestamps before 1980.
(for-each (lambda (file) (let ((circa-1980 (* 10 366 24 60 60)))
(make-file-writable file) (for-each (lambda (file)
(utime file circa-1980 circa-1980)) (make-file-writable file)
(find-files "."))) (utime file circa-1980 circa-1980))
#t)) (find-files ".")))
(add-before 'configure 'set-build-env #t))
(lambda* (#:key inputs #:allow-other-keys) (add-before 'configure 'set-build-env
(let ((llvm (assoc-ref inputs "clang-toolchain"))) (lambda _
(setenv "CLANG_INSTALL_DIR" llvm) (let ((llvm #$(this-package-input "clang-toolchain")))
#t)))))) (setenv "CLANG_INSTALL_DIR" llvm)
#t))))))
(home-page "https://wiki.qt.io/Qt_for_Python") (home-page "https://wiki.qt.io/Qt_for_Python")
(synopsis (synopsis
"Shiboken generates bindings for C++ libraries using CPython source code") "Shiboken generates bindings for C++ libraries using CPython source code")