[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
299/469: gnu: rust: Remove more bundled sources.
From: |
guix-commits |
Subject: |
299/469: gnu: rust: Remove more bundled sources. |
Date: |
Tue, 25 Apr 2023 15:03:49 -0400 (EDT) |
efraim pushed a commit to branch rust-team
in repository guix.
commit 018601caf93e650734fe3af97d101ca2f601fdbb
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 f22674cd77..accb2ea7f9 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)
@@ -705,6 +706,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)
@@ -801,6 +829,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")))
@@ -845,6 +878,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)
- 273/469: gnu: Remove rust-tokio-1.8., (continued)
- 273/469: gnu: Remove rust-tokio-1.8., guix-commits, 2023/04/25
- 282/469: gnu: rust-env-logger-0.9: Update to 0.9.3., guix-commits, 2023/04/25
- 288/469: gnu: Add rust-if-addrs-sys-0.3., guix-commits, 2023/04/25
- 155/469: gnu: Add rust-ntest-proc-macro-helper-0.8., guix-commits, 2023/04/25
- 157/469: gnu: Remove rust-uint-0.4., guix-commits, 2023/04/25
- 159/469: gnu: Remove rust-tinyvec-0.3., guix-commits, 2023/04/25
- 254/469: gnu: Add rust-jemallocator-0.5., guix-commits, 2023/04/25
- 276/469: gnu: rust-aho-corasick-0.7: Update to 0.7.20., guix-commits, 2023/04/25
- 284/469: gnu: rust-ring-0.16: Remove pregenerated files., guix-commits, 2023/04/25
- 293/469: gnu: rust-libloading: Remove bundled libraries., guix-commits, 2023/04/25
- 299/469: gnu: rust: Remove more bundled sources.,
guix-commits <=
- 295/469: gnu: rust-tikv-jemalloc-sys-0.4: Remove bundled sources., guix-commits, 2023/04/25
- 309/469: gnu: rust-python3-dll-a-0.2: Update to 0.2.6., guix-commits, 2023/04/25
- 306/469: gnu: Add rust-1.68., guix-commits, 2023/04/25
- 336/469: gnu: Add rust-rend-0.4., guix-commits, 2023/04/25
- 345/469: gnu: Add rust-structmeta-derive-0.1., guix-commits, 2023/04/25
- 349/469: gnu: Add rust-windows-interface-0.46., guix-commits, 2023/04/25
- 356/469: gnu: rust-1.68: Update to 1.68.2., guix-commits, 2023/04/25
- 353/469: gnu: Add rust-itoap-1., guix-commits, 2023/04/25
- 372/469: gnu: rust-libgit2-sys-0.12: Update to 0.12.26., guix-commits, 2023/04/25
- 366/469: gnu: Add rust-nom-derive-impl-0.10., guix-commits, 2023/04/25