Archived
1
0
Fork 0

build-system/cargo: Set openssl environment variable when available.

* guix/build/cargo-build-system.scm (configure): When openssl is
available set the OPENSSL_DIR variable to discover its location.
* gnu/packages/crates-io.scm (rust-curl-sys-0.4, rust-libgit2-sys-0.10,
rust-libpijul-0.12, rust-libssh2-sys-0.2, rust-native-tls-0.2,
rust-openssl-sys-0.9, rust-openssl-0.7, rust-trust-dns-rustls-0.6),
* gnu/packages/rust-apps.scm (tokei, exa)[arguments]: Remove redundant
setenv for openssl.
This commit is contained in:
Efraim Flashner 2020-11-22 18:09:39 +02:00
parent 93b14be52e
commit 3dbf3a7f51
No known key found for this signature in database
GPG key ID: 41AAE7DCCA3D8351
3 changed files with 30 additions and 84 deletions

View file

@ -5914,14 +5914,7 @@ use with bindgen.")
("rust-winapi" ,rust-winapi-0.3) ("rust-winapi" ,rust-winapi-0.3)
("rust-cc" ,rust-cc-1) ("rust-cc" ,rust-cc-1)
("rust-pkg-config" ,rust-pkg-config-0.3) ("rust-pkg-config" ,rust-pkg-config-0.3)
("rust-vcpkg" ,rust-vcpkg-0.2)) ("rust-vcpkg" ,rust-vcpkg-0.2))))
#:phases
(modify-phases %standard-phases
(add-after 'unpack 'find-openssl
(lambda* (#:key inputs #:allow-other-keys)
(let ((openssl (assoc-ref inputs "openssl")))
(setenv "OPENSSL_DIR" openssl))
#t)))))
(native-inputs (native-inputs
`(("pkg-config" ,pkg-config))) `(("pkg-config" ,pkg-config)))
(inputs (inputs
@ -10362,10 +10355,11 @@ DWARF debugging format.")
("rust-thread-id" ,rust-thread-id-3) ("rust-thread-id" ,rust-thread-id-3)
("rust-time" ,rust-time-0.1)))) ("rust-time" ,rust-time-0.1))))
(native-inputs (native-inputs
`(("pkg-config" ,pkg-config)))
(inputs
`(("libgit2" ,libgit2) `(("libgit2" ,libgit2)
("libssh2" ,libssh2) ("libssh2" ,libssh2)
("openssl" ,openssl) ("openssl" ,openssl)
("pkg-config" ,pkg-config)
("zlib" ,zlib))) ("zlib" ,zlib)))
(home-page "https://github.com/rust-lang/git2-rs") (home-page "https://github.com/rust-lang/git2-rs")
(synopsis "Rust bindings to libgit2") (synopsis "Rust bindings to libgit2")
@ -13602,18 +13596,12 @@ algorithm and related formats (ZLIB, GZIP).")
("rust-openssl-sys" ,rust-openssl-sys-0.9) ("rust-openssl-sys" ,rust-openssl-sys-0.9)
;; Build dependencies: ;; Build dependencies:
("rust-cc" ,rust-cc-1) ("rust-cc" ,rust-cc-1)
("rust-pkg-config" ,rust-pkg-config-0.3)) ("rust-pkg-config" ,rust-pkg-config-0.3))))
#:phases
(modify-phases %standard-phases
(add-after 'configure 'dont-vendor-sources
(lambda* (#:key inputs #:allow-other-keys)
(let ((openssl (assoc-ref inputs "openssl")))
(setenv "OPENSSL_DIR" openssl))
#t)))))
(native-inputs (native-inputs
`(("pkg-config" ,pkg-config)))
(inputs
`(("libgit2" ,libgit2) `(("libgit2" ,libgit2)
("openssl" ,openssl) ("openssl" ,openssl)
("pkg-config" ,pkg-config)
("zlib" ,zlib))) ("zlib" ,zlib)))
(home-page "https://github.com/rust-lang/git2-rs") (home-page "https://github.com/rust-lang/git2-rs")
(synopsis "Native bindings to the libgit2 library") (synopsis "Native bindings to the libgit2 library")
@ -13896,7 +13884,6 @@ allocator.")
(modify-phases %standard-phases (modify-phases %standard-phases
(add-after 'unpack 'set-missing-env-vars (add-after 'unpack 'set-missing-env-vars
(lambda* (#:key inputs #:allow-other-keys) (lambda* (#:key inputs #:allow-other-keys)
(setenv "OPENSSL_DIR" (assoc-ref inputs "openssl"))
(setenv "LIBCLANG_PATH" (setenv "LIBCLANG_PATH"
(string-append (assoc-ref inputs "clang") "/lib")) (string-append (assoc-ref inputs "clang") "/lib"))
#t))))) #t)))))
@ -14139,18 +14126,12 @@ pairs in insertion order.")
;; Build dependencies: ;; Build dependencies:
("rust-cc" ,rust-cc-1) ("rust-cc" ,rust-cc-1)
("rust-pkg-config" ,rust-pkg-config-0.3) ("rust-pkg-config" ,rust-pkg-config-0.3)
("rust-vcpkg" ,rust-vcpkg-0.2)) ("rust-vcpkg" ,rust-vcpkg-0.2))))
#:phases
(modify-phases %standard-phases
(add-after 'configure 'dont-vendor-sources
(lambda* (#:key inputs #:allow-other-keys)
(let ((openssl (assoc-ref inputs "openssl")))
(setenv "OPENSSL_DIR" openssl))
#t)))))
(native-inputs (native-inputs
`(("pkg-config" ,pkg-config)))
(inputs
`(("libssh2" ,libssh2) `(("libssh2" ,libssh2)
("openssl" ,openssl) ("openssl" ,openssl)
("pkg-config" ,pkg-config)
("zlib" ,zlib))) ("zlib" ,zlib)))
(home-page "https://github.com/alexcrichton/ssh2-rs") (home-page "https://github.com/alexcrichton/ssh2-rs")
(synopsis "Native bindings to the libssh2 library") (synopsis "Native bindings to the libssh2 library")
@ -16040,17 +16021,11 @@ IO of Windows's named pipes.")
("rust-security-framework-sys" ,rust-security-framework-sys-0.3) ("rust-security-framework-sys" ,rust-security-framework-sys-0.3)
("rust-tempfile" ,rust-tempfile-3)) ("rust-tempfile" ,rust-tempfile-3))
#:cargo-development-inputs #:cargo-development-inputs
(("rust-hex" ,rust-hex-0.3)) (("rust-hex" ,rust-hex-0.3))))
#:phases
(modify-phases %standard-phases
(add-after 'unpack 'find-openssl
(lambda* (#:key inputs #:allow-other-keys)
(let ((openssl (assoc-ref inputs "openssl")))
(setenv "OPENSSL_DIR" openssl))
#t)))))
(native-inputs (native-inputs
`(("openssl" ,openssl) `(("pkg-config" ,pkg-config)))
("pkg-config" ,pkg-config))) (inputs
`(("openssl" ,openssl)))
(home-page "https://github.com/sfackler/rust-native-tls") (home-page "https://github.com/sfackler/rust-native-tls")
(synopsis (synopsis
"Wrapper over a platform's native TLS implementation") "Wrapper over a platform's native TLS implementation")
@ -17633,7 +17608,7 @@ You probably don't want to link to this crate directly; instead check out the
(substitute* "Cargo.toml" (substitute* "Cargo.toml"
((", path =.*}") "}")) ((", path =.*}") "}"))
#t))))) #t)))))
(native-inputs (inputs
`(("openssl" ,openssl-1.0))))) ; for openssl-sys-extras `(("openssl" ,openssl-1.0))))) ; for openssl-sys-extras
(define-public rust-openssl-probe-0.1 (define-public rust-openssl-probe-0.1
@ -17677,17 +17652,11 @@ system for OpenSSL.")
("rust-autocfg" ,rust-autocfg-1.0) ("rust-autocfg" ,rust-autocfg-1.0)
("rust-cc" ,rust-cc-1) ("rust-cc" ,rust-cc-1)
("rust-pkg-config" ,rust-pkg-config-0.3) ("rust-pkg-config" ,rust-pkg-config-0.3)
("rust-vcpkg" ,rust-vcpkg-0.2)) ("rust-vcpkg" ,rust-vcpkg-0.2))))
#:phases
(modify-phases %standard-phases
(add-after 'unpack 'find-openssl
(lambda* (#:key inputs #:allow-other-keys)
(let ((openssl (assoc-ref inputs "openssl")))
(setenv "OPENSSL_DIR" openssl))
#t)))))
(native-inputs (native-inputs
`(("openssl" ,openssl) `(("pkg-config" ,pkg-config)))
("pkg-config" ,pkg-config))) (inputs
`(("openssl" ,openssl)))
(home-page "https://github.com/sfackler/rust-openssl") (home-page "https://github.com/sfackler/rust-openssl")
(synopsis "FFI bindings to OpenSSL") (synopsis "FFI bindings to OpenSSL")
(description (description
@ -17721,14 +17690,7 @@ system for OpenSSL.")
(("rust-gdi32-sys" ,rust-gdi32-sys-0.2) (("rust-gdi32-sys" ,rust-gdi32-sys-0.2)
("rust-libc" ,rust-libc-0.2) ("rust-libc" ,rust-libc-0.2)
("rust-user32-sys" ,rust-user32-sys-0.2) ("rust-user32-sys" ,rust-user32-sys-0.2)
("rust-pkg-config" ,rust-pkg-config-0.3)) ("rust-pkg-config" ,rust-pkg-config-0.3))))))
#:phases
(modify-phases %standard-phases
(add-after 'unpack 'find-openssl
(lambda* (#:key inputs #:allow-other-keys)
(let ((openssl (assoc-ref inputs "openssl")))
(setenv "OPENSSL_DIR" openssl))
#t)))))))
(define-public rust-openssl-sys-extras-0.7 (define-public rust-openssl-sys-extras-0.7
(package (package
@ -17756,7 +17718,7 @@ system for OpenSSL.")
(substitute* "Cargo.toml" (substitute* "Cargo.toml"
((", path =.*}") "}")) ((", path =.*}") "}"))
#t))))) #t)))))
(native-inputs (inputs
`(("openssl" ,openssl-1.0))) ; openssl-1.0 specifically `(("openssl" ,openssl-1.0))) ; openssl-1.0 specifically
(home-page "https://github.com/sfackler/rust-openssl") (home-page "https://github.com/sfackler/rust-openssl")
(synopsis (synopsis
@ -25752,7 +25714,7 @@ functionality and without weak references.")
(substitute* "Cargo.toml" (substitute* "Cargo.toml"
((", path =.*}") "}")) ((", path =.*}") "}"))
#t))))) #t)))))
(native-inputs (inputs
`(("openssl" ,openssl-1.0))))) ; for openssl-sys-extras `(("openssl" ,openssl-1.0))))) ; for openssl-sys-extras
(define-public rust-sha1-asm-0.4 (define-public rust-sha1-asm-0.4
@ -31008,8 +30970,9 @@ extension for the Trust-DNS client to use rustls for TLS.")
(base32 (base32
"0vbh2y7w2s5gcw33fn4hb5f927kgjm6603vw63slg9riikmsiq43")))) "0vbh2y7w2s5gcw33fn4hb5f927kgjm6603vw63slg9riikmsiq43"))))
(native-inputs (native-inputs
`(("openssl" ,openssl) `(("pkg-config" ,pkg-config)))
("pkg-config" ,pkg-config))) (inputs
`(("openssl" ,openssl)))
(arguments (arguments
`(#:cargo-test-flags `(#:cargo-test-flags
'("--release" "--" "--skip=tests::test_tls_client_stream_ipv4") '("--release" "--" "--skip=tests::test_tls_client_stream_ipv4")
@ -31023,14 +30986,7 @@ extension for the Trust-DNS client to use rustls for TLS.")
("rust-webpki" ,rust-webpki-0.19)) ("rust-webpki" ,rust-webpki-0.19))
#:cargo-development-inputs #:cargo-development-inputs
(("rust-openssl" ,rust-openssl-0.10) (("rust-openssl" ,rust-openssl-0.10)
("rust-tokio" ,rust-tokio-0.1)) ("rust-tokio" ,rust-tokio-0.1))))))
#:phases
(modify-phases %standard-phases
(add-after 'unpack 'find-openssl
(lambda* (#:key inputs #:allow-other-keys)
(let ((openssl (assoc-ref inputs "openssl")))
(setenv "OPENSSL_DIR" openssl))
#t)))))))
(define-public rust-try-from-0.3 (define-public rust-try-from-0.3
(package (package

View file

@ -73,13 +73,7 @@
("rust-zoneinfo-compiled" ,rust-zoneinfo-compiled-0.4)) ("rust-zoneinfo-compiled" ,rust-zoneinfo-compiled-0.4))
#:cargo-development-inputs #:cargo-development-inputs
(("rust-datetime" ,rust-datetime-0.4)) (("rust-datetime" ,rust-datetime-0.4))
#:phases
(modify-phases %standard-phases (modify-phases %standard-phases
(add-after 'configure 'dont-vendor-sources
(lambda* (#:key inputs #:allow-other-keys)
(let ((openssl (assoc-ref inputs "openssl")))
(setenv "OPENSSL_DIR" openssl))
#t))
;; Ignoring failing tests. ;; Ignoring failing tests.
;; Reported in https://github.com/ogham/exa/issues/318 ;; Reported in https://github.com/ogham/exa/issues/318
(add-before 'check 'disable-failing-tests (add-before 'check 'disable-failing-tests
@ -393,18 +387,12 @@ gitignore rules.")
("rust-lazy-static" ,rust-lazy-static-1) ("rust-lazy-static" ,rust-lazy-static-1)
("rust-regex" ,rust-regex-1) ("rust-regex" ,rust-regex-1)
("rust-serde-json" ,rust-serde-json-1) ("rust-serde-json" ,rust-serde-json-1)
("rust-tempfile" ,rust-tempfile-3)) ("rust-tempfile" ,rust-tempfile-3))))
#:phases
(modify-phases %standard-phases
(add-after 'configure 'unvendor-libraries-from-crates
(lambda* (#:key inputs #:allow-other-keys)
(let ((openssl (assoc-ref inputs "openssl")))
(setenv "OPENSSL_DIR" openssl))
#t)))))
(native-inputs (native-inputs
`(("pkg-config" ,pkg-config)))
(inputs
`(("libgit2" ,libgit2) `(("libgit2" ,libgit2)
("openssl" ,openssl) ("openssl" ,openssl)
("pkg-config" ,pkg-config)
("zlib" ,zlib))) ("zlib" ,zlib)))
(home-page "https://tokei.rs") (home-page "https://tokei.rs")
(synopsis "Count code, quickly") (synopsis "Count code, quickly")

View file

@ -122,6 +122,8 @@ directory = '" port)
(setenv "CC" (string-append (assoc-ref inputs "gcc") "/bin/gcc")) (setenv "CC" (string-append (assoc-ref inputs "gcc") "/bin/gcc"))
(setenv "LIBGIT2_SYS_USE_PKG_CONFIG" "1") (setenv "LIBGIT2_SYS_USE_PKG_CONFIG" "1")
(setenv "LIBSSH2_SYS_USE_PKG_CONFIG" "1") (setenv "LIBSSH2_SYS_USE_PKG_CONFIG" "1")
(when (assoc-ref inputs "openssl")
(setenv "OPENSSL_DIR" (assoc-ref inputs "openssl")))
;; We don't use the Cargo.lock file to determine the package versions we use ;; We don't use the Cargo.lock file to determine the package versions we use
;; during building, and in any case if one is not present it is created ;; during building, and in any case if one is not present it is created