mirror of
https://codeberg.org/guix/guix.git
synced 2025-10-02 02:15:12 +00:00
gnu: python-cryptography: Update to 43.0.3.
* gnu/packages/python-crypto.scm (python-cryptography): Update to 43.0.3. [source]: Add snippet to ease building with maturin. [build-system]: Switch to cargo-build-system. [arguments]: Remove custom 'disable-rust-extension-build phase. Replace new cargo-build-system 'build, 'check and 'install phases with phases from the pyproject-build-system. [cargo-inputs]: New field. [inputs]: Remove python-cryptography-rust. Add maturin, python-wrapper. (python-cryptography-rust): Remove variable. Change-Id: I6523f00964b8e82a93ed8a1f8b2e1f49ddd1ddbc squash python-cryptography to 43.0.3 Change-Id: If8497f64265afab1d5d47a8aa017be908f612d3d
This commit is contained in:
parent
a6fdd8099b
commit
97aa14a222
1 changed files with 49 additions and 77 deletions
|
@ -72,7 +72,7 @@
|
||||||
#:use-module (gnu packages python-compression)
|
#:use-module (gnu packages python-compression)
|
||||||
#:use-module (gnu packages python-web)
|
#:use-module (gnu packages python-web)
|
||||||
#:use-module (gnu packages python-xyz)
|
#:use-module (gnu packages python-xyz)
|
||||||
#:use-module (gnu packages rust)
|
#:use-module (gnu packages rust-apps)
|
||||||
#:use-module (gnu packages swig)
|
#:use-module (gnu packages swig)
|
||||||
#:use-module (gnu packages time)
|
#:use-module (gnu packages time)
|
||||||
#:use-module (gnu packages tls)
|
#:use-module (gnu packages tls)
|
||||||
|
@ -543,33 +543,61 @@ is used by the Requests library to verify HTTPS requests.")
|
||||||
(define-public python-cryptography
|
(define-public python-cryptography
|
||||||
(package
|
(package
|
||||||
(name "python-cryptography")
|
(name "python-cryptography")
|
||||||
(version "42.0.5")
|
(version "43.0.3")
|
||||||
(source
|
(source
|
||||||
(origin
|
(origin
|
||||||
(method url-fetch)
|
(method url-fetch)
|
||||||
(uri (pypi-uri "cryptography" version))
|
(uri (pypi-uri "cryptography" version))
|
||||||
(sha256
|
(sha256
|
||||||
(base32
|
(base32
|
||||||
"1qdz0yk5smi0dnywbxmanccwizilmnzgbbihjpmpgm6zjpn7xq3g"))))
|
"01d8anh4crjvpa0s044rxkdi9cjnz4w15dj3yipjljba4q0r0nri"))
|
||||||
(build-system pyproject-build-system)
|
(snippet
|
||||||
|
#~(begin (use-modules (guix build utils))
|
||||||
|
;; Help the configure phase. Remove this next release.
|
||||||
|
(with-output-to-file "Cargo.toml"
|
||||||
|
(lambda () (newline)))
|
||||||
|
(for-each delete-file
|
||||||
|
(find-files "." "Cargo\\.lock$"))
|
||||||
|
(substitute* "pyproject.toml"
|
||||||
|
(("locked = true") "offline = true"))))))
|
||||||
|
(build-system cargo-build-system)
|
||||||
(arguments
|
(arguments
|
||||||
(list
|
(list
|
||||||
#:phases #~(modify-phases %standard-phases
|
#:imported-modules `(,@%cargo-build-system-modules
|
||||||
(add-after 'unpack 'disable-rust-extension-build
|
,@%pyproject-build-system-modules)
|
||||||
(lambda _
|
#:modules '((guix build cargo-build-system)
|
||||||
;; The Rust extension is built separately as
|
((guix build pyproject-build-system) #:prefix py:)
|
||||||
;; 'python-cryptography-rust', so there's no need
|
(guix build utils))
|
||||||
;; to build it here.
|
#:cargo-inputs
|
||||||
(substitute* "pyproject.toml"
|
(list rust-asn1-0.16
|
||||||
(("\\s+\\\"setuptools-rust.*") ""))))
|
rust-cc-1
|
||||||
(add-before 'check 'symlink-rust-library
|
rust-cfg-if-1
|
||||||
(lambda* (#:key inputs outputs #:allow-other-keys)
|
rust-foreign-types-0.3
|
||||||
(symlink (search-input-file
|
rust-foreign-types-shared-0.1
|
||||||
inputs "lib/libcryptography_rust.so")
|
rust-once-cell-1
|
||||||
(string-append (site-packages inputs outputs)
|
rust-openssl-0.10
|
||||||
"/cryptography/hazmat/bindings/"
|
rust-openssl-sys-0.9
|
||||||
"_rust.abi3.so")))))))
|
rust-pem-3
|
||||||
|
rust-pyo3-0.22
|
||||||
|
rust-self-cell-1)
|
||||||
|
#:install-source? #false
|
||||||
|
#:phases
|
||||||
|
#~(modify-phases %standard-phases
|
||||||
|
(add-after 'configure 'dont-vendor-self
|
||||||
|
(lambda* (#:key vendor-dir #:allow-other-keys)
|
||||||
|
;; Don't keep the whole tarball in the vendor directory
|
||||||
|
(delete-file-recursively
|
||||||
|
(string-append vendor-dir "/cryptography-" #$version ".tar.zst"))))
|
||||||
|
(replace 'build
|
||||||
|
(assoc-ref py:%standard-phases 'build))
|
||||||
|
(delete 'check)
|
||||||
|
(add-after 'install 'check
|
||||||
|
(lambda* (#:key tests? inputs outputs #:allow-other-keys)
|
||||||
|
(when tests?
|
||||||
|
(py:add-installed-pythonpath inputs outputs)
|
||||||
|
(invoke "python" "-m" "pytest" "tests"))))
|
||||||
|
(replace 'install
|
||||||
|
(assoc-ref py:%standard-phases 'install)))))
|
||||||
(native-inputs
|
(native-inputs
|
||||||
(list python-certifi
|
(list python-certifi
|
||||||
python-cryptography-vectors
|
python-cryptography-vectors
|
||||||
|
@ -580,7 +608,7 @@ is used by the Requests library to verify HTTPS requests.")
|
||||||
python-pytest-subtests
|
python-pytest-subtests
|
||||||
python-setuptools
|
python-setuptools
|
||||||
python-wheel))
|
python-wheel))
|
||||||
(inputs (list python-cryptography-rust))
|
(inputs (list maturin openssl python-wrapper))
|
||||||
(propagated-inputs (list python-cffi))
|
(propagated-inputs (list python-cffi))
|
||||||
(home-page "https://github.com/pyca/cryptography")
|
(home-page "https://github.com/pyca/cryptography")
|
||||||
(synopsis "Cryptographic recipes and primitives for Python")
|
(synopsis "Cryptographic recipes and primitives for Python")
|
||||||
|
@ -593,62 +621,6 @@ ciphers, message digests and key derivation functions.")
|
||||||
;; Distributed under either BSD-3 or ASL2.0
|
;; Distributed under either BSD-3 or ASL2.0
|
||||||
(license (list license:bsd-3 license:asl2.0))))
|
(license (list license:bsd-3 license:asl2.0))))
|
||||||
|
|
||||||
;;; 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))
|
|
||||||
#:install-source? #f
|
|
||||||
;; As seen in noxfile.py
|
|
||||||
#:cargo-test-flags ''("--release" "--no-default-features")
|
|
||||||
#: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" ,rust-asn1-0.15)
|
|
||||||
("rust-cc" ,rust-cc-1)
|
|
||||||
("rust-cfg-if" ,rust-cfg-if-1)
|
|
||||||
("rust-foreign-types" ,rust-foreign-types-0.3)
|
|
||||||
("rust-foreign-types-shared" ,rust-foreign-types-shared-0.1)
|
|
||||||
("rust-once-cell" ,rust-once-cell-1)
|
|
||||||
("rust-openssl" ,rust-openssl-0.10)
|
|
||||||
("rust-openssl-sys" ,rust-openssl-sys-0.9)
|
|
||||||
("rust-pem" ,rust-pem-3)
|
|
||||||
("rust-pyo3" ,rust-pyo3-0.20)
|
|
||||||
("rust-self-cell" ,rust-self-cell-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")))
|
|
||||||
|
|
||||||
(define-public python-pyopenssl
|
(define-public python-pyopenssl
|
||||||
(package
|
(package
|
||||||
(name "python-pyopenssl")
|
(name "python-pyopenssl")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue