Subject: [PATCH 1/2] gnu: Add rust-1.83.

From: Zheng Junjie <[email-masked]>
Date: Mon, 17 Feb 2025 02:02:40 +0800

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

Change-Id: I1cb42d71bed57fe766d7434d2aa950110eab0ed3
---
 gnu/packages/rust.scm | 44 ++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 43 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/rust.scm b/gnu/packages/rust.scm
index abaf7166fd5..d6b78209ac2 100644
--- a/gnu/packages/rust.scm
+++ b/gnu/packages/rust.scm
@@ -13,7 +13,7 @@
 ;;; Copyright © 2020 Matthew James Kraai <[email-masked]>
 ;;; Copyright © 2021 Maxim Cournoyer <[email-masked]>
 ;;; Copyright © 2021 (unmatched parenthesis <[email-masked]>
-;;; Copyright © 2022 Zheng Junjie <[email-masked]>
+;;; Copyright © 2022, 2025 Zheng Junjie <[email-masked]>
 ;;; Copyright © 2022 Jim Newsome <[email-masked]>
 ;;; Copyright © 2022 Mark H Weaver <[email-masked]>
 ;;; Copyright © 2023 Fries <[email-masked]>
@@ -1041,6 +1041,48 @@ (define-public rust-1.82
                  (generate-all-checksums "vendor"))))))))))

+(define-public rust-1.83
+  (let ((base-rust
+         (rust-bootstrapped-package
+          rust-1.82 "1.83.0"
+          "0vhwhk4cbyppnz0lcazfjyddyz811fgvadfxswldicpashxpfbbj")))
+    (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.10.1/Cargo.toml"
+                            "vendor/tempfile-3.13.0/Cargo.toml")
+               (("features = \\[\"fs\"" all)
+                (string-append all ", \"use-libc\"")))))))
+      (inputs (modify-inputs (package-inputs base-rust)
+                ;; Need llvm >= 18.0
+                (replace "llvm" llvm-18)))
+      (arguments
+       (substitute-keyword-arguments (package-arguments base-rust)
+         ((#:phases phases)
+          `(modify-phases ,phases
+             (add-after 'configure 'not-download-ci-llvm
+               (lambda _
+                 (substitute* "config.toml"
+                   (("\\[llvm\\]")
+                    "[llvm]\ndownload-ci-llvm = false")))))))))))
+
+
 (define (make-ignore-test-list strs)
   "Function to make creating a list to ignore tests a bit easier."
   (map (lambda (str)
-- 
2.47.1