mirror of
https://codeberg.org/guix/guix.git
synced 2025-10-02 02:15:12 +00:00
gnu: corrosion: Honor CARGO_BUILD_TARGET.
This change integrates Rust cross-compilation support from Guix. * gnu/packages/patches/corrosion-honor-CARGO_BUILD_TARGET.patch: New file. * gnu/local.mk (dist_patch_DATA): Register it. * gnu/packages/cmake.scm (corrosion)[source]: Apply it. Change-Id: I319f07f49e390ed84286f35aaa0bd3cad2ad70db
This commit is contained in:
parent
8605db19fd
commit
141d39db98
3 changed files with 30 additions and 1 deletions
|
@ -1157,6 +1157,7 @@ dist_patch_DATA = \
|
||||||
%D%/packages/patches/corefx-mono-5.4.0-patches.patch \
|
%D%/packages/patches/corefx-mono-5.4.0-patches.patch \
|
||||||
%D%/packages/patches/corefx-mono-pre-5.8.0-patches.patch \
|
%D%/packages/patches/corefx-mono-pre-5.8.0-patches.patch \
|
||||||
%D%/packages/patches/coreutils-gnulib-tests.patch \
|
%D%/packages/patches/coreutils-gnulib-tests.patch \
|
||||||
|
%D%/packages/patches/corrosion-honor-CARGO_BUILD_TARGET.patch \
|
||||||
%D%/packages/patches/cppcheck-fix-basedir-test.patch \
|
%D%/packages/patches/cppcheck-fix-basedir-test.patch \
|
||||||
%D%/packages/patches/cppdap-add-CPPDAP_USE_EXTERNAL_GTEST_PACKAGE.patch\
|
%D%/packages/patches/cppdap-add-CPPDAP_USE_EXTERNAL_GTEST_PACKAGE.patch\
|
||||||
%D%/packages/patches/cpulimit-with-glib-2.32.patch \
|
%D%/packages/patches/cpulimit-with-glib-2.32.patch \
|
||||||
|
|
|
@ -508,7 +508,9 @@ format (either JSON or XML).
|
||||||
(commit (string-append "v" version))))
|
(commit (string-append "v" version))))
|
||||||
(file-name (git-file-name name version))
|
(file-name (git-file-name name version))
|
||||||
(sha256
|
(sha256
|
||||||
(base32 "1bylfjji4yw88r00hgb69nfl9lz73bhc7q3n64myif4alr4b8ypx"))))
|
(base32 "1bylfjji4yw88r00hgb69nfl9lz73bhc7q3n64myif4alr4b8ypx"))
|
||||||
|
(patches
|
||||||
|
(search-patches "corrosion-honor-CARGO_BUILD_TARGET.patch"))))
|
||||||
(build-system cmake-build-system)
|
(build-system cmake-build-system)
|
||||||
(arguments
|
(arguments
|
||||||
(list
|
(list
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue