~ruther/guix-local

920e8a7344e75fbea7d4d3022fa7187c9d5ce619 — Nicolas Graves 4 months ago 0dfbb08
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 <sharlatanus@gmail.com>
Signed-off-by: Rutherther <rutherther@ditigal.xyz>
1 files changed, 25 insertions(+), 9 deletions(-)

M gnu/packages/python-xyz.scm
M gnu/packages/python-xyz.scm => gnu/packages/python-xyz.scm +25 -9
@@ 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