diff --git a/srcpkgs/rustup/patches/0001-Symlink-rustup-instead-of-copying-it.patch b/srcpkgs/rustup/patches/0001-Symlink-rustup-instead-of-copying-it.patch new file mode 100644 index 00000000000..7f57e6fe0f1 --- /dev/null +++ b/srcpkgs/rustup/patches/0001-Symlink-rustup-instead-of-copying-it.patch @@ -0,0 +1,45 @@ +From e512f8222fddecf23552ed490f71cc3c444abc53 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Jan=20Christian=20Gr=C3=BCnhage?= + +Date: Tue, 12 Jul 2022 08:16:08 +0200 +Subject: [PATCH] Symlink rustup instead of copying it + +To make sure that we can update rustup using xbps, we need to symlink +rustup into $CARGO_HOME/bin instead of copying it. + +Upstream doesn't want the patch as it is right now. +--- + src/cli/self_update.rs | 3 +-- + src/utils/utils.rs | 2 +- + 2 files changed, 2 insertions(+), 3 deletions(-) + +diff --git a/src/cli/self_update.rs b/src/cli/self_update.rs +index a4c00d57..82a4d67a 100644 +--- a/src/cli/self_update.rs ++++ b/src/cli/self_update.rs +@@ -729,8 +729,7 @@ fn install_bins() -> Result<()> { + if rustup_path.exists() { + utils::remove_file("rustup-bin", &rustup_path)?; + } +- utils::copy_file(&this_exe_path, &rustup_path)?; +- utils::make_executable(&rustup_path)?; ++ utils::symlink_file(&this_exe_path, &rustup_path)?; + install_proxies() + } + +diff --git a/src/utils/utils.rs b/src/utils/utils.rs +index 0362372b..9e5a5fe2 100644 +--- a/src/utils/utils.rs ++++ b/src/utils/utils.rs +@@ -306,7 +306,7 @@ pub fn hardlink_file(src: &Path, dest: &Path) -> Result<()> { + } + + #[cfg(unix)] +-fn symlink_file(src: &Path, dest: &Path) -> Result<()> { ++pub(crate) fn symlink_file(src: &Path, dest: &Path) -> Result<()> { + std::os::unix::fs::symlink(src, dest).with_context(|| RustupError::LinkingFile { + src: PathBuf::from(src), + dest: PathBuf::from(dest), +-- +2.37.0 + diff --git a/srcpkgs/rustup/patches/dont-copy-rustup-bin.patch b/srcpkgs/rustup/patches/dont-copy-rustup-bin.patch deleted file mode 100644 index d8289b90d69..00000000000 --- a/srcpkgs/rustup/patches/dont-copy-rustup-bin.patch +++ /dev/null @@ -1,15 +0,0 @@ -Upstream: No, not upstreamable like this -Reason: We want the rustup binary in $CARGO_HOME/bin to be of the -same version as the one we distribute in this rustup package. ---- a/src/cli/self_update.rs 2019-05-27 16:17:21.432715136 +0200 -+++ b/src/cli/self_update.rs 2019-05-27 16:18:56.537718683 +0200 -@@ -619,8 +619,7 @@ - if rustup_path.exists() { - utils::remove_file("rustup-bin", &rustup_path)?; - } -- utils::copy_file(&this_exe_path, &rustup_path)?; -- utils::make_executable(&rustup_path)?; -+ utils::symlink_file(&this_exe_path, &rustup_path)?; - install_proxies() - } - diff --git a/srcpkgs/rustup/template b/srcpkgs/rustup/template index b55cbe09d86..da9d2751ba4 100644 --- a/srcpkgs/rustup/template +++ b/srcpkgs/rustup/template @@ -1,6 +1,6 @@ # Template file for 'rustup' pkgname=rustup -version=1.24.3 +version=1.25.1 revision=1 # rustup doesn't recognize this target archs="~armv*-musl" @@ -15,7 +15,7 @@ maintainer="Jan Christian Grünhage " license="Apache-2.0, MIT" homepage="https://www.rustup.rs" distfiles="https://github.com/rust-lang/${pkgname}/archive/${version}.tar.gz" -checksum=24a8cede4ccbbf45ab7b8de141d92f47d1881bb546b3b9180d5a51dc0622d0f6 +checksum=4d062c77b08309bd212f22dd7da1957c1882509c478e57762f34ec4fb2884c9a case "$XBPS_TARGET_MACHINE" in x86_64*|i686*|arm*|aarch64*)