From fa585ebd6a94061694137642327e60e314afe6bd Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Sat, 4 Oct 2025 23:08:34 +0900 Subject: [PATCH] gnu: Add python2-cffi. This is needed by Pypy 3. * gnu/packages/libffi.scm (python2-cffi): New variable. Fixes: #3183 Change-Id: I01f022c28c1a3b801b4a374bd8c52de4a8442d8a Reviewed-by: Danny Milosavljevic --- gnu/packages/libffi.scm | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/gnu/packages/libffi.scm b/gnu/packages/libffi.scm index 19842a9e9a48b734a964aa821f430ed955f58492..bd8e5fb727508e2fa24bdeb0c081e5fb6f0aa475 100644 --- a/gnu/packages/libffi.scm +++ b/gnu/packages/libffi.scm @@ -6,7 +6,7 @@ ;;; Copyright © 2016, 2017 Ben Woodcroft ;;; Copyright © 2017, 2019, 2020, 2022 Marius Bakke ;;; Copyright © 2018 Tobias Geerinckx-Rice -;;; Copyright © 2019, 2021 Maxim Cournoyer +;;; Copyright © 2019, 2021, 2025 Maxim Cournoyer ;;; Copyright © 2020 John Doe ;;; Copyright © 2024 Janneke Nieuwenhuizen ;;; Copyright © 2024 Sharlatan Hellseher @@ -35,6 +35,7 @@ #:use-module (guix git-download) #:use-module (guix utils) #:use-module (gnu packages check) + #:use-module (gnu packages crypto) #:use-module (gnu packages pkg-config) #:use-module (gnu packages python) #:use-module (gnu packages python-build) @@ -44,7 +45,9 @@ #: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)) + #:use-module ((guix build-system python) #:select (pypi-uri + package-with-python2 + python-build-system)) #:use-module (guix build-system ruby)) (define-public libffi @@ -166,6 +169,24 @@ conversions for values passed between the two languages.") (description "Foreign Function Interface for Python calling C code.") (license expat))) +;;; 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) + (arguments + (cons* #:tests? #f + (strip-keyword-arguments + '(#:test-flags) + (package-arguments python-cffi)))) + (native-inputs '()) + (inputs (modify-inputs (package-inputs python-cffi) + (append libxcrypt))) + (propagated-inputs (list python2-pycparser))))) + (package-with-python2 base))) + (define-public python-cffi-documentation (package (name "python-cffi-documentation")