summaryrefslogtreecommitdiff
path: root/gnu/packages
diff options
context:
space:
mode:
authorEfraim Flashner <efraim@flashner.co.il>2024-12-05 13:20:18 +0200
committerEfraim Flashner <efraim@flashner.co.il>2024-12-05 13:20:18 +0200
commitbe53521d4cc9fb1adbbb97f00ae7a809710b4c79 (patch)
tree7f0b2bc691aa4807540dba7f822dbf54ee61f690 /gnu/packages
parent76bc375080486254456cec6d4b4baab01aa67ca1 (diff)
gnu: make-rust-sysroot: Accept other mingw targets.
* gnu/packages/rust.scm (make-rust-sysroot/implementation)[arguments]: Adjust the custom 'patch-for-mingw phase to generate the name of the mingw input package based on the target architecture. [inputs, native-inputs]: Use make-mingw-w64 to choose the mingw package for the target. Change-Id: I48638095a504675753e65fdb6f0286c31cebde66
Diffstat (limited to 'gnu/packages')
-rw-r--r--gnu/packages/rust.scm47
1 files changed, 23 insertions, 24 deletions
diff --git a/gnu/packages/rust.scm b/gnu/packages/rust.scm
index e6efd094e9f..345d61dbf54 100644
--- a/gnu/packages/rust.scm
+++ b/gnu/packages/rust.scm
@@ -1487,24 +1487,23 @@ exec -a \"$0\" \"~a\" \"$@\""
1487 #$@(if (target-mingw? target) 1487 #$@(if (target-mingw? target)
1488 `((add-after 'set-env 'patch-for-mingw 1488 `((add-after 'set-env 'patch-for-mingw
1489 (lambda* (#:key inputs #:allow-other-keys) 1489 (lambda* (#:key inputs #:allow-other-keys)
1490 (setenv "LIBRARY_PATH" 1490 (let* ((arch ,(string-take target
1491 (string-join 1491 (string-index target #\-)))
1492 (delete 1492 (mingw (assoc-ref inputs
1493 (string-append 1493 (string-append "mingw-w64-" arch
1494 (or (assoc-ref inputs "mingw-w64-i686-winpthreads") 1494 "-winpthreads"))))
1495 (assoc-ref inputs "mingw-w64-x86_64-winpthreads")) 1495 (setenv "LIBRARY_PATH"
1496 "/lib") 1496 (string-join
1497 (string-split (getenv "LIBRARY_PATH") #\:)) 1497 (delete
1498 ":")) 1498 (string-append mingw "/lib")
1499 (setenv "CPLUS_INCLUDE_PATH" 1499 (string-split (getenv "LIBRARY_PATH") #\:))
1500 (string-join 1500 ":"))
1501 (delete 1501 (setenv "CPLUS_INCLUDE_PATH"
1502 (string-append 1502 (string-join
1503 (or (assoc-ref inputs "mingw-w64-i686-winpthreads") 1503 (delete
1504 (assoc-ref inputs "mingw-w64-x86_64-winpthreads")) 1504 (string-append mingw "/include")
1505 "/include") 1505 (string-split (getenv "CPLUS_INCLUDE_PATH") #\:))
1506 (string-split (getenv "CPLUS_INCLUDE_PATH") #\:)) 1506 ":")))
1507 ":"))
1508 ;; When building a rust-sysroot this crate is only used for 1507 ;; When building a rust-sysroot this crate is only used for
1509 ;; the rust-installer. 1508 ;; the rust-installer.
1510 (substitute* '("vendor/num_cpus-1.13.0/src/linux.rs" 1509 (substitute* '("vendor/num_cpus-1.13.0/src/linux.rs"
@@ -1610,9 +1609,9 @@ ar = \"" (search-input-file inputs (string-append "/bin/" #$(ar-for-target targe
1610 (if (target-mingw? target) 1609 (if (target-mingw? target)
1611 (modify-inputs (package-propagated-inputs base-rust) 1610 (modify-inputs (package-propagated-inputs base-rust)
1612 (prepend 1611 (prepend
1613 (if (string=? "i686-w64-mingw32" target) 1612 (make-mingw-w64
1614 mingw-w64-i686-winpthreads 1613 (string-take target (string-index target #\-))
1615 mingw-w64-x86_64-winpthreads))) 1614 #:with-winpthreads? #t)))
1616 (package-propagated-inputs base-rust))) 1615 (package-propagated-inputs base-rust)))
1617 (native-inputs 1616 (native-inputs
1618 (if (target-mingw? target) 1617 (if (target-mingw? target)
@@ -1620,9 +1619,9 @@ ar = \"" (search-input-file inputs (string-append "/bin/" #$(ar-for-target targe
1620 (prepend (cross-gcc target 1619 (prepend (cross-gcc target
1621 #:libc (cross-libc target)) 1620 #:libc (cross-libc target))
1622 (cross-binutils target) 1621 (cross-binutils target)
1623 (if (string=? "i686-w64-mingw32" target) 1622 (make-mingw-w64
1624 mingw-w64-i686-winpthreads 1623 (string-take target (string-index target #\-))
1625 mingw-w64-x86_64-winpthreads))) 1624 #:with-winpthreads? #t)))
1626 (modify-inputs (package-native-inputs base-rust) 1625 (modify-inputs (package-native-inputs base-rust)
1627 (prepend (cross-gcc target 1626 (prepend (cross-gcc target
1628 #:libc (cross-libc target)) 1627 #:libc (cross-libc target))