gnu: python-sip-4: Make compatible with python 3.11.

The package used an internal python API that was removed in
python 3.11, causing a compiler error. This commit replaces
the internal call with the official replacement API.

* gnu/packages/qt.scm (python-sip-4): Make compatible with python@3.11.

Change-Id: Ifbf888bcdaab314cb7ec5a5908656cbb1b2a52d2
Signed-off-by: Andreas Enge <andreas@enge.fr>
This commit is contained in:
Matthew Elwin 2025-07-01 10:06:46 -05:00 committed by Andreas Enge
parent 3f925cf6ce
commit cd29c06f91
No known key found for this signature in database
GPG key ID: F7D5C9BF765C61E3

View file

@ -4122,41 +4122,55 @@ module provides support functions to the automatically generated code.")
(name "python-sip") (name "python-sip")
(version "4.19.25") (version "4.19.25")
(source (source
(origin (origin
(method url-fetch) (method url-fetch)
(uri (list (pypi-uri "sip" version) (uri (list (pypi-uri "sip" version)
(string-append "https://www.riverbankcomputing.com/static/" (string-append "https://www.riverbankcomputing.com/static/"
"Downloads/sip/" version "Downloads/sip/"
"/sip-" version ".tar.gz"))) version
(sha256 "/sip-"
(base32 version
"04a23cgsnx150xq86w1z44b6vr2zyazysy9mqax0fy346zlr77dk")))) ".tar.gz")))
(sha256
(base32 "04a23cgsnx150xq86w1z44b6vr2zyazysy9mqax0fy346zlr77dk"))))
(build-system gnu-build-system) (build-system gnu-build-system)
(native-inputs (native-inputs `(("python" ,python-wrapper)))
`(("python" ,python-wrapper)))
(propagated-inputs `()) (propagated-inputs `())
(arguments (arguments
`(#:tests? #f ; no check target `(#:tests? #f ;no check target
#:imported-modules ((guix build python-build-system) #:imported-modules ((guix build python-build-system)
,@%default-gnu-imported-modules) ,@%default-gnu-imported-modules)
#:modules ((srfi srfi-1) #:modules ((srfi srfi-1)
((guix build python-build-system) #:select (python-version)) ((guix build python-build-system)
#:select (python-version))
,@%default-gnu-modules) ,@%default-gnu-modules)
#:phases #:phases (modify-phases %standard-phases
(modify-phases %standard-phases (add-after 'unpack 'substitute
(replace 'configure (lambda _
(lambda* (#:key inputs outputs #:allow-other-keys) (substitute* "siplib/siplib.c"
(let* ((out (assoc-ref outputs "out")) ;; Replaces the internal data-structure usage
(bin (string-append out "/bin")) ;; that was removed in python 3.11 with the
(include (string-append out "/include")) ;; new official API call so the code will compile
(python (assoc-ref inputs "python")) ;; with python > 3.11
(lib (string-append out "/lib/python" (("frame->f_back")
(python-version python) "PyFrame_GetBack(frame)"))))
"/site-packages"))) (replace 'configure
(invoke "python" "configure.py" (lambda* (#:key inputs outputs #:allow-other-keys)
"--bindir" bin (let* ((out (assoc-ref outputs "out"))
"--destdir" lib (bin (string-append out "/bin"))
"--incdir" include))))))) (include (string-append out "/include"))
(python (assoc-ref inputs "python"))
(lib (string-append out "/lib/python"
(python-version python)
"/site-packages")))
(invoke "python"
"configure.py"
"--bindir"
bin
"--destdir"
lib
"--incdir"
include)))))))
(license license:gpl3))) (license license:gpl3)))
(define-public python-pyqt (define-public python-pyqt