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

@ -4126,24 +4126,34 @@ module provides support functions to the automatically generated code.")
(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
"/sip-"
version
".tar.gz")))
(sha256 (sha256
(base32 (base32 "04a23cgsnx150xq86w1z44b6vr2zyazysy9mqax0fy346zlr77dk"))))
"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
(lambda _
(substitute* "siplib/siplib.c"
;; Replaces the internal data-structure usage
;; that was removed in python 3.11 with the
;; new official API call so the code will compile
;; with python > 3.11
(("frame->f_back")
"PyFrame_GetBack(frame)"))))
(replace 'configure (replace 'configure
(lambda* (#:key inputs outputs #:allow-other-keys) (lambda* (#:key inputs outputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out")) (let* ((out (assoc-ref outputs "out"))
@ -4153,10 +4163,14 @@ module provides support functions to the automatically generated code.")
(lib (string-append out "/lib/python" (lib (string-append out "/lib/python"
(python-version python) (python-version python)
"/site-packages"))) "/site-packages")))
(invoke "python" "configure.py" (invoke "python"
"--bindir" bin "configure.py"
"--destdir" lib "--bindir"
"--incdir" include))))))) bin
"--destdir"
lib
"--incdir"
include)))))))
(license license:gpl3))) (license license:gpl3)))
(define-public python-pyqt (define-public python-pyqt