From 920e8a7344e75fbea7d4d3022fa7187c9d5ce619 Mon Sep 17 00:00:00 2001 From: Nicolas Graves Date: Fri, 26 Dec 2025 04:00:44 +0100 Subject: [PATCH] gnu: python2-pycparser: Migrate to pyproject and decouple. Rationale: Decoupling helps us moving the package, and not worry about inheriting package updates. * gnu/packages/python-xyz.scm (python2-pycparser) [inherit]: Drop it. [build-system, arguments]: Migrate to pyproject-build-system. [name, home-page, synopsis, description, license]: Set them explicitely. [native-inputs]: Add python-setuptools. Change-Id: Ie55f1fdc60d80ec921acabced218ec758a650cf1 Signed-off-by: Sharlatan Hellseher Signed-off-by: Rutherther --- gnu/packages/python-xyz.scm | 34 +++++++++++++++++++++++++--------- 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm index c25752b0706c2d4660d89a1d6f21dc6ee65eea5a..e5f460186d3e75b28aeeb819e253242a008c4779 100644 --- a/gnu/packages/python-xyz.scm +++ b/gnu/packages/python-xyz.scm @@ -41807,8 +41807,8 @@ you do not want to store entirely on disk or on memory.") (define-public python2-pycparser (let ((base (package - (inherit python-pycparser) (version "2.18") + (name "python-pycparser") (source (origin (method url-fetch) @@ -41816,15 +41816,31 @@ you do not want to store entirely on disk or on memory.") (sha256 (base32 "09mjyw82ibqzl449g7swy8bfxnfpmas0815d2rkdjlcqw81wma4r")))) - ;; FIXME: package-with-python2 needs to be updated to accept - ;; pyproject-build-system packages. - (build-system python-build-system) + (build-system pyproject-build-system) (arguments - (cons* #:tests? #f - (strip-keyword-arguments - '(#:test-backend) - (package-arguments python-pycparser))))))) - (package-with-python2 base))) + (list + #:tests? #f + #:phases + #~(modify-phases %standard-phases + (replace 'build + (lambda _ + (invoke "python" "setup.py" "build"))) + (replace 'install + (lambda _ + (invoke "python" "./setup.py" "install" + (string-append "--prefix=" #$output) + "--no-compile") + (invoke "python" "-m" "compileall" #$output)))))) + (home-page "https://github.com/eliben/pycparser") + (synopsis "C parser in Python") + (description + "Pycparser is a complete parser of the C language, written in +pure Python using the PLY parsing library. It parses C code into an AST and +can serve as a front-end for C compilers or analysis tools.") + (license license:bsd-3)))) + (package + (inherit (package-with-python2 base)) + (native-inputs (list python-setuptools))))) (define-public shrinkwrap (package