diff --git a/dev-build/corrosion/corrosion-0.6.1-r1.ebuild b/dev-build/corrosion/corrosion-0.6.1-r1.ebuild new file mode 100644 index 0000000000000..999ac7255b43a --- /dev/null +++ b/dev-build/corrosion/corrosion-0.6.1-r1.ebuild @@ -0,0 +1,62 @@ +# Copyright 2025-2026 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +CRATES=" + bitflags@1.3.2 + cc@1.0.73 +" + +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.6.1_cxxbridge-cmd_no_locked.patch" +) + +CMAKE_SKIP_TESTS=( + # requires extensive rust-src cargo packages + custom_target_build + custom_target_run_test-exe + custom_target_run_rust-bin + install_lib_build + install_lib_run_main-static + install_lib_run_main-shared + # error[E0425]: cannot find function `print_line` in this scope + cargo_config_rustflags_build + # must be run but gets skipped sometimes? + cargo_config_rustflags_run_cargo_config_rustflags +) + +src_configure() { + local mycmakeargs=( + -DCORROSION_BUILD_TESTS=$(usex test) + ) + cmake_src_configure +} + +src_test() { + # Some RUSTFLAGS like disabling debuginfo can mess with the tests + local -x RUSTFLAGS= + cmake_src_test +} diff --git a/dev-build/corrosion/files/corrosion-0.6.1_cxxbridge-cmd_no_locked.patch b/dev-build/corrosion/files/corrosion-0.6.1_cxxbridge-cmd_no_locked.patch new file mode 100644 index 0000000000000..057aa5376c39c --- /dev/null +++ b/dev-build/corrosion/files/corrosion-0.6.1_cxxbridge-cmd_no_locked.patch @@ -0,0 +1,20 @@ +From https://github.com/corrosion-rs/corrosion/commit/4b954fa5a238d78a80aacf85a667f4b426926e71 +From: Jonathan Schwender +Date: Sat, 16 May 2026 16:25:49 +0200 +Subject: [PATCH] Install cxxbridge-cmd without --locked + +cxxbridge-cmd does not have a lockfile, +and adding --locked caused issues for users +using offline mode. + +Fixes #672 +--- a/cmake/Corrosion.cmake ++++ b/cmake/Corrosion.cmake +@@ -1862,7 +1862,6 @@ function(corrosion_add_cxxbridge cxx_target) + $CACHE{CORROSION_TOOLS_CARGO} install + cxxbridge-cmd + --version "${cxx_required_version}" +- --locked + --root "${CMAKE_BINARY_DIR}/corrosion/cxxbridge_v${cxx_required_version}" + --quiet + # todo: use --target-dir to potentially reuse artifacts