commit: 665016d93e30a6a0411fbc508c1b73ff475b4c0c Author: Azamat H. Hackimov <azamat.hackimov <AT> gmail <DOT> com> AuthorDate: Mon Sep 8 07:27:07 2025 +0000 Commit: Sam James <sam <AT> gentoo <DOT> org> CommitDate: Mon Sep 22 22:11:29 2025 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=665016d9
dev-build/corrosion: new package, add 0.5.2 Closes: https://bugs.gentoo.org/911819 Signed-off-by: Azamat H. Hackimov <azamat.hackimov <AT> gmail.com> Part-of: https://github.com/gentoo/gentoo/pull/43712 Signed-off-by: Sam James <sam <AT> gentoo.org> dev-build/corrosion/Manifest | 2 + dev-build/corrosion/corrosion-0.5.2.ebuild | 41 ++++++++++++++++++++ .../files/corrosion-0.5.2_fix_tests.patch | 44 ++++++++++++++++++++++ dev-build/corrosion/metadata.xml | 15 ++++++++ 4 files changed, 102 insertions(+) diff --git a/dev-build/corrosion/Manifest b/dev-build/corrosion/Manifest new file mode 100644 index 000000000000..0c12e29dc4f4 --- /dev/null +++ b/dev-build/corrosion/Manifest @@ -0,0 +1,2 @@ +DIST cc-1.0.73.crate 57880 BLAKE2B be8d7a25a54afdd759844e76aec61526fc2bd5ca09480e6cdd3bdcf27e5f9d3a88dc16cbcbf54cd021470a7cc521e1ad468116c112bbd30752bac0d5486939ac SHA512 980f012b90c6410144f6de4995048337e09214f19603076db6d4edb88e9ef9ac9e8c6e25569f66c2be3a47e99298f5886dafc102e1a9122316179aa26bc1c985 +DIST corrosion-0.5.2.tar.gz 91872 BLAKE2B bdf6de522cf7d3b220113f7533201d72dff7bab5adb95c4b9e33ec2638429c38e1541bd9a0a1313faa9fb398c05e8447c6bc871a57de883b7a5135f850c39770 SHA512 2510d4d0484fc12a6b429244b283515fda650b52ea74fbfdcc141298b452b20e2bef800b8f8a573a2bf509f4147ecb2d68e795cbd86cc8edd092f57ccff8b86b diff --git a/dev-build/corrosion/corrosion-0.5.2.ebuild b/dev-build/corrosion/corrosion-0.5.2.ebuild new file mode 100644 index 000000000000..05842f0dace9 --- /dev/null +++ b/dev-build/corrosion/corrosion-0.5.2.ebuild @@ -0,0 +1,41 @@ +# Copyright 2025 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +CRATES=" + [email protected] +" + +RUST_MIN_VERSION="1.77.4" + +inherit cargo cmake + +DESCRIPTION="Marrying Rust and CMake - Easy Rust and C/C++ Integration!" +HOMEPAGE="https://github.com/corrosion-rs/corrosion" +SRC_URI=" + https://github.com/corrosion-rs/corrosion/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz + test? ( ${CARGO_CRATE_URIS} ) +" + +LICENSE="MIT" +SLOT="0" +KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc ~ppc64 ~riscv ~x86" +IUSE="test" +RESTRICT="!test? ( test )" + +BDEPEND=" + test? ( dev-util/cbindgen ) + >=dev-build/cmake-3.22 +" + +PATCHES=( + "${FILESDIR}/corrosion-0.5.2_fix_tests.patch" +) + +src_configure() { + local mycmakeargs=( + -DCORROSION_BUILD_TESTS=$(usex test) + ) + cmake_src_configure +} diff --git a/dev-build/corrosion/files/corrosion-0.5.2_fix_tests.patch b/dev-build/corrosion/files/corrosion-0.5.2_fix_tests.patch new file mode 100644 index 000000000000..fce435dd307b --- /dev/null +++ b/dev-build/corrosion/files/corrosion-0.5.2_fix_tests.patch @@ -0,0 +1,44 @@ +From https://github.com/corrosion-rs/corrosion/pull/605 +From: Jonathan Schwender <[email protected]> +Date: Sun, 12 Jan 2025 10:44:14 +0100 +Subject: [PATCH 1/2] Disable rustup_proxy test if rustup is not installed + +The test only makes sense if rustc / cargo are behind a rustup proxy. +If rustup is not installed, we can +just disable the test. +--- a/test/find_rust/CMakeLists.txt ++++ b/test/find_rust/CMakeLists.txt +@@ -1,3 +1,7 @@ + corrosion_tests_add_test(find_rust "") + corrosion_tests_add_test(rustup_proxy "") + ++find_program(rustup rustup) ++if(NOT rustup) ++ set_tests_properties(rustup_proxy_build rustup_proxy_cleanup PROPERTIES DISABLED 1) ++endif() + +From 1127f5bc08491a1dccbb979f92f78a9a7264bba9 Mon Sep 17 00:00:00 2001 +From: Jonathan Schwender <[email protected]> +Date: Sun, 12 Jan 2025 11:05:52 +0100 +Subject: [PATCH 2/2] tests: Improve parse_target_triple warning regex. + +Improve the regex, to ensure it only matches against our specific +warning. This should hopefully make it more robust, since +new CMake versions can always introduce new warnings for our +existing code. +--- a/test/parse_target_triple/CMakeLists.txt ++++ b/test/parse_target_triple/CMakeLists.txt +@@ -2,9 +2,9 @@ corrosion_tests_add_test(parse_target_triple "") + corrosion_tests_add_test(parse_target_triple_should_fail "") + + set_tests_properties("parse_target_triple_build" PROPERTIES FAIL_REGULAR_EXPRESSION +- "CMake Warning" ++ "CMake Warning at [^\r\n]*FindRust\.cmake:.*(\r)?\n[ \t]*Failed to parse target-triple `" + ) + + set_tests_properties("parse_target_triple_should_fail_build" PROPERTIES PASS_REGULAR_EXPRESSION +- "CMake Warning" +- ) +\ No newline at end of file ++ "CMake Warning at [^\r\n]*FindRust\.cmake:.*(\r)?\n[ \t]*Failed to parse target-triple `" ++ ) diff --git a/dev-build/corrosion/metadata.xml b/dev-build/corrosion/metadata.xml new file mode 100644 index 000000000000..ca2565960f28 --- /dev/null +++ b/dev-build/corrosion/metadata.xml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="person"> + <email>[email protected]</email> + <name>Azamat H. Hackimov</name> + </maintainer> + <maintainer type="project" proxied="proxy"> + <email>[email protected]</email> + <name>Proxy Maintainers</name> + </maintainer> + <upstream> + <remote-id type="github">corrosion-rs/corrosion</remote-id> + </upstream> +</pkgmetadata>
