dev-build/corrosion: fix regression with cxxbridge-cmd

Closes: https://bugs.gentoo.org/975121
Signed-off-by: Azamat H. Hackimov <azamat.hackimov@gmail.com>
Part-of: https://github.com/gentoo/gentoo/pull/46266
Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
Azamat H. Hackimov
2026-05-16 19:35:59 +03:00
committed by Sam James
parent ec94a30948
commit 8406c57765
2 changed files with 82 additions and 0 deletions

View File

@@ -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
}

View File

@@ -0,0 +1,20 @@
From https://github.com/corrosion-rs/corrosion/commit/4b954fa5a238d78a80aacf85a667f4b426926e71
From: Jonathan Schwender <schwenderjonathan@gmail.com>
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