From bbfc717a19c272d1f2698bca44e72109cbe1d3cf Mon Sep 17 00:00:00 2001 From: Zhu Zihao Date: Wed, 24 Aug 2022 16:50:14 +0800 Subject: [PATCH 1/9] 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 ...). --- gnu/packages/qt.scm | 53 +++++++++++++++++++++++++-------------------- 1 file changed, 29 insertions(+), 24 deletions(-) diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm index d9d796f551..fe9c9213e5 100644 --- a/gnu/packages/qt.scm +++ b/gnu/packages/qt.scm @@ -24,6 +24,7 @@ ;;; Copyright © 2021, 2022 Guillaume Le Vaillant ;;; Copyright © 2021 Nicolò Balzarotti ;;; Copyright © 2022 Foo Chuan Wei +;;; Copyright © 2022 Zhu Zihao ;;; ;;; 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.") (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 (package (name "python-shiboken-2") @@ -3768,30 +3772,31 @@ (define-public python-shiboken-2 qtbase-5 qtxmlpatterns)) (arguments - `(#:tests? #f - ;; FIXME: Building tests fails - #:configure-flags '("-DBUILD_TESTS=off") - #:phases - (modify-phases %standard-phases - (add-after 'unpack 'use-shiboken-dir-only - (lambda _ (chdir "sources/shiboken2") #t)) - (add-before 'configure 'make-files-writable-and-update-timestamps - (lambda _ - ;; The build scripts need to modify some files in - ;; the read-only source directory, and also attempts - ;; to create Zip files which fails because the Zip - ;; format does not support timestamps before 1980. - (let ((circa-1980 (* 10 366 24 60 60))) - (for-each (lambda (file) - (make-file-writable file) - (utime file circa-1980 circa-1980)) - (find-files "."))) - #t)) - (add-before 'configure 'set-build-env - (lambda* (#:key inputs #:allow-other-keys) - (let ((llvm (assoc-ref inputs "clang-toolchain"))) - (setenv "CLANG_INSTALL_DIR" llvm) - #t)))))) + (list + #:tests? #f + ;; FIXME: Building tests fails + #:configure-flags #~(list "-DBUILD_TESTS=off") + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'use-shiboken-dir-only + (lambda _ (chdir "sources/shiboken2") #t)) + (add-before 'configure 'make-files-writable-and-update-timestamps + (lambda _ + ;; The build scripts need to modify some files in + ;; the read-only source directory, and also attempts + ;; to create Zip files which fails because the Zip + ;; format does not support timestamps before 1980. + (let ((circa-1980 (* 10 366 24 60 60))) + (for-each (lambda (file) + (make-file-writable file) + (utime file circa-1980 circa-1980)) + (find-files "."))) + #t)) + (add-before 'configure 'set-build-env + (lambda _ + (let ((llvm #$(this-package-input "clang-toolchain"))) + (setenv "CLANG_INSTALL_DIR" llvm) + #t)))))) (home-page "https://wiki.qt.io/Qt_for_Python") (synopsis "Shiboken generates bindings for C++ libraries using CPython source code") -- 2.37.2