void-packages/srcpkgs/rust/patches/0003-move-debugger-scripts-...

60 lines
2.5 KiB
Diff

From 8938b002edbec432be46de7b6f1b9d0a6912873a Mon Sep 17 00:00:00 2001
From: Daniel Kolesa <daniel@octaforge.org>
Date: Mon, 20 Dec 2021 00:45:35 +0100
Subject: [PATCH 03/15] move debugger scripts to /usr/share/rust
diff --git a/src/bootstrap/src/core/build_steps/dist.rs b/src/bootstrap/src/core/build_steps/dist.rs
index c485481b9..b59aaa4fa 100644
--- a/src/bootstrap/src/core/build_steps/dist.rs
+++ b/src/bootstrap/src/core/build_steps/dist.rs
@@ -519,7 +519,7 @@ impl Step for DebuggerScripts {
fn run(self, builder: &Builder<'_>) {
let host = self.host;
let sysroot = self.sysroot;
- let dst = sysroot.join("lib/rustlib/etc");
+ let dst = sysroot.join("share/rust");
t!(fs::create_dir_all(&dst));
let cp_debugger_script = |file: &str| {
builder.install(&builder.src.join("src/etc/").join(file), &dst, 0o644);
diff --git a/src/etc/rust-gdb b/src/etc/rust-gdb
index 9abed30ea..4c7f953ed 100755
--- a/src/etc/rust-gdb
+++ b/src/etc/rust-gdb
@@ -12,7 +12,7 @@ fi
# Find out where the pretty printer Python module is
RUSTC_SYSROOT="$("$RUSTC" --print=sysroot)"
-GDB_PYTHON_MODULE_DIRECTORY="$RUSTC_SYSROOT/lib/rustlib/etc"
+GDB_PYTHON_MODULE_DIRECTORY="$RUSTC_SYSROOT/share/rust"
# Get the commit hash for path remapping
RUSTC_COMMIT_HASH="$("$RUSTC" -vV | sed -n 's/commit-hash: \([a-zA-Z0-9_]*\)/\1/p')"
diff --git a/src/etc/rust-gdbgui b/src/etc/rust-gdbgui
index 471810cbb..ba4e27241 100755
--- a/src/etc/rust-gdbgui
+++ b/src/etc/rust-gdbgui
@@ -41,7 +41,7 @@ fi
# Find out where the pretty printer Python module is
RUSTC_SYSROOT="$("$RUSTC" --print=sysroot)"
-GDB_PYTHON_MODULE_DIRECTORY="$RUSTC_SYSROOT/lib/rustlib/etc"
+GDB_PYTHON_MODULE_DIRECTORY="$RUSTC_SYSROOT/share/rust"
# Get the commit hash for path remapping
RUSTC_COMMIT_HASH="$("$RUSTC" -vV | sed -n 's/commit-hash: \([a-zA-Z0-9_]*\)/\1/p')"
diff --git a/src/etc/rust-lldb b/src/etc/rust-lldb
index bce72f1ba..8abb01245 100755
--- a/src/etc/rust-lldb
+++ b/src/etc/rust-lldb
@@ -30,8 +30,8 @@ EOF
fi
fi
-script_import="command script import \"$RUSTC_SYSROOT/lib/rustlib/etc/lldb_lookup.py\""
-commands_file="$RUSTC_SYSROOT/lib/rustlib/etc/lldb_commands"
+script_import="command script import \"$RUSTC_SYSROOT/share/rust/lldb_lookup.py\""
+commands_file="$RUSTC_SYSROOT/share/rust/lldb_commands"
# Call LLDB with the commands added to the argument list
exec "$lldb" --one-line-before-file "$script_import" --source-before-file "$commands_file" "$@"