From ce7c7fa35d02aaf670eca4842cd90078b6223bee Mon Sep 17 00:00:00 2001 From: Andreas Baumann Date: Thu, 4 Feb 2021 10:23:04 +0100 Subject: extra/rust: some fixes around rust-musl, nproc and architecture patching --- extra/rust/PKGBUILD | 37 +++++++++++++++++++++---------------- extra/rust/config.toml.patch | 19 ++++++++++++++++--- 2 files changed, 37 insertions(+), 19 deletions(-) diff --git a/extra/rust/PKGBUILD b/extra/rust/PKGBUILD index 207e3ca7..736d05a3 100644 --- a/extra/rust/PKGBUILD +++ b/extra/rust/PKGBUILD @@ -6,7 +6,7 @@ # see https://github.com/rust-lang/rust/issues/60294 source+=(config.toml.patch) -sha256sums+=('c6d2fe4d0fab22194029a926e7c4efe55546a3dfbc85328cabba44e44126129f') +sha256sums+=('41cb009565b592bcd73dbfbfa53e4462570c85de58b225893e8f1ff25d640a04') eval "$( declare -f prepare | \ @@ -19,7 +19,7 @@ eval "$( eval "$( declare -f build | \ sed ' - s/-j"$(nproc)"/-j1/ + s/-j "$(nproc)"/-j1/ ' )" @@ -36,33 +36,38 @@ fi # Don't move lib32 support into rust32-lib, we are on 32-bit in the end # and don't draw a symlink to 64-bit libraries (but to 32-bit instead) - -pkgname=( - $( - printf '%s\n' "${pkgname[@]}" | \ - grep -v '^lib32-rust-libs' - ) -) - -# remove 32-bit stuff (shouldn't that be removed automatically?) -makedepends=(${makedepends[@]//lib32-gcc-libs/}) +# move rust-musl though, also patch architecture for musl accordingly +eval "$( + declare -f build | \ + sed ' + /mv.*i686-unknown-linux-gnu.*/d + s/x86_64-unknown-linux-musl/i686-unknown-linux-musl/ + ' +)" eval "$( declare -f package_rust | \ sed ' - /mv.*i686-unknown-linux-gnu.*/d /ln /s/x86_64-unknown-linux-gnu/i686-unknown-linux-gnu/g ' )" eval "$( - declare -f build | \ + declare -f package_rust-musl | \ sed ' - /mv.*i686-unknown-linux-gnu.*/d - /ln /s/x86_64-unknown-linux-gnu/i686-unknown-linux-gnu/g + s/x86_64-unknown-linux-musl/i686-unknown-linux-musl/ ' )" +# remove 32-bit stuff (shouldn't that be removed automatically?) +pkgname=( + $( + printf '%s\n' "${pkgname[@]}" | \ + grep -v '^lib32-rust-libs' + ) +) +makedepends=(${makedepends[@]//lib32-gcc-libs/}) + # Enable on demand, if your previous rust is broken use previous version # from build-support (this is preferable to using rust-bin below, but # requires all intermediate versions of rust to be built diff --git a/extra/rust/config.toml.patch b/extra/rust/config.toml.patch index 3fd6f43b..1aeb55c1 100644 --- a/extra/rust/config.toml.patch +++ b/extra/rust/config.toml.patch @@ -1,7 +1,16 @@ diff -rauN a/config.toml b/config.toml ---- a/config.toml 2020-08-01 10:50:30.352304826 +0200 -+++ b/config.toml 2020-08-01 10:51:38.355820332 +0200 -@@ -22,11 +22,11 @@ +--- a/config.toml 2021-02-04 07:47:59.117133704 +0100 ++++ b/config.toml 2021-02-04 07:50:40.203582394 +0100 +@@ -2,7 +2,7 @@ + link-shared = true + + [build] +-target = ["x86_64-unknown-linux-gnu", "i686-unknown-linux-gnu", "x86_64-unknown-linux-musl"] ++target = ["i686-unknown-linux-gnu", "i686-unknown-linux-musl"] + tools = ["cargo", "rls", "clippy", "miri", "rustfmt", "analysis", "src"] + cargo = "/usr/bin/cargo" + rustc = "/usr/bin/rustc" +@@ -22,14 +22,14 @@ # https://github.com/rust-lang/rust/issues/54872 codegen-units-std = 1 @@ -15,3 +24,7 @@ diff -rauN a/config.toml b/config.toml -[target.x86_64-unknown-linux-gnu] +[target.i686-unknown-linux-gnu] llvm-config = "/usr/bin/llvm-config" + +-[target.x86_64-unknown-linux-musl] ++[target.i686-unknown-linux-musl] + musl-root = "/usr/lib/musl" -- cgit v1.2.3-70-g09d2