From f503cfc9c51ea4ddd6cc9c027f1897e7866e411e Mon Sep 17 00:00:00 2001 From: Björn Höfling Date: Sun, 20 Sep 2020 10:27:00 +0200 Subject: build/maven-build-system: Return #t in fix-pom-files phase. * guix/build/maven-build-system.scm (fix-pom-files): Return #t. --- guix/build/maven-build-system.scm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'guix/build') diff --git a/guix/build/maven-build-system.scm b/guix/build/maven-build-system.scm index 914298d584..534b4ebcee 100644 --- a/guix/build/maven-build-system.scm +++ b/guix/build/maven-build-system.scm @@ -100,7 +100,8 @@ inputs local-packages excludes))))))) (define* (fix-pom-files #:key inputs local-packages exclude #:allow-other-keys) - (fix-pom "pom.xml" inputs local-packages exclude)) + (fix-pom "pom.xml" inputs local-packages exclude) + #t) (define* (build #:key outputs #:allow-other-keys) "Build the given package." -- cgit v1.2.3 From 05ee7ef8b76a856054b3a25062dfcdfa3e73671b Mon Sep 17 00:00:00 2001 From: Vagrant Cascadian Date: Wed, 28 Oct 2020 20:14:30 -0700 Subject: build/maven: fix-pom-dependencies: Fix typo. * guix/build/maven/pom (fix-pom-dependencies): Fix spelling of "overridden". --- guix/build/maven/pom.scm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'guix/build') diff --git a/guix/build/maven/pom.scm b/guix/build/maven/pom.scm index aa60af2afa..6f847da9c1 100644 --- a/guix/build/maven/pom.scm +++ b/guix/build/maven/pom.scm @@ -246,14 +246,14 @@ to re-declare the namespaces in the top-level element." "Open @var{pom-file}, and override its content, rewritting its dependencies to set their version to the latest version available in the @var{inputs}. -@var{#:with-plugins?} controls whether plugins are also overiden. +@var{#:with-plugins?} controls whether plugins are also overridden. @var{#:with-build-dependencies?} controls whether build dependencies (whose -scope is not empty) are also overiden. By default build dependencies and -plugins are not overiden. +scope is not empty) are also overridden. By default build dependencies and +plugins are not overridden. @var{#:excludes} is an association list of groupID to a list of artifactIDs. When a pair (groupID, artifactID) is present in the list, its entry is -removed instead of being overiden. If the entry is ignored because of the +removed instead of being overridden. If the entry is ignored because of the previous arguments, the entry is not removed. @var{#:local-packages} is an association list that contains additional version -- cgit v1.2.3 From 28680722b29783f66dd43f32887fba280e829812 Mon Sep 17 00:00:00 2001 From: Vagrant Cascadian Date: Wed, 28 Oct 2020 20:17:54 -0700 Subject: build/maven: fix-pom-dependencies: Fix typo. * guix/build/maven/pom (fix-pom-dependencies): Fix spelling of "overrides". --- guix/build/maven/pom.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'guix/build') diff --git a/guix/build/maven/pom.scm b/guix/build/maven/pom.scm index 6f847da9c1..52f2106659 100644 --- a/guix/build/maven/pom.scm +++ b/guix/build/maven/pom.scm @@ -262,7 +262,7 @@ not found in @var{inputs}, information from this list is used instead to determi the latest version of the package. This is an association list of group IDs to another association list of artifact IDs to a version number. -Returns nothing, but overides the @var{pom-file} as a side-effect." +Returns nothing, but overrides the @var{pom-file} as a side-effect." (define pom (get-pom pom-file)) (define (ls dir) -- cgit v1.2.3 From 159c5943e4c367452c3aeafc6fc337ca79dd11cb Mon Sep 17 00:00:00 2001 From: Vagrant Cascadian Date: Wed, 28 Oct 2020 20:21:03 -0700 Subject: build/maven: Fix typo. * guix/build/maven/pom: Fix spelling of "with". --- guix/build/maven/pom.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'guix/build') diff --git a/guix/build/maven/pom.scm b/guix/build/maven/pom.scm index 52f2106659..c92d409d2b 100644 --- a/guix/build/maven/pom.scm +++ b/guix/build/maven/pom.scm @@ -59,7 +59,7 @@ represents a @file{.pom} file content, or parts of it." (pom-ref content "parent")) (define* (find-parent content inputs #:optional local-packages) - "Find the parent pom for the pom file whith @var{content} in a package's + "Find the parent pom for the pom file with @var{content} in a package's @var{inputs}. When the parent pom cannot be found in @var{inputs}, but @var{local-packages} is defined, the parent pom is looked up in it. -- cgit v1.2.3 From be8a0881f19c7e6c5d1dabbbf1a850fff578860e Mon Sep 17 00:00:00 2001 From: Marius Bakke Date: Fri, 20 Nov 2020 09:58:04 +0100 Subject: build-system/cargo: Do not pass --features to Cargo unless specified. Fixes . * guix/build/cargo-build-system.scm (build): Default to the empty list for FEATURES. Check whether the list is empty when building the Cargo arguments. --- guix/build/cargo-build-system.scm | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'guix/build') diff --git a/guix/build/cargo-build-system.scm b/guix/build/cargo-build-system.scm index 117c8da66c..73493af551 100644 --- a/guix/build/cargo-build-system.scm +++ b/guix/build/cargo-build-system.scm @@ -4,6 +4,7 @@ ;;; Copyright © 2019 Ivan Petkov ;;; Copyright © 2019, 2020 Efraim Flashner ;;; Copyright © 2020 Jakub Kądziołka +;;; Copyright © 2020 Marius Bakke ;;; ;;; This file is part of GNU Guix. ;;; @@ -141,14 +142,17 @@ directory = '" port) (define* (build #:key skip-build? - features + (features '()) (cargo-build-flags '("--release")) #:allow-other-keys) "Build a given Cargo package." (or skip-build? - (apply invoke "cargo" "build" - "--features" (string-join features) - cargo-build-flags))) + (apply invoke + `("cargo" "build" + ,@(if (null? features) + '() + `("--features" ,(string-join features))) + ,@cargo-build-flags)))) (define* (check #:key tests? -- cgit v1.2.3 From 3dbf3a7f516cb5576ce77d9545cfa56b741f279b Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Sun, 22 Nov 2020 18:09:39 +0200 Subject: 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. --- gnu/packages/crates-io.scm | 94 +++++++++++---------------------------- gnu/packages/rust-apps.scm | 18 ++------ guix/build/cargo-build-system.scm | 2 + 3 files changed, 30 insertions(+), 84 deletions(-) (limited to 'guix/build') diff --git a/gnu/packages/crates-io.scm b/gnu/packages/crates-io.scm index 7dcbdf72e3..88f606e011 100644 --- a/gnu/packages/crates-io.scm +++ b/gnu/packages/crates-io.scm @@ -5914,14 +5914,7 @@ use with bindgen.") ("rust-winapi" ,rust-winapi-0.3) ("rust-cc" ,rust-cc-1) ("rust-pkg-config" ,rust-pkg-config-0.3) - ("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))))) + ("rust-vcpkg" ,rust-vcpkg-0.2)))) (native-inputs `(("pkg-config" ,pkg-config))) (inputs @@ -10362,10 +10355,11 @@ DWARF debugging format.") ("rust-thread-id" ,rust-thread-id-3) ("rust-time" ,rust-time-0.1)))) (native-inputs + `(("pkg-config" ,pkg-config))) + (inputs `(("libgit2" ,libgit2) ("libssh2" ,libssh2) ("openssl" ,openssl) - ("pkg-config" ,pkg-config) ("zlib" ,zlib))) (home-page "https://github.com/rust-lang/git2-rs") (synopsis "Rust bindings to libgit2") @@ -13602,18 +13596,12 @@ algorithm and related formats (ZLIB, GZIP).") ("rust-openssl-sys" ,rust-openssl-sys-0.9) ;; Build dependencies: ("rust-cc" ,rust-cc-1) - ("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))))) + ("rust-pkg-config" ,rust-pkg-config-0.3)))) (native-inputs + `(("pkg-config" ,pkg-config))) + (inputs `(("libgit2" ,libgit2) ("openssl" ,openssl) - ("pkg-config" ,pkg-config) ("zlib" ,zlib))) (home-page "https://github.com/rust-lang/git2-rs") (synopsis "Native bindings to the libgit2 library") @@ -13896,7 +13884,6 @@ allocator.") (modify-phases %standard-phases (add-after 'unpack 'set-missing-env-vars (lambda* (#:key inputs #:allow-other-keys) - (setenv "OPENSSL_DIR" (assoc-ref inputs "openssl")) (setenv "LIBCLANG_PATH" (string-append (assoc-ref inputs "clang") "/lib")) #t))))) @@ -14139,18 +14126,12 @@ pairs in insertion order.") ;; Build dependencies: ("rust-cc" ,rust-cc-1) ("rust-pkg-config" ,rust-pkg-config-0.3) - ("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))))) + ("rust-vcpkg" ,rust-vcpkg-0.2)))) (native-inputs + `(("pkg-config" ,pkg-config))) + (inputs `(("libssh2" ,libssh2) ("openssl" ,openssl) - ("pkg-config" ,pkg-config) ("zlib" ,zlib))) (home-page "https://github.com/alexcrichton/ssh2-rs") (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-tempfile" ,rust-tempfile-3)) #:cargo-development-inputs - (("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))))) + (("rust-hex" ,rust-hex-0.3)))) (native-inputs - `(("openssl" ,openssl) - ("pkg-config" ,pkg-config))) + `(("pkg-config" ,pkg-config))) + (inputs + `(("openssl" ,openssl))) (home-page "https://github.com/sfackler/rust-native-tls") (synopsis "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" ((", path =.*}") "}")) #t))))) - (native-inputs + (inputs `(("openssl" ,openssl-1.0))))) ; for openssl-sys-extras (define-public rust-openssl-probe-0.1 @@ -17677,17 +17652,11 @@ system for OpenSSL.") ("rust-autocfg" ,rust-autocfg-1.0) ("rust-cc" ,rust-cc-1) ("rust-pkg-config" ,rust-pkg-config-0.3) - ("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))))) + ("rust-vcpkg" ,rust-vcpkg-0.2)))) (native-inputs - `(("openssl" ,openssl) - ("pkg-config" ,pkg-config))) + `(("pkg-config" ,pkg-config))) + (inputs + `(("openssl" ,openssl))) (home-page "https://github.com/sfackler/rust-openssl") (synopsis "FFI bindings to OpenSSL") (description @@ -17721,14 +17690,7 @@ system for OpenSSL.") (("rust-gdi32-sys" ,rust-gdi32-sys-0.2) ("rust-libc" ,rust-libc-0.2) ("rust-user32-sys" ,rust-user32-sys-0.2) - ("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))))))) + ("rust-pkg-config" ,rust-pkg-config-0.3)))))) (define-public rust-openssl-sys-extras-0.7 (package @@ -17756,7 +17718,7 @@ system for OpenSSL.") (substitute* "Cargo.toml" ((", path =.*}") "}")) #t))))) - (native-inputs + (inputs `(("openssl" ,openssl-1.0))) ; openssl-1.0 specifically (home-page "https://github.com/sfackler/rust-openssl") (synopsis @@ -25752,7 +25714,7 @@ functionality and without weak references.") (substitute* "Cargo.toml" ((", path =.*}") "}")) #t))))) - (native-inputs + (inputs `(("openssl" ,openssl-1.0))))) ; for openssl-sys-extras (define-public rust-sha1-asm-0.4 @@ -31008,8 +30970,9 @@ extension for the Trust-DNS client to use rustls for TLS.") (base32 "0vbh2y7w2s5gcw33fn4hb5f927kgjm6603vw63slg9riikmsiq43")))) (native-inputs - `(("openssl" ,openssl) - ("pkg-config" ,pkg-config))) + `(("pkg-config" ,pkg-config))) + (inputs + `(("openssl" ,openssl))) (arguments `(#:cargo-test-flags '("--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)) #:cargo-development-inputs (("rust-openssl" ,rust-openssl-0.10) - ("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))))))) + ("rust-tokio" ,rust-tokio-0.1)))))) (define-public rust-try-from-0.3 (package diff --git a/gnu/packages/rust-apps.scm b/gnu/packages/rust-apps.scm index fabb4e0380..004f71ae8d 100644 --- a/gnu/packages/rust-apps.scm +++ b/gnu/packages/rust-apps.scm @@ -73,13 +73,7 @@ ("rust-zoneinfo-compiled" ,rust-zoneinfo-compiled-0.4)) #:cargo-development-inputs (("rust-datetime" ,rust-datetime-0.4)) - #: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. ;; Reported in https://github.com/ogham/exa/issues/318 (add-before 'check 'disable-failing-tests @@ -393,18 +387,12 @@ gitignore rules.") ("rust-lazy-static" ,rust-lazy-static-1) ("rust-regex" ,rust-regex-1) ("rust-serde-json" ,rust-serde-json-1) - ("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))))) + ("rust-tempfile" ,rust-tempfile-3)))) (native-inputs + `(("pkg-config" ,pkg-config))) + (inputs `(("libgit2" ,libgit2) ("openssl" ,openssl) - ("pkg-config" ,pkg-config) ("zlib" ,zlib))) (home-page "https://tokei.rs") (synopsis "Count code, quickly") diff --git a/guix/build/cargo-build-system.scm b/guix/build/cargo-build-system.scm index 117c8da66c..22c5d3b530 100644 --- a/guix/build/cargo-build-system.scm +++ b/guix/build/cargo-build-system.scm @@ -122,6 +122,8 @@ directory = '" port) (setenv "CC" (string-append (assoc-ref inputs "gcc") "/bin/gcc")) (setenv "LIBGIT2_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 ;; during building, and in any case if one is not present it is created -- cgit v1.2.3 From 73dbcc4b5fc14149e56d315b9bc855adc3d5cd19 Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Sun, 22 Nov 2020 18:56:56 +0200 Subject: build-system/cargo: Set libclang environment variable when available. * guix/build/cargo-build-system.scm (configure): When clang is available in the build environment set the LIBCLANG_PATH variable. * gnu/packages/crates-graphics.scm (rust-aom-sys-0.1, uust-dav1d-sys-0.3), * gnu/packages/crates-io.scm (rust-bindgen-0.55, rust-bindgen-0.54, rust-bindgen-0.53, rust-bindgen-0.52, rust-cexpr-0.4, rust-cexpr-0.3, rust-cexpr-0.2, rust-clang-sys-1, rust-clang-sys-0.29, rust-clang-sys-0.26, rust-clang-sys-0.22, rust-clang-sys-0.11, rust-libpijul-0.12, rust-nettle-7, rust-nettle-sys-2, rust-sequoia-openpgp-0.9)[arguments]: Remove phases which set an environment variable to find clang. [inputs]: Rename instances of libclang with clang. --- gnu/packages/crates-graphics.scm | 27 ++----- gnu/packages/crates-io.scm | 159 +++++--------------------------------- guix/build/cargo-build-system.scm | 3 + 3 files changed, 27 insertions(+), 162 deletions(-) (limited to 'guix/build') diff --git a/gnu/packages/crates-graphics.scm b/gnu/packages/crates-graphics.scm index 9193479092..11bdd4c4f4 100644 --- a/gnu/packages/crates-graphics.scm +++ b/gnu/packages/crates-graphics.scm @@ -183,20 +183,12 @@ text or blue underlined text, on ANSI terminals.") (arguments `(#:cargo-inputs (("rust-bindgen" ,rust-bindgen-0.53) - ("rust-metadeps" ,rust-metadeps-1.1)) - #:phases - (modify-phases %standard-phases - (add-after 'unpack 'set-environmental-variable - (lambda* (#:key inputs #:allow-other-keys) - (let ((clang (assoc-ref inputs "libclang"))) - (setenv "LIBCLANG_PATH" - (string-append clang "/lib"))) - #t))))) + ("rust-metadeps" ,rust-metadeps-1.1)))) (native-inputs `(("pkg-config" ,pkg-config))) (inputs `(("libaom" ,libaom) - ("libclang" ,clang) + ("clang" ,clang) ("llvm" ,llvm))) (home-page "https://github.com/rust-av/aom-rs") (synopsis "FFI bindings to aom") @@ -402,19 +394,12 @@ for computer graphics.") (arguments `(#:cargo-inputs (("rust-bindgen" ,rust-bindgen-0.54) - ("rust-metadeps" ,rust-metadeps-1.1)) - #:phases - (modify-phases %standard-phases - (add-after 'unpack 'set-environmental-variable - (lambda* (#:key inputs #:allow-other-keys) - (let ((clang (assoc-ref inputs "libclang"))) - (setenv "LIBCLANG_PATH" - (string-append clang "/lib"))) - #t))))) + ("rust-metadeps" ,rust-metadeps-1.1)))) + (native-inputs + `(("pkg-config" ,pkg-config))) (inputs `(("dav1d" ,dav1d) - ("pkg-config" ,pkg-config) - ("libclang" ,clang) + ("clang" ,clang) ("llvm" ,llvm))) (home-page "https://github.com/rust-av/dav1d-rs") (synopsis "FFI bindings to dav1d") diff --git a/gnu/packages/crates-io.scm b/gnu/packages/crates-io.scm index 88f606e011..875f6e91dc 100644 --- a/gnu/packages/crates-io.scm +++ b/gnu/packages/crates-io.scm @@ -1749,11 +1749,6 @@ that uses Serde for transforming structs into bytes and vice versa!") (add-after 'unpack 'enable-unstable-features (lambda _ (setenv "RUSTC_BOOTSTRAP" "1") - #t)) - (add-before 'configure 'configure-clang - (lambda* (#:key inputs #:allow-other-keys) - (setenv "LIBCLANG_PATH" (string-append (assoc-ref inputs "clang") - "/lib")) #t))))) (home-page "https://rust-lang.github.io/rust-bindgen/") (synopsis "Generate Rust FFI bindings to C and C++ libraries.") @@ -1798,17 +1793,9 @@ bindings to C and C++ libraries.") #:cargo-development-inputs (("rust-clap" ,rust-clap-2) ("rust-diff" ,rust-diff-0.1) - ("rust-shlex" ,rust-shlex-0.1)) - #:phases - (modify-phases %standard-phases - (add-after 'unpack 'set-environmental-variable - (lambda* (#:key inputs #:allow-other-keys) - (let ((clang (assoc-ref inputs "libclang"))) - (setenv "LIBCLANG_PATH" - (string-append clang "/lib"))) - #t))))) + ("rust-shlex" ,rust-shlex-0.1)))) (inputs - `(("libclang" ,clang))))) + `(("clang" ,clang))))) (define-public rust-bindgen-0.53 (package @@ -1845,15 +1832,7 @@ bindings to C and C++ libraries.") #:cargo-development-inputs (("rust-clap" ,rust-clap-2) ("rust-diff" ,rust-diff-0.1) - ("rust-shlex" ,rust-shlex-0.1)) - #:phases - (modify-phases %standard-phases - (add-after 'unpack 'set-environmental-variable - (lambda* (#:key inputs #:allow-other-keys) - (let ((clang (assoc-ref inputs "libclang"))) - (setenv "LIBCLANG_PATH" - (string-append clang "/lib"))) - #t))))))) + ("rust-shlex" ,rust-shlex-0.1)))))) (define-public rust-bindgen-0.52 (package @@ -1891,15 +1870,7 @@ bindings to C and C++ libraries.") #:cargo-development-inputs (("rust-clap" ,rust-clap-2) ("rust-diff" ,rust-diff-0.1) - ("rust-shlex" ,rust-shlex-0.1)) - #:phases - (modify-phases %standard-phases - (add-after 'unpack 'set-environmental-variable - (lambda* (#:key inputs #:allow-other-keys) - (let ((clang (assoc-ref inputs "libclang"))) - (setenv "LIBCLANG_PATH" - (string-append clang "/lib"))) - #t))))))) + ("rust-shlex" ,rust-shlex-0.1)))))) (define-public rust-bindgen-0.51 (package @@ -3530,17 +3501,9 @@ archive to be linked into Rustcode.") `(#:cargo-inputs (("rust-nom" ,rust-nom-5)) #:cargo-development-inputs - (("rust-clang-sys" ,rust-clang-sys-0.28)) - #:phases - (modify-phases %standard-phases - (add-after 'unpack 'set-environmental-variable - (lambda* (#:key inputs #:allow-other-keys) - (let ((clang (assoc-ref inputs "libclang"))) - (setenv "LIBCLANG_PATH" - (string-append clang "/lib"))) - #t))))) + (("rust-clang-sys" ,rust-clang-sys-0.28)))) (inputs - `(("libclang" ,clang))) + `(("clang" ,clang))) (home-page "https://github.com/jethrogb/rust-cexpr") (synopsis "C expression parser and evaluator") (description @@ -3565,15 +3528,7 @@ archive to be linked into Rustcode.") `(#:cargo-inputs (("rust-nom" ,rust-nom-4.2)) #:cargo-development-inputs - (("rust-clang-sys" ,rust-clang-sys-0.28)) - #:phases - (modify-phases %standard-phases - (add-after 'unpack 'set-environmental-variable - (lambda* (#:key inputs #:allow-other-keys) - (let ((clang (assoc-ref inputs "libclang"))) - (setenv "LIBCLANG_PATH" - (string-append clang "/lib"))) - #t))))))) + (("rust-clang-sys" ,rust-clang-sys-0.28)))))) (define-public rust-cexpr-0.2 (package @@ -3594,15 +3549,7 @@ archive to be linked into Rustcode.") `(#:cargo-inputs (("rust-nom" ,rust-nom-3)) #:cargo-development-inputs - (("rust-clang-sys" ,rust-clang-sys-0.11)) - #:phases - (modify-phases %standard-phases - (add-after 'unpack 'set-environmental-variable - (lambda* (#:key inputs #:allow-other-keys) - (let ((clang (assoc-ref inputs "libclang"))) - (setenv "LIBCLANG_PATH" - (string-append clang "/lib"))) - #t))))))) + (("rust-clang-sys" ,rust-clang-sys-0.11)))))) (define-public rust-cfg-if-0.1 (package @@ -3705,20 +3652,12 @@ depending on a large number of #[cfg] parameters. Structured like an "0695kfrqx7n091fzm6msbqg2q2kyhka64q08lm63f3l9d964i8cx")))) (build-system cargo-build-system) (inputs - `(("libclang" ,clang))) + `(("clang" ,clang))) (arguments `(#:cargo-inputs (("rust-glob" ,rust-glob-0.3) ("rust-libc" ,rust-libc-0.2) - ("rust-libloading" ,rust-libloading-0.6)) - #:phases - (modify-phases %standard-phases - (add-before 'configure 'configure-clang - (lambda* (#:key inputs #:allow-other-keys) - (setenv "LIBCLANG_PATH" - (string-append (assoc-ref inputs "libclang") - "/lib")) - #t))))) + ("rust-libloading" ,rust-libloading-0.6)))) (home-page "https://github.com/KyleMayes/clang-sys") (synopsis "Rust bindings for libclang") (description "This package provides Rust bindings for libclang.") @@ -3742,15 +3681,7 @@ depending on a large number of #[cfg] parameters. Structured like an `(#:cargo-inputs (("rust-glob" ,rust-glob-0.3) ("rust-libc" ,rust-libc-0.2) - ("rust-libloading" ,rust-libloading-0.5)) - #:phases - (modify-phases %standard-phases - (add-after 'unpack 'set-environmental-variable - (lambda* (#:key inputs #:allow-other-keys) - (let ((clang (assoc-ref inputs "libclang"))) - (setenv "LIBCLANG_PATH" - (string-append clang "/lib"))) - #t))))))) + ("rust-libloading" ,rust-libloading-0.5)))))) (define-public rust-clang-sys-0.28 (package @@ -3783,15 +3714,7 @@ depending on a large number of #[cfg] parameters. Structured like an `(#:cargo-inputs (("rust-glob" ,rust-glob-0.2) ("rust-libc" ,rust-libc-0.2) - ("rust-libloading" ,rust-libloading-0.5)) - #:phases - (modify-phases %standard-phases - (add-after 'unpack 'set-environmental-variable - (lambda* (#:key inputs #:allow-other-keys) - (let ((clang (assoc-ref inputs "libclang"))) - (setenv "LIBCLANG_PATH" - (string-append clang "/lib"))) - #t))))))) + ("rust-libloading" ,rust-libloading-0.5)))))) (define-public rust-clang-sys-0.23 (package @@ -3828,15 +3751,7 @@ depending on a large number of #[cfg] parameters. Structured like an (("rust-clippy" ,rust-clippy-0.0) ("rust-glob" ,rust-glob-0.2) ("rust-libc" ,rust-libc-0.2) - ("rust-libloading" ,rust-libloading-0.5)) - #:phases - (modify-phases %standard-phases - (add-after 'unpack 'set-environmental-variable - (lambda* (#:key inputs #:allow-other-keys) - (let ((clang (assoc-ref inputs "libclang"))) - (setenv "LIBCLANG_PATH" - (string-append clang "/lib"))) - #t))))))) + ("rust-libloading" ,rust-libloading-0.5)))))) (define-public rust-clang-sys-0.11 (package @@ -3860,15 +3775,7 @@ depending on a large number of #[cfg] parameters. Structured like an ("rust-glob" ,rust-glob-0.2) ("rust-lazy-static" ,rust-lazy-static-0.2) ("rust-libc" ,rust-libc-0.2) - ("rust-libloading" ,rust-libloading-0.3)) - #:phases - (modify-phases %standard-phases - (add-after 'unpack 'set-environmental-variable - (lambda* (#:key inputs #:allow-other-keys) - (let ((clang (assoc-ref inputs "libclang"))) - (setenv "LIBCLANG_PATH" - (string-append clang "/lib"))) - #t))))))) + ("rust-libloading" ,rust-libloading-0.3)))))) (define-public rust-clap-2 (package @@ -13879,14 +13786,7 @@ allocator.") ("rust-serde-derive" ,rust-serde-derive-1) ("rust-serde-json" ,rust-serde-json-1) ("rust-tempdir" ,rust-tempdir-0.3) - ("rust-toml" ,rust-toml-0.4)) - #:phases - (modify-phases %standard-phases - (add-after 'unpack 'set-missing-env-vars - (lambda* (#:key inputs #:allow-other-keys) - (setenv "LIBCLANG_PATH" - (string-append (assoc-ref inputs "clang") "/lib")) - #t))))) + ("rust-toml" ,rust-toml-0.4)))) (native-inputs `(("pkg-config" ,pkg-config))) (inputs @@ -16108,15 +16008,7 @@ types as proposed in RFC 1158.") ("rust-thiserror" ,rust-thiserror-1)) #:cargo-development-inputs (("rust-bindgen" ,rust-bindgen-0.51) - ("rust-pkg-config" ,rust-pkg-config-0.3)) - #:phases - (modify-phases %standard-phases - (add-after 'unpack 'set-missing-env-vars - (lambda* (#:key inputs #:allow-other-keys) - ;; FIXME: why do we need to set this? - (setenv "LIBCLANG_PATH" - (string-append (assoc-ref inputs "clang") "/lib")) - #t))))) + ("rust-pkg-config" ,rust-pkg-config-0.3)))) (home-page "https://gitlab.com/sequoia-pgp/nettle-rs") (synopsis "Rust bindings for the Nettle cryptographic library") (description "This package provides Rust bindings for the Nettle @@ -16158,15 +16050,7 @@ cryptographic library.") (arguments `(#:cargo-inputs (("rust-bindgen" ,rust-bindgen-0.51) - ("rust-pkg-config" ,rust-pkg-config-0.3)) - #:phases - (modify-phases %standard-phases - (add-after 'unpack 'set-environmental-variable - (lambda* (#:key inputs #:allow-other-keys) - (let ((clang (assoc-ref inputs "clang"))) - (setenv "LIBCLANG_PATH" - (string-append clang "/lib"))) - #t))))) + ("rust-pkg-config" ,rust-pkg-config-0.3)))) (home-page "https://gitlab.com/sequoia-pgp/nettle-sys") (synopsis "Low-level Rust bindings for the Nettle cryptographic library") (description "This package provides low-level Rust bindings for the Nettle @@ -24774,14 +24658,7 @@ comparison.") ("rust-sequoia-rfc2822" ,rust-sequoia-rfc2822-0.9) ("rust-time" ,rust-time-0.1)) #:cargo-development-inputs - (("rust-rpassword" ,rust-rpassword-3)) - #:phases - (modify-phases %standard-phases - (add-after 'unpack 'set-missing-env-vars - (lambda* (#:key inputs #:allow-other-keys) - (setenv "LIBCLANG_PATH" - (string-append (assoc-ref inputs "clang") "/lib")) - #t))))) + (("rust-rpassword" ,rust-rpassword-3)))) (native-inputs `(("pkg-config" ,pkg-config))) (inputs diff --git a/guix/build/cargo-build-system.scm b/guix/build/cargo-build-system.scm index 22c5d3b530..8c0268906e 100644 --- a/guix/build/cargo-build-system.scm +++ b/guix/build/cargo-build-system.scm @@ -124,6 +124,9 @@ directory = '" port) (setenv "LIBSSH2_SYS_USE_PKG_CONFIG" "1") (when (assoc-ref inputs "openssl") (setenv "OPENSSL_DIR" (assoc-ref inputs "openssl"))) + (when (assoc-ref inputs "clang") + (setenv "LIBCLANG_PATH" + (string-append (assoc-ref inputs "clang") "/lib"))) ;; 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 -- cgit v1.2.3 From 1ca0c348674dd4dec2ccb5a2d79b4cfd03a631ef Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Sun, 22 Nov 2020 19:29:32 +0200 Subject: build-system/cargo: Set gettext environment variable when available. * guix/build/cargo-build-system.scm (configure): When gettext is available in the build environment set the GETTEXT_SYSTEM variable. * gnu/packages/crates-io.scm (rust-gettext-rs-0.5, rust-gettext-rs-0.4, rust-gettext-sys-0.19)[arguments]: Remove phase to help find system gettext. --- gnu/packages/crates-io.scm | 27 +++------------------------ guix/build/cargo-build-system.scm | 2 ++ 2 files changed, 5 insertions(+), 24 deletions(-) (limited to 'guix/build') diff --git a/gnu/packages/crates-io.scm b/gnu/packages/crates-io.scm index 4ff6c97636..82e37a0f8d 100644 --- a/gnu/packages/crates-io.scm +++ b/gnu/packages/crates-io.scm @@ -10030,14 +10030,7 @@ retrieving random data from system source.") (arguments `(#:cargo-inputs (("rust-gettext-sys" ,rust-gettext-sys-0.19) - ("rust-locale-config" ,rust-locale-config-0.3)) - #:phases - (modify-phases %standard-phases - (add-after 'configure 'use-system-gettext - (lambda* (#:key inputs #:allow-other-keys) - (let ((gettext (assoc-ref inputs "gettext"))) - (setenv "GETTEXT_SYSTEM" gettext) - #t)))))) + ("rust-locale-config" ,rust-locale-config-0.3)))) (inputs `(("gettext" ,gettext-minimal))) (home-page "https://github.com/Koka/gettext-rs") @@ -10062,14 +10055,7 @@ retrieving random data from system source.") (arguments `(#:cargo-inputs (("rust-gettext-sys" ,rust-gettext-sys-0.19) - ("rust-locale-config" ,rust-locale-config-0.2)) - #:phases - (modify-phases %standard-phases - (add-after 'configure 'use-system-gettext - (lambda* (#:key inputs #:allow-other-keys) - (let ((gettext (assoc-ref inputs "gettext"))) - (setenv "GETTEXT_SYSTEM" gettext) - #t)))))))) + ("rust-locale-config" ,rust-locale-config-0.2)))))) (define-public rust-gettext-sys-0.19 (package @@ -10090,14 +10076,7 @@ retrieving random data from system source.") (build-system cargo-build-system) (arguments `(#:cargo-inputs - (("rust-cc" ,rust-cc-1)) - #:phases - (modify-phases %standard-phases - (add-after 'configure 'use-system-gettext - (lambda* (#:key inputs #:allow-other-keys) - (let ((gettext (assoc-ref inputs "gettext"))) - (setenv "GETTEXT_SYSTEM" gettext) - #t)))))) + (("rust-cc" ,rust-cc-1)))) (inputs `(("gettext" ,gettext-minimal))) (home-page "https://github.com/Koka/gettext-rs") diff --git a/guix/build/cargo-build-system.scm b/guix/build/cargo-build-system.scm index 8c0268906e..a638d0eded 100644 --- a/guix/build/cargo-build-system.scm +++ b/guix/build/cargo-build-system.scm @@ -124,6 +124,8 @@ directory = '" port) (setenv "LIBSSH2_SYS_USE_PKG_CONFIG" "1") (when (assoc-ref inputs "openssl") (setenv "OPENSSL_DIR" (assoc-ref inputs "openssl"))) + (when (assoc-ref inputs "gettext") + (setenv "GETTEXT_SYSTEM" (assoc-ref inputs "gettext"))) (when (assoc-ref inputs "clang") (setenv "LIBCLANG_PATH" (string-append (assoc-ref inputs "clang") "/lib"))) -- cgit v1.2.3