From: "Jakub Kądziołka" <kuba@kadziolka.net>
To: 42049@debbugs.gnu.org
Subject: [bug#42049] [PATCH 4/4] gnu: crates-io: Use propagated-phases.
Date: Thu, 25 Jun 2020 23:26:43 +0200 [thread overview]
Message-ID: <20200625212643.26344-1-kuba@kadziolka.net> (raw)
In-Reply-To: <20200625212523.25016-1-kuba@kadziolka.net>
* gnu/packages/crates-io.scm (rust-metadeps-1.1)[arguments]:
Don't skip build, skip tests instead. Add rust-lazy-static-0.2 as
development input.
(rust-clang-sys-0.28)[arguments]: Propagate phase, give it a
descriptive name.
[inputs]: Move libclang...
[propagated-inputs]: ...here.
(rust-clang-sys-0.26)[arguments]: Use substitute-keyword-arguments
to avoid duplicating the code of the phase.
(rust-bindgen-0.52, rust-aom-sys-0.1): Don't duplicate inputs and
phases of dependencies.
---
gnu/packages/crates-io.scm | 74 ++++++++++++--------------------------
1 file changed, 22 insertions(+), 52 deletions(-)
diff --git a/gnu/packages/crates-io.scm b/gnu/packages/crates-io.scm
index 5a4b513f1a..8d57f4f8d0 100644
--- a/gnu/packages/crates-io.scm
+++ b/gnu/packages/crates-io.scm
@@ -535,24 +535,11 @@ text or blue underlined text, on ANSI terminals.")
"0ix3djcf84kk53h6fac73n7jc614745n7kbmikxwi3s73b6vzgsr"))))
(build-system cargo-build-system)
(arguments
- `(;#:skip-build? #t
- #:cargo-inputs
+ `(#:cargo-inputs
(("rust-bindgen" ,rust-bindgen-0.51)
- ("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)))))
- (native-inputs
- `(("pkg-config" ,pkg-config)))
+ ("rust-metadeps" ,rust-metadeps-1.1))))
(inputs
- `(("libaom" ,libaom)
- ("libclang" ,clang)
- ("llvm" ,llvm)))
+ `(("libaom" ,libaom)))
(home-page "https://github.com/rust-av/aom-rs")
(synopsis "FFI bindings to aom")
(description "This package provides FFI bindings to aom.")
@@ -1338,17 +1325,7 @@ that uses Serde for transforming structs into bytes and vice versa!")
#: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)))))
- (inputs
- `(("libclang" ,clang)))
+ ("rust-shlex" ,rust-shlex-0.1))))
(home-page "https://rust-lang.github.io/rust-bindgen/")
(synopsis
"Automatically generates Rust FFI bindings to C and C++ libraries")
@@ -1391,8 +1368,7 @@ that uses Serde for transforming structs into bytes and vice versa!")
#:cargo-development-inputs
(("rust-clap" ,rust-clap-2)
("rust-diff" ,rust-diff-0.1)
- ("rust-shlex" ,rust-shlex-0.1))))
- (inputs `())))
+ ("rust-shlex" ,rust-shlex-0.1))))))
(define-public rust-bindgen-0.50
(package
@@ -2968,15 +2944,14 @@ for computer graphics.")
(("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)))))
- (inputs
+ #:propagated-phases
+ ((add-after 'unpack 'bindgen:set-libclang-path
+ (lambda* (#:key inputs #:allow-other-keys)
+ (let ((clang (assoc-ref inputs "libclang")))
+ (setenv "LIBCLANG_PATH"
+ (string-append clang "/lib")))
+ #t)))))
+ (propagated-inputs
`(("libclang" ,clang)))
(home-page "https://github.com/KyleMayes/clang-sys")
(synopsis "Rust bindings for libclang")
@@ -2998,18 +2973,11 @@ for computer graphics.")
(base32
"1r50dwy5hj5gq07dn0qf8222d07qv0970ymx0j8n9779yayc3w3f"))))
(arguments
- `(#: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)))))))
+ (substitute-keyword-arguments (package-arguments rust-clang-sys-0.28)
+ (#:cargo-inputs
+ `(("rust-glob" ,rust-glob-0.2)
+ ("rust-libc" ,rust-libc-0.2)
+ ("rust-libloading" ,rust-libloading-0.5)))))))
(define-public rust-clang-sys-0.23
(package
@@ -12712,11 +12680,13 @@ for Rust structs.")
"1hjla9ypycqw1snd2qf87cckcc0d5z5qvxpcijn5yrrs3f825cbk"))))
(build-system cargo-build-system)
(arguments
- `(#:skip-build? #t
+ `(#:tests? #f ;; Test files aren't shipped to crates.io
#:cargo-inputs
(("rust-error-chain" ,rust-error-chain-0.10)
("rust-toml" ,rust-toml-0.2)
- ("rust-pkg-config" ,rust-pkg-config-0.3))))
+ ("rust-pkg-config" ,rust-pkg-config-0.3))
+ #:cargo-development-inputs
+ (("rust-lazy-static" ,rust-lazy-static-0.2))))
(home-page "https://github.com/joshtriplett/metadeps")
(synopsis "Run pkg-config from declarative dependencies in Cargo.toml")
(description "Run pkg-config from declarative dependencies in Cargo.toml.")
--
2.26.2
next prev parent reply other threads:[~2020-06-25 21:27 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-25 21:25 [bug#42049] [PATCH 0/4] build-system/cargo: Propagations across the crate closure Jakub Kądziołka
2020-06-25 21:26 ` [bug#42049] [PATCH 1/4] build-system/cargo: Allow propagating inputs across CARGO-INPUTS edges Jakub Kądziołka
2020-06-25 21:26 ` [bug#42049] [PATCH 2/4] gnu: crates-io: Use propagated-inputs and propagated-native-inputs Jakub Kądziołka
2020-06-25 21:26 ` [bug#42049] [PATCH 3/4] build-system/cargo: Add a propagated-phases argument Jakub Kądziołka
2020-06-25 21:26 ` Jakub Kądziołka [this message]
2020-08-13 9:48 ` [bug#42049] [PATCH 0/4] build-system/cargo: Propagations across the crate closure Efraim Flashner
2020-08-13 16:16 ` Jakub Kądziołka
2020-08-14 21:26 ` Leo Famulari
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200625212643.26344-1-kuba@kadziolka.net \
--to=kuba@kadziolka.net \
--cc=42049@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).