From db54cff91078eed53052bd9ff2453be1bf8ba0e7 Mon Sep 17 00:00:00 2001 From: Rutherther Date: Sat, 10 Aug 2024 21:47:44 +0200 Subject: [PATCH] fix: correctly replace with python 3.12 --- ruther/packages/python-next.scm | 36 +++++++++++++++++++++++---------- 1 file changed, 25 insertions(+), 11 deletions(-) diff --git a/ruther/packages/python-next.scm b/ruther/packages/python-next.scm index c4d10c8..9627098 100644 --- a/ruther/packages/python-next.scm +++ b/ruther/packages/python-next.scm @@ -4,6 +4,7 @@ #:use-module ((guix licenses) #:prefix license:) #:use-module (guix gexp) + #:use-module (guix build-system) #:use-module (guix download) #:use-module (guix utils) #:use-module ((guix build-system copy) #:prefix copy:) @@ -40,6 +41,7 @@ (define-public python-3.12-cython (with-python-3.12-no-cython (package/inherit python-cython + (name "python-3.12-cython") (version "0.29.37") (source (origin @@ -80,8 +82,8 @@ pre-defined variants." => force) ;; Otherwise build the new package object graph. - ((or (eq? (package-build-system p) python:python-build-system) - (eq? (package-build-system p) pyproject:pyproject-build-system)) + ((or (eq? (build-system-name (package-build-system p)) (build-system-name python:python-build-system)) + (eq? (build-system-name (package-build-system p)) (build-system-name pyproject:pyproject-build-system))) (package/inherit p (location (package-location p)) (name (let ((name (package-name p))) @@ -99,20 +101,32 @@ pre-defined variants." (else p))) (define (cut? p) - (or (not (and (eq? (package-build-system p) python:python-build-system) - (eq? (package-build-system p) pyproject:pyproject-build-system))) + (or (not (or (eq? (build-system-name (package-build-system p)) (build-system-name python:python-build-system)) + (eq? (build-system-name (package-build-system p)) (build-system-name pyproject:pyproject-build-system)))) (package-variant p))) (package-mapping transform cut?)) +(define with-explicit-python-3.12-single + (package-with-explicit-python python-3.12-toolchain "python-" "python-3.12-")) + +(define python-3.12-cython-inner + (with-explicit-python-3.12-single python-cython)) + (define with-python-3.12-single - (lambda (x) - ((package-input-rewriting `((,python-cython . ,python-3.12-cython) - ;; TODO: put more stuff here, if there is something - ;; that's a common dependenc that will get broken on - ;; Python 3.12 - )) - ((package-with-explicit-python python-3.12-toolchain "python-" "python-3.12-") x)))) + (lambda (pkg) + (let ((rewritten (with-explicit-python-3.12-single pkg))) + ((package-input-rewriting `((,python-3.12-cython-inner . ,python-3.12-cython))) + rewritten)))) + +;; (define with-python-3.12-single +;; (lambda (pkg) +;; (let ((rewritten ((package-input-rewriting `((,python-cython . ,python-3.12-cython) +;; ;; TODO: put more stuff here, if there is something +;; ;; that's a common dependenc that will get broken on +;; ;; Python 3.12 +;; )) pkg))) +;; ((package-with-explicit-python python-3.12-toolchain "python-" "python-3.12") rewritten)))) (define-public (with-python-3.12 el) (if -- 2.48.1