Subject: [bug#72327] [PATCH] gnu: Add rust-1.80.

From: Jean SIMARD <[email-masked]>
Date: Sat, 27 Jul 2024 21:20:20 +0000

* gnu/packages/rust.scm (rust-1.80): New variable.

Change-Id: I9ab121ebb83bb5fca38c5dc530ae34cd50734017
---
Last version of rust 1.80.0 have been released on the 25th of July (see
https://blog.rust-lang.org/2024/07/25/Rust-1.80.0.html).

I've been able to test the resulting package by building a variant
of `ripgrep`, only customizing the `cargo-build-system` argument
with `#:rust rust-1.80` and running
`./pre-inst-env guix build --file=ripgrep.scm`.  The output binary of
the build, `rg` runs just fine.

 gnu/packages/rust.scm | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/gnu/packages/rust.scm b/gnu/packages/rust.scm
index 465899fe9d..58b1dcd93a 100644
--- a/gnu/packages/rust.scm
+++ b/gnu/packages/rust.scm
@@ -1013,6 +1013,34 @@ (define-public rust-1.79
                (("features = \\[\"fs\"" all)
                 (string-append all ", \"use-libc\""))))))))))
 
+(define-public rust-1.80
+  (let ((base-rust (rust-bootstrapped-package rust-1.79 "1.80.0"
+                    "0wnn44spsy1gnbwxn4gzbnrgkxah9nrgfxj5mqn6n3r37wcnqq3g")))
+    (package
+      (inherit base-rust)
+      (source
+       (origin
+         (inherit (package-source base-rust))
+         (snippet
+          '(begin
+             (for-each delete-file-recursively
+                       '("src/llvm-project"
+                         "vendor/jemalloc-sys-0.5.3+5.3.0-patched/jemalloc"
+                         "vendor/jemalloc-sys-0.5.4+5.3.0-patched/jemalloc"
+                         "vendor/openssl-src-111.28.2+1.1.1w/openssl"
+                         "vendor/tikv-jemalloc-sys-0.5.4+5.3.0-patched/jemalloc"))
+             ;; Remove vendored dynamically linked libraries.
+             ; find . -not -type d -executable -exec file {} \+ | grep ELF
+             ;; Also remove the bundled (mostly Windows) libraries.
+             (for-each delete-file
+                       (find-files "vendor" "\\.(a|dll|exe|lib)$"))
+             ;; Adjust vendored dependency to explicitly use rustix with libc backend.
+             (substitute* '("vendor/tempfile-3.4.0/Cargo.toml"
+                            "vendor/tempfile-3.7.1/Cargo.toml"
+                            "vendor/tempfile-3.10.1/Cargo.toml")
+               (("features = \\[\"fs\"" all)
+                (string-append all ", \"use-libc\""))))))))))
+
 (define (make-ignore-test-list strs)
   "Function to make creating a list to ignore tests a bit easier."
   (map (lambda (str)

base-commit: 46a64c7fdd057283063aae6df058579bb07c4b6a
prerequisite-patch-id: 4f98409565d53cc8795ab7f4a1618cc4224d8105
prerequisite-patch-id: 4d4336c9b775dc61815bd427718da4ba05e207df
prerequisite-patch-id: 1033e26576f3c3669f8511217b73e9aaf29b6afa
prerequisite-patch-id: 651aa8b2cf8b006c08abfc44a190ee3197d06e95
prerequisite-patch-id: 8f846f42eb6a122e494da39e564be336a8ab90bc
prerequisite-patch-id: 0ede82ec9b487cab87b18c5631900629e9228f36
prerequisite-patch-id: 64e12c5820833a1ba2b8fce6095c03b65b7ecdd6
-- 
2.45.2