summaryrefslogtreecommitdiff
path: root/gnu/packages/rust.scm
diff options
context:
space:
mode:
authormoksh <mysticmoksh@riseup.net>2026-02-02 23:49:45 +0530
committerAndreas Enge <andreas@enge.fr>2026-02-21 10:14:48 +0100
commit66ce71ec2511d3e8f0590cfb16cf01fd244004bc (patch)
treec3445db8bc9f9de1b939fe7843d35f2a66149880 /gnu/packages/rust.scm
parent8f0c4c348bd2fc01b7fe93c200d8ef15cdb5d0c5 (diff)
gnu: Add rust-1.91.
* gnu/packages/rust.scm (rust-1.91): New variable. Change-Id: I5df33f594de40d714bfb8129abe777b76e8ea21a Signed-off-by: Efraim Flashner <efraim@flashner.co.il>
Diffstat (limited to 'gnu/packages/rust.scm')
-rw-r--r--gnu/packages/rust.scm92
1 files changed, 92 insertions, 0 deletions
diff --git a/gnu/packages/rust.scm b/gnu/packages/rust.scm
index bffac20657b..01ba987a4c4 100644
--- a/gnu/packages/rust.scm
+++ b/gnu/packages/rust.scm
@@ -18,6 +18,7 @@
18;;; Copyright © 2022 Mark H Weaver <mhw@netris.org> 18;;; Copyright © 2022 Mark H Weaver <mhw@netris.org>
19;;; Copyright © 2023 Fries <fries1234@protonmail.com> 19;;; Copyright © 2023 Fries <fries1234@protonmail.com>
20;;; Copyright © 2023 Herman Rimm <herman_rimm@protonmail.com> 20;;; Copyright © 2023 Herman Rimm <herman_rimm@protonmail.com>
21;;; Copyright © 2026 Untrusem <mysticmoksh@riseup.net>
21;;; 22;;;
22;;; This file is part of GNU Guix. 23;;; This file is part of GNU Guix.
23;;; 24;;;
@@ -1616,6 +1617,97 @@ ge13ca993e8ccb9ba9847cc330696e02839f328f7/jemalloc"))
1616 (modify-inputs (package-inputs base-rust) 1617 (modify-inputs (package-inputs base-rust)
1617 (replace "llvm" llvm-21)))))) 1618 (replace "llvm" llvm-21))))))
1618 1619
1620(define-public rust-1.91
1621 (let ((base-rust
1622 (rust-bootstrapped-package
1623 rust-1.90 "1.91.0"
1624 "12iysk87bmhlcdcbr939y8cdfcx0an4z9ixjlbq16c3ma60m4zrj")))
1625 (package
1626 (inherit base-rust)
1627 (source
1628 (origin
1629 (inherit (package-source base-rust))
1630 (snippet
1631 '(begin
1632 (for-each delete-file-recursively
1633 '("src/llvm-project"
1634 "vendor/curl-sys-0.4.79+curl-8.12.0/curl"
1635 "vendor/curl-sys-0.4.83+curl-8.15.0/curl"
1636 "vendor/jemalloc-sys-0.5.3+5.3.0-patched/jemalloc"
1637 "vendor/jemalloc-sys-0.5.4+5.3.0-patched/jemalloc"
1638 "vendor/libffi-sys-3.3.2/libffi"
1639 "vendor/libz-sys-1.1.21/src/zlib"
1640 "vendor/libz-sys-1.1.22/src/zlib"
1641 "vendor/libmimalloc-sys-0.1.42/c_src/mimalloc"
1642 "vendor/openssl-src-111.28.2+1.1.1w/openssl"
1643 "vendor/openssl-src-300.5.0+3.5.0/openssl"
1644 "vendor/openssl-src-300.5.2+3.5.2/openssl"
1645 "vendor/tikv-jemalloc-sys-0.5.4+5.3.0-patched/jemalloc"
1646 "vendor/tikv-jemalloc-sys-0.6.0+5.3.0-1-\
1647ge13ca993e8ccb9ba9847cc330696e02839f328f7/jemalloc"))
1648 ;; Remove vendored dynamically linked libraries.
1649 ;; find . -not -type d -executable -exec file {} \+ | grep ELF
1650 ;; Also remove the bundled (mostly Windows) libraries.
1651 (for-each delete-file
1652 (find-files "vendor" "\\.(a|dll|exe|lib)$"))
1653 ;; Use the packaged nghttp2.
1654 (for-each
1655 (lambda (ver)
1656 (let ((vendored-dir
1657 (format #f "vendor/libnghttp2-sys-~a/nghttp2" ver))
1658 (build-rs
1659 (format #f "vendor/libnghttp2-sys-~a/build.rs" ver)))
1660 (delete-file-recursively vendored-dir)
1661 (delete-file build-rs)
1662 (call-with-output-file build-rs
1663 (lambda (port)
1664 (format port "fn main() {~@
1665 println!(\"cargo:rustc-link-lib=nghttp2\");~@
1666 }~%")))))
1667 '("0.1.11+1.64.0"))
1668 ;; Adjust vendored dependency to explicitly use rustix with libc
1669 ;; backend.
1670 (substitute* '("vendor/tempfile-3.14.0/Cargo.toml"
1671 "vendor/tempfile-3.16.0/Cargo.toml"
1672 "vendor/tempfile-3.19.1/Cargo.toml"
1673 "vendor/tempfile-3.20.0/Cargo.toml"
1674 "vendor/tempfile-3.21.0/Cargo.toml")
1675 (("features = \\[\"fs\"" all)
1676 (string-append all ", \"use-libc\"")))))))
1677 (arguments
1678 (substitute-keyword-arguments (package-arguments base-rust)
1679 ((#:phases phases)
1680 `(modify-phases ,phases
1681 ;; Adjust the stack size so we don't error out on some machines.
1682 #;
1683 (add-before 'build 'set-stack-size
1684 (lambda _
1685 (setenv "RUST_MIN_STACK" "16777216")))
1686 (replace 'install
1687 ;; Rust 1.91+ outputs to stage2 instead of stage1.
1688 ;; Cannot use './x.py install' as it runs generate-copyright
1689 ;; which fails due to patched cargo checksums.
1690 (lambda* (#:key outputs #:allow-other-keys)
1691 (let* ((out (assoc-ref outputs "out"))
1692 (cargo-out (assoc-ref outputs "cargo"))
1693 (build (string-append "build/"
1694 ,(platform-rust-target
1695 (lookup-platform-by-target-or-system
1696 (or (%current-target-system)
1697 (%current-system)))))))
1698 (with-directory-excursion build
1699 (install-file "stage2/bin/rustc"
1700 (string-append out "/bin"))
1701 (install-file "stage2-tools-bin/cargo"
1702 (string-append cargo-out "/bin"))
1703 (for-each delete-file
1704 (find-files "stage2/lib" "\\.rmeta$"))
1705 (for-each delete-file
1706 (find-files "stage2/lib/rustlib"
1707 "^librustc_driver.*\\.so$"))
1708 (copy-recursively "stage2/lib"
1709 (string-append out "/lib")))))))))))))
1710
1619(define (make-ignore-test-list strs) 1711(define (make-ignore-test-list strs)
1620 "Function to make creating a list to ignore tests a bit easier." 1712 "Function to make creating a list to ignore tests a bit easier."
1621 (map (lambda (str) 1713 (map (lambda (str)