aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakuya Wakazono <pastalian46@gmail.com>2024-08-10 12:32:05 +0900
committerTakuya Wakazono <pastalian46@gmail.com>2024-08-10 12:37:09 +0900
commit45bce1db40d7bf62bb59f250982b346f87b16e97 (patch)
tree664b804f6c8f375a037958987f091212b609e57d /dev-util
parentmail-client/betterbird-bin: add 115.14.0 (diff)
downloadguru-45bce1db40d7bf62bb59f250982b346f87b16e97.tar.gz
guru-45bce1db40d7bf62bb59f250982b346f87b16e97.tar.bz2
guru-45bce1db40d7bf62bb59f250982b346f87b16e97.zip
dev-util/rust-script: fix tests with new cargo.eclass
Signed-off-by: Takuya Wakazono <pastalian46@gmail.com>
Diffstat (limited to 'dev-util')
-rw-r--r--dev-util/rust-script/files/rust-script-0.34.0-fix-test.patch20
-rw-r--r--dev-util/rust-script/rust-script-0.34.0.ebuild13
2 files changed, 26 insertions, 7 deletions
diff --git a/dev-util/rust-script/files/rust-script-0.34.0-fix-test.patch b/dev-util/rust-script/files/rust-script-0.34.0-fix-test.patch
new file mode 100644
index 000000000..b7a68add0
--- /dev/null
+++ b/dev-util/rust-script/files/rust-script-0.34.0-fix-test.patch
@@ -0,0 +1,20 @@
+- cargo_target_dir helper contains {debug,release}
+- tests does not work with CARGO_BUILD_TARGET defined
+https://github.com/fornwall/rust-script/issues/85
+--- a/tests/util/mod.rs
++++ b/tests/util/mod.rs
+@@ -15,12 +15,13 @@ macro_rules! rust_script {
+ let out = {
+ let target_dir = ::std::env::var("CARGO_TARGET_DIR")
+ .unwrap_or_else(|_| String::from("target"));
+- let mut cmd = Command::new(format!("{}/debug/rust-script", target_dir));
++ let mut cmd = Command::new(format!("{}/rust-script", target_dir));
+ $(
+ cmd.arg($args);
+ )*
+
+ cmd.env_remove("CARGO_TARGET_DIR");
++ cmd.env_remove("CARGO_BUILD_TARGET");
+ $(cmd.env(stringify!($env_k), $env_v);)*
+
+ cmd_str = format!("{:?}", cmd);
diff --git a/dev-util/rust-script/rust-script-0.34.0.ebuild b/dev-util/rust-script/rust-script-0.34.0.ebuild
index f668ea5bd..82bd8e756 100644
--- a/dev-util/rust-script/rust-script-0.34.0.ebuild
+++ b/dev-util/rust-script/rust-script-0.34.0.ebuild
@@ -116,13 +116,12 @@ KEYWORDS="~amd64"
QA_FLAGS_IGNORED="usr/bin/.*"
+PATCHES=(
+ # tests does not work with CARGO_BUILD_TARGET defined
+ "${FILESDIR}/${P}-fix-test.patch"
+)
+
src_prepare() {
default
-
- use debug || sed -i "s|/debug/|/release/|" tests/util/mod.rs || die
-
- # cargo.eclass uses the old config and deprecation warning breaks the test.
- if [[ ! -e "${ECARGO_HOME}/config.toml" ]]; then
- ln -s "${ECARGO_HOME}/config" "${ECARGO_HOME}/config.toml" || die
- fi
+ sed -i "s|\"target\"|\"$(cargo_target_dir)\"|" tests/util/mod.rs || die
}