diff options
| author | Nicolas Graves <ngraves@ngraves.fr> | 2025-12-26 04:08:37 +0100 |
|---|---|---|
| committer | Rutherther <rutherther@ditigal.xyz> | 2026-01-25 21:22:43 +0100 |
| commit | da484bd577ff428865ac9acdb97784c7acdf4355 (patch) | |
| tree | f510e70b97773ce689f7bf313d5dabbd988540c3 /gnu/packages/libffi.scm | |
| parent | 920e8a7344e75fbea7d4d3022fa7187c9d5ce619 (diff) | |
gnu: python2-cffi: 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-cffi)
[inherit]: Drop it.
[source]: Decrease version to 1.15.1, which is the last supported
version for Python2. The former build fails with 1.17.0.
[build-system, arguments]: Migrate to pyproject-build-system.
[name, home-page, synopsis, description, license]: Set them
explicitely.
Change-Id: Iea81e4fd3896da044a97043e2d80f5f43b28f50e
Signed-off-by: Sharlatan Hellseher <sharlatanus@gmail.com>
Signed-off-by: Rutherther <rutherther@ditigal.xyz>
Diffstat (limited to 'gnu/packages/libffi.scm')
| -rw-r--r-- | gnu/packages/libffi.scm | 48 |
1 files changed, 35 insertions, 13 deletions
diff --git a/gnu/packages/libffi.scm b/gnu/packages/libffi.scm index f87719c7f2d..d6fe695a645 100644 --- a/gnu/packages/libffi.scm +++ b/gnu/packages/libffi.scm @@ -45,9 +45,7 @@ #:use-module (gnu packages sphinx) #:use-module (guix build-system gnu) #:use-module (guix build-system pyproject) - #:use-module ((guix build-system python) #:select (pypi-uri - package-with-python2 - python-build-system)) + #:use-module ((guix build-system python) #:select (pypi-uri)) #:use-module (guix build-system ruby)) (define-public libffi @@ -172,20 +170,44 @@ conversions for values passed between the two languages.") ;;; This Python 2 dependency is needed by the Pypy build system, which is ;;; unlikely to change in the future. (define-public python2-cffi - (let ((base (package/inherit python-cffi - ;; FIXME: package-with-python2 needs to be updated to accept - ;; pyproject-build-system package. - (build-system python-build-system) + (let ((base (package + (name "python-cffi") + (version "1.15.1") + (source + (origin + (method url-fetch) + (uri (pypi-uri "cffi" version)) + (sha256 + (base32 "1y9lr651svbzf1m03s4lqbnbv2byx8f6f0ml7hjm24vvlfwvy06l")))) + (build-system pyproject-build-system) (arguments - (cons* #:tests? #f - (strip-keyword-arguments - '(#:test-flags) - (package-arguments python-cffi)))) + (list + #:tests? #f + #:phases + #~(modify-phases %standard-phases + (replace 'build + (lambda _ + (invoke "python" "setup.py" "build"))) + (replace 'install + (lambda _ + (let ((site (string-append #$output + "/lib/python2.7/site-packages/"))) + (mkdir-p site) + (setenv "PYTHONPATH" site)) + (invoke "python" "./setup.py" "install" + (string-append "--prefix=" #$output) + "--no-compile")))))) (native-inputs '()) (inputs (modify-inputs (package-inputs python-cffi) (append libxcrypt))) - (propagated-inputs (list python2-pycparser))))) - (package-with-python2 base))) + (propagated-inputs (list python2-pycparser)) + (home-page "https://cffi.readthedocs.io/") + (synopsis "Foreign function interface for Python") + (description "Foreign Function Interface for Python calling C code.") + (license expat)))) + (package + (inherit (package-with-python2 base)) + (native-inputs (list pkg-config python-setuptools))))) (define-public python-cffi-documentation (package |
