[bug#76345,1/2] gnu: Add rust-1.83.

Message ID 4dceee0d5070f26488db9a0757d316e6e683bcd4.1739418344.git.z572@z572.online
State New
Headers
Series Add rust 1.83, 1.84 |

Commit Message

Z572 Feb. 16, 2025, 6:02 p.m. UTC
  * gnu/packages/rust.scm (rust-1.83): New variable.

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

Patch

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 <kraai@ftbfs.org>
 ;;; Copyright © 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com>
 ;;; Copyright © 2021 (unmatched parenthesis <paren@disroot.org>
-;;; Copyright © 2022 Zheng Junjie <873216071@qq.com>
+;;; Copyright © 2022, 2025 Zheng Junjie <z572@z572.online>
 ;;; Copyright © 2022 Jim Newsome <jnewsome@torproject.org>
 ;;; Copyright © 2022 Mark H Weaver <mhw@netris.org>
 ;;; Copyright © 2023 Fries <fries1234@protonmail.com>
@@ -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)