gnu: python-pyside-2: Use "this-package-input" instead of "assoc-ref".

* gnu/packages/qt.scm (python-pyside-2)[arguments]<#:configure-flags>: Use
SEARCH-INPUT-FILE.
<#:phases>: In phase "fix-qt-module-detection", use "this-package-input".

Signed-off-by: Marius Bakke <marius@gnu.org>
This commit is contained in:
Zhu Zihao 2022-08-24 22:57:44 +08:00 committed by Marius Bakke
parent 39647c9741
commit 5c08546558
No known key found for this signature in database
GPG key ID: A2A06DF2A33A54FA

View file

@ -3880,8 +3880,8 @@ (define-public python-pyside-2
#:configure-flags
#~(list "-DBUILD_TESTS=FALSE"
(string-append "-DPYTHON_EXECUTABLE="
(assoc-ref %build-inputs "python")
"/bin/python"))
(search-input-file %build-inputs
"/bin/python")))
#:modules '((guix build cmake-build-system)
(guix build utils)
(srfi srfi-1))
@ -3890,16 +3890,18 @@ (define-public python-pyside-2
(add-after 'unpack 'go-to-source-dir
(lambda _ (chdir "sources/pyside2") #t))
(add-after 'go-to-source-dir 'fix-qt-module-detection
(lambda* (#:key inputs #:allow-other-keys)
(lambda _
;; Activate qt module support even if it not in the same
;; directory as qtbase.
(substitute* "../cmake_helpers/helpers.cmake"
(("\\(\"\\$\\{found_basepath\\}\" GREATER \"0\"\\)")
"true"))
;; Add include directories for qt modules.
(let ((dirs (map (lambda (name)
(string-append (assoc-ref inputs name)
"/include/qt5"))
(let ((dirs (map (lambda (path)
(string-append path "/include/qt5"))
(list
#$@(map (lambda (name)
(this-package-input name))
'("qtdatavis3d"
"qtdeclarative"
"qtlocation"
@ -3916,7 +3918,7 @@ (define-public python-pyside-2
"qtwebengine"
"qtwebsockets"
"qtx11extras"
"qtxmlpatterns"))))
"qtxmlpatterns"))))))
(substitute* "cmake/Macros/PySideModules.cmake"
(("\\$\\{PATH_SEP\\}\\$\\{core_includes\\}" all)
(fold (lambda (dir paths)