[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
53/73: gnu: Add python-cryptography-rust.
From: |
guix-commits |
Subject: |
53/73: gnu: Add python-cryptography-rust. |
Date: |
Tue, 11 Apr 2023 22:07:30 -0400 (EDT) |
apteryx pushed a commit to branch staging
in repository guix.
commit 9e5102ca64ae0560de20e7b661d6dd5c32f17b11
Author: Maxim Cournoyer <maxim.cournoyer@gmail.com>
AuthorDate: Mon Apr 10 23:42:55 2023 -0400
gnu: Add python-cryptography-rust.
* gnu/packages/python-crypto.scm (python-cryptography-rust): New variable.
---
gnu/packages/python-crypto.scm | 61 +++++++++++++++++++++++++++++++++++++++++-
1 file changed, 60 insertions(+), 1 deletion(-)
diff --git a/gnu/packages/python-crypto.scm b/gnu/packages/python-crypto.scm
index c3e36ff2e4..3a3993b532 100644
--- a/gnu/packages/python-crypto.scm
+++ b/gnu/packages/python-crypto.scm
@@ -24,7 +24,7 @@
;;; Copyright © 2020 Alexandros Theodotou <alex@zrythm.org>
;;; Copyright © 2020 Justus Winter <justus@sequoia-pgp.org>
;;; Copyright © 2020, 2021 Vinicius Monego <monego@posteo.net>
-;;; Copyright © 2021, 2022 Maxim Cournoyer <maxim.cournoyer@gmail.com>
+;;; Copyright © 2021, 2022, 2023 Maxim Cournoyer <maxim.cournoyer@gmail.com>
;;; Copyright © 2021 Maxime Devos <maximedevos@telenet.be>
;;; Copyright © 2022 Antero Mejr <antero@mailbox.org>
;;;
@@ -60,6 +60,7 @@
#:use-module (gnu packages libffi)
#:use-module (gnu packages multiprecision)
#:use-module (gnu packages password-utils)
+ #:use-module (gnu packages pkg-config)
#:use-module (gnu packages protobuf)
#:use-module (gnu packages python)
#:use-module (gnu packages python-build)
@@ -703,6 +704,64 @@ message digests and key derivation functions.")
python-pytest
python-setuptools-rust))))
+;;; This is the Rust component of the python-cryptography library, extracted
+;;; as a separate package to ease the Rust build.
+(define-public python-cryptography-rust
+ (package
+ (inherit python-cryptography)
+ (name "python-cryptography-rust")
+ (build-system cargo-build-system)
+ (arguments
+ (list
+ #:modules '((guix build cargo-build-system)
+ (guix build utils)
+ (srfi srfi-1)
+ (ice-9 match))
+ ;; XXX: Building the test objects appear to fail due to a missing link
+ ;; directive to Python's shared library (e.g.: "ld:
+ ;; cryptography_rust.c950d742-cgu.11:(.text._ZN3...+0x57): undefined
+ ;; reference to `PyLong_FromLong'").
+ #:tests? #f
+ #:phases
+ #~(modify-phases %standard-phases
+ (add-after 'unpack 'chdir
+ (lambda _
+ (chdir "src/rust")))
+ (replace 'unpack-rust-crates
+ ;; This is to avoid the non-crate source from being erroneously
+ ;; unpacked by this phase, causing an error.
+ (lambda* (#:key inputs #:allow-other-keys #:rest args)
+ (apply (assoc-ref %standard-phases 'unpack-rust-crates)
+ (append args
+ (list #:inputs (alist-delete "source" inputs))))))
+ (replace 'configure
+ (lambda* (#:key inputs #:allow-other-keys #:rest args)
+ (apply (assoc-ref %standard-phases 'configure)
+ (append args
+ (list #:inputs (alist-delete "source" inputs))))))
+ (add-after 'install 'install-shared-library
+ (lambda _
+ (install-file "target/release/libcryptography_rust.so"
+ (string-append #$output "/lib")))))
+ #:cargo-inputs
+ `(("rust-asn1-0.13" ,rust-asn1-0.13)
+ ("rust-chrono-0.4" ,rust-chrono-0.4)
+ ("rust-foreign-types-shared-0.1" ,rust-foreign-types-shared-0.1)
+ ("rust-once-cell-1" ,rust-once-cell-1)
+ ("rust-openssl-0.10" ,rust-openssl-0.10)
+ ("rust-openssl-sys-0.9" ,rust-openssl-sys-0.9)
+ ("rust-ouroboros-0.15" ,rust-ouroboros-0.15)
+ ("rust-pem-1" ,rust-pem-1)
+ ("rust-pyo3-0.15" ,rust-pyo3-0.15))
+ #:cargo-development-inputs
+ `(("rust-cc" ,rust-cc-1))))
+ (native-inputs (list pkg-config python python-cffi))
+ ;; XXX: Adding rust-openssl-sys-0.9 is needed because #:cargo-inputs
+ ;; doesn't honor propagated-inputs.
+ (inputs (list python rust-openssl-sys-0.9))
+ (propagated-inputs '())
+ (synopsis "Core implementation of the Cryptography Python library")))
+
;; This is the last version which is compatable with python-cryptography < 35.
(define-public python-pyopenssl
(package
- 27/73: gnu: rust-openssl-0.10: Update to 0.10.49., (continued)
- 27/73: gnu: rust-openssl-0.10: Update to 0.10.49., guix-commits, 2023/04/11
- 30/73: gnu: rust-openssl-sys-0.9: Update to 0.9.84., guix-commits, 2023/04/11
- 32/73: gnu: Add rust-portable-atomic-1., guix-commits, 2023/04/11
- 31/73: gnu: Add rust-sptr-0.3., guix-commits, 2023/04/11
- 35/73: gnu: rust-pin-project-1: Update to 1.0.12., guix-commits, 2023/04/11
- 36/73: gnu: rust-pin-project-internal-1: Update to 1.0.12., guix-commits, 2023/04/11
- 37/73: gnu: rust-slab-0.4: Update to 0.4.8., guix-commits, 2023/04/11
- 39/73: gnu: rust-futures-channel-0.3: Update to 0.3.26., guix-commits, 2023/04/11
- 42/73: gnu: rust-futures-io-0.3: Update to 0.3.26., guix-commits, 2023/04/11
- 49/73: gnu: libexif: Update to 0.6.24. [fixes CVE-2020-0198, CVE-2020-0452], guix-commits, 2023/04/11
- 53/73: gnu: Add python-cryptography-rust.,
guix-commits <=
- 58/73: gnu: python-cryptography: Update to 40.0.1 [fixes CVE-2023-23931]., guix-commits, 2023/04/11
- 43/73: gnu: rust-futures-macro-0.3: Update to 0.3.26., guix-commits, 2023/04/11
- 45/73: gnu: rust-futures-test-0.3: Update to 0.3.26., guix-commits, 2023/04/11
- 46/73: gnu: rust-futures-util-0.3: Update to 0.3.26., guix-commits, 2023/04/11
- 47/73: gnu: rust-futures-sink-0.3: Update to 0.3.26., guix-commits, 2023/04/11
- 44/73: gnu: rust-futures-task-0.3: Update to 0.3.26., guix-commits, 2023/04/11
- 48/73: gnu: Add rust-base64-0.21., guix-commits, 2023/04/11
- 50/73: gnu: rust-pem-1: Update to 1.1.1., guix-commits, 2023/04/11
- 63/73: gnu: gstreamer-docs: Update to 1.22.2., guix-commits, 2023/04/11
- 64/73: gnu: gstreamer: Update to 1.22.2., guix-commits, 2023/04/11