[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
299/470: gnu: rust: Remove more bundled sources.
From: |
guix-commits |
Subject: |
299/470: gnu: rust: Remove more bundled sources. |
Date: |
Sun, 30 Apr 2023 14:04:36 -0400 (EDT) |
efraim pushed a commit to branch rust-team
in repository guix.
commit e81229735e35b6d7c6cb737f8f0313bc72c567ff
Author: Efraim Flashner <efraim@flashner.co.il>
AuthorDate: Tue Mar 14 14:00:25 2023 +0200
gnu: rust: Remove more bundled sources.
* gnu/packages/rust.scm (rust)[source]: Adjust snippet to remove more
bundled sources.
[arguments]: Add a phase to set flags to use more system libraries.
[inputs]: Add curl, libgit2, libssh, xz, zlib.
---
gnu/packages/rust.scm | 35 +++++++++++++++++++++++++++++++++++
1 file changed, 35 insertions(+)
diff --git a/gnu/packages/rust.scm b/gnu/packages/rust.scm
index fcb8a77a2e..34cdf04f59 100644
--- a/gnu/packages/rust.scm
+++ b/gnu/packages/rust.scm
@@ -50,6 +50,7 @@
#:use-module (gnu packages python)
#:use-module (gnu packages ssh)
#:use-module (gnu packages tls)
+ #:use-module (gnu packages version-control)
#:use-module (gnu packages)
#:use-module (guix build-system cargo)
#:use-module (guix build-system copy)
@@ -707,6 +708,33 @@ safety and thread safety guarantees.")
(package
(inherit base-rust)
(outputs (cons "rustfmt" (package-outputs base-rust)))
+ ;; This is the rust we build everything with, so we make sure to
unbundle more.
+ ;; We allow other versions of the rust compiler to use bundled sources
so we
+ ;; don't have to worry about carrying old versions of some libraries.
+ (source
+ (origin
+ (inherit (package-source base-rust))
+ (snippet
+ '(begin
+ (for-each delete-file-recursively
+ '("src/llvm-project"
+ "vendor/curl-sys/curl"
+ "vendor/jemalloc-sys/jemalloc"
+ "vendor/libgit2-sys/libgit2"
+ ;"vendor/libnghttp2-sys/nghttp2"
+ "vendor/libssh2-sys/libssh2"
+ "vendor/libz-sys/src/zlib"
+ ;"vendor/libz-sys/src/zlib-ng"
+ "vendor/lzma-sys/xz-5.2"
+ ;"vendor/openssl-src"
+ "vendor/tikv-jemalloc-sys/jemalloc"))
+ ;; Remove vendored dynamically linked libraries.
+ ;; find . -not -type d -executable -exec file {} \+ | grep ELF
+ (delete-file "vendor/vte/vim10m_match")
+ (delete-file "vendor/vte/vim10m_table")
+ ;; Also remove the bundled (mostly Windows) libraries.
+ (for-each delete-file
+ (find-files "vendor" ".*\\.(a|dll|exe|lib)$"))))))
(arguments
(substitute-keyword-arguments (package-arguments base-rust)
((#:tests? _ #f)
@@ -803,6 +831,11 @@ safety and thread safety guarantees.")
((file) file))
(("fn ctrl_c_kills_everyone")
"#[ignore]\nfn ctrl_c_kills_everyone"))))
+ (add-after 'set-env 'set-more-env
+ (lambda* (#:key inputs #:allow-other-keys)
+ (setenv "LIBGIT2_SYS_USE_PKG_CONFIG" "1")
+ (setenv "LIBSSH2_SYS_USE_PKG_CONFIG" "1")
+ (setenv "OPENSSL_DIR" (assoc-ref inputs "openssl"))))
(add-after 'configure 'add-gdb-to-config
(lambda* (#:key inputs #:allow-other-keys)
(let ((gdb (assoc-ref inputs "gdb")))
@@ -847,6 +880,8 @@ safety and thread safety guarantees.")
(("prefix = \"[^\"]*\"")
(format #f "prefix = ~s" (assoc-ref outputs "rustfmt"))))
(invoke "./x.py" "install" "rustfmt")))))))
+ (inputs (modify-inputs (package-inputs base-rust)
+ (prepend curl libgit2 libssh xz zlib)))
;; Add test inputs.
(native-inputs (cons* `("gdb" ,gdb/pinned)
`("procps" ,procps)
- 463/470: gnu: rust-ct-logs-0.8: Add missing input., (continued)
- 463/470: gnu: rust-ct-logs-0.8: Add missing input., guix-commits, 2023/04/30
- 466/470: gnu: rust-webpki-0.18: Fix build., guix-commits, 2023/04/30
- 469/470: gnu: rust-gmp-mpfr-sys-1: Remove bundled libraries., guix-commits, 2023/04/30
- 297/470: gnu: rust-1.55: Remove bundled libraries., guix-commits, 2023/04/30
- 217/470: gnu: rust-wasm-bindgen-macro-0.2: Update to 0.2.84., guix-commits, 2023/04/30
- 170/470: gnu: Remove rust-parity-wasm-0.40., guix-commits, 2023/04/30
- 204/470: gnu: Add rust-libdeflater-0.11., guix-commits, 2023/04/30
- 216/470: gnu: rust-wasm-bindgen-futures-0.4: Update to 0.4.34., guix-commits, 2023/04/30
- 233/470: gnu: Remove rust-cargon-0.0., guix-commits, 2023/04/30
- 228/470: gnu: Remove rust-lexical-5., guix-commits, 2023/04/30
- 299/470: gnu: rust: Remove more bundled sources.,
guix-commits <=
- 302/470: gnu: agate: Add missing input., guix-commits, 2023/04/30
- 305/470: gnu: rbw: Add missing input., guix-commits, 2023/04/30
- 321/470: gnu: rust-windows-i686-msvc-0.42: Update to 0.42.2., guix-commits, 2023/04/30
- 317/470: gnu: Add rust-radium-0.7., guix-commits, 2023/04/30
- 324/470: gnu: rust-windows-aarch64-gnullvm-0.42: Update to 0.42.2., guix-commits, 2023/04/30
- 328/470: gnu: Add rust-windows-targets-0.42., guix-commits, 2023/04/30
- 330/470: gnu: rust-arbitrary-1: Update to 1.3.0., guix-commits, 2023/04/30
- 331/470: gnu: rust-derive-arbitrary-1: Update to 1.3.0., guix-commits, 2023/04/30
- 334/470: gnu: rust-bytecheck-derive-0.6: Update to 0.6.10., guix-commits, 2023/04/30
- 341/470: gnu: rust-serde-derive-1: Update to 1.0.158., guix-commits, 2023/04/30