diff options
Diffstat (limited to 'gnu/packages')
| -rw-r--r-- | gnu/packages/cmake.scm | 4 | ||||
| -rw-r--r-- | gnu/packages/patches/corrosion-honor-CARGO_BUILD_TARGET.patch | 26 |
2 files changed, 29 insertions, 1 deletions
diff --git a/gnu/packages/cmake.scm b/gnu/packages/cmake.scm index b269365d5a3..cbca15244a4 100644 --- a/gnu/packages/cmake.scm +++ b/gnu/packages/cmake.scm @@ -508,7 +508,9 @@ format (either JSON or XML). (commit (string-append "v" version)))) (file-name (git-file-name name version)) (sha256 - (base32 "1bylfjji4yw88r00hgb69nfl9lz73bhc7q3n64myif4alr4b8ypx")))) + (base32 "1bylfjji4yw88r00hgb69nfl9lz73bhc7q3n64myif4alr4b8ypx")) + (patches + (search-patches "corrosion-honor-CARGO_BUILD_TARGET.patch")))) (build-system cmake-build-system) (arguments (list diff --git a/gnu/packages/patches/corrosion-honor-CARGO_BUILD_TARGET.patch b/gnu/packages/patches/corrosion-honor-CARGO_BUILD_TARGET.patch new file mode 100644 index 00000000000..ecd2b3a9d22 --- /dev/null +++ b/gnu/packages/patches/corrosion-honor-CARGO_BUILD_TARGET.patch @@ -0,0 +1,26 @@ +From 0a6f23a404d1b972b1c5f0cf1d38500276f3c9d1 Mon Sep 17 00:00:00 2001 +From: Hilton Chain <hako@ultrarare.space> +Date: Tue, 22 Apr 2025 19:43:00 +0800 +Subject: [PATCH] Support Cargo target from environment variable. + +--- + cmake/FindRust.cmake | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/cmake/FindRust.cmake b/cmake/FindRust.cmake +index fccfac3..e888149 100644 +--- a/cmake/FindRust.cmake ++++ b/cmake/FindRust.cmake +@@ -734,6 +734,9 @@ if (NOT Rust_CARGO_TARGET_CACHED) + set(Rust_CARGO_TARGET_CACHED "${_RUST_OHOS_TARGET}" CACHE STRING "Target triple") + endif() + endif() ++ if(DEFINED ENV{CARGO_BUILD_TARGET}) ++ set(Rust_CARGO_TARGET_CACHED "$ENV{CARGO_BUILD_TARGET}") ++ endif() + # Fallback to the default host target + if(NOT Rust_CARGO_TARGET_CACHED) + if(CMAKE_CROSSCOMPILING) +-- +2.49.0 + |
