Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rust: drop 32-bit #23350

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 16 additions & 33 deletions mingw-w64-rust/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,13 @@ rust_dist_server=https://static.rust-lang.org/dist
_realname=rust
pkgbase=mingw-w64-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}"
$([[ ${CARCH} == i686 ]] || echo \
"${MINGW_PACKAGE_PREFIX}-rust-wasm" \
"${MINGW_PACKAGE_PREFIX}-rust-src"))
"${MINGW_PACKAGE_PREFIX}-rust-wasm"
"${MINGW_PACKAGE_PREFIX}-rust-src")
pkgver=1.85.0
pkgrel=1
pkgrel=2
pkgdesc="Systems programming language focused on safety, speed and concurrency (mingw-w64)"
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clangarm64')
mingw_arch=('mingw64' 'ucrt64' 'clang64' 'clangarm64')
url="https://www.rust-lang.org/"
msys2_repository_url="https://github.com/rust-lang/rust"
msys2_references=(
Expand All @@ -40,7 +39,8 @@ makedepends=("${MINGW_PACKAGE_PREFIX}-cc"
"${MINGW_PACKAGE_PREFIX}-pkgconf"
"${MINGW_PACKAGE_PREFIX}-python"
$([[ "$_bootstrapping" == "no" ]] && echo "${MINGW_PACKAGE_PREFIX}-rust")
$([[ ${CARCH} == i686 ]] || echo "${MINGW_PACKAGE_PREFIX}-wasi-libc ${MINGW_PACKAGE_PREFIX}-wasm-component-ld")
"${MINGW_PACKAGE_PREFIX}-wasi-libc"
"${MINGW_PACKAGE_PREFIX}-wasm-component-ld"
"${MINGW_PACKAGE_PREFIX}-zstd"
"${MINGW_PACKAGE_PREFIX}-zlib")
source=("${rust_dist_server}/${_realname}c-${pkgver}-src.tar.gz"{,.asc}
Expand All @@ -51,7 +51,7 @@ source=("${rust_dist_server}/${_realname}c-${pkgver}-src.tar.gz"{,.asc}
noextract=(${_realname}c-${pkgver}-src.tar.gz)
sha256sums=('2f4f3142ffb7c8402139cfa0796e24baaac8b9fd3f96b2deec3b94b4045c6a8a'
'SKIP'
'13b35c27aeaddb7a4105c26f9386d19650806b86ea4da546c29767402ca4cfa0'
'83f81d1c3344ac5d674f4220d14dc86c04c461a8c64ab8d8494a87b88aa5d4fc'
'7cb1773c288ffb1c1e751edc49b1890c84bf9c362742bc5225d19d474edb73a0'
'56882f1a0f1404c10c7726d6cc37444f2b343e72b969badfcb43760f80db0f32'
'98bc3f2bd7371a5b8d14fd7b03bf05574e206d1d9e52bcfbe66d71398504da3c')
Expand Down Expand Up @@ -93,12 +93,8 @@ prepare() {
cd ${_realname}c-${pkgver}-src
apply_patch_with_msg \
0001-rustc-llvm-fix-libs.patch \
0008-disable-self-contained-for-gnu-targets.patch

if [[ ${CARCH} != i686 ]]; then
apply_patch_with_msg \
0004-compiler-Use-wasm-ld-for-wasm-targets.patch
fi
0008-disable-self-contained-for-gnu-targets.patch \
0004-compiler-Use-wasm-ld-for-wasm-targets.patch
}

build() {
Expand Down Expand Up @@ -151,14 +147,9 @@ build() {
if [ "${_bootstrapping}" = "no" ]; then
sed -i '/^\[build\]/,/^$/ s|^#||g' config.toml
fi
# generate debuginfo only for non-i686 targets
if check_option "debug" "y" && [ "${CARCH}" != i686 ]; then
sed -i 's/^#debug/debug/g' config.toml
fi

# Add target wasm32-*
if [[ ${CARCH} != i686 ]]; then
sed -i '/target = \[/a\ "wasm32-unknown-unknown", "wasm32v1-none", "wasm32-wasip1", "wasm32-wasip1-threads", "wasm32-wasip2",' config.toml
if check_option "debug" "y"; then
sed -i 's/^#debug/debug/g' config.toml
fi

local -a _rust_build=()
Expand All @@ -169,11 +160,9 @@ build() {
DESTDIR="$PWD/build-$MSYSTEM/dest-rust" python x.py install "${_rust_build[@]}"

cd build-${MSYSTEM}
if [[ ${CARCH} != i686 ]]; then
# move wasm32-* targets out of the way for splitting
mkdir -p dest-wasm${MINGW_PREFIX}/lib/rustlib
mv dest-rust${MINGW_PREFIX}/lib/rustlib/wasm32* dest-wasm${MINGW_PREFIX}/lib/rustlib
fi
# move wasm32-* targets out of the way for splitting
mkdir -p dest-wasm${MINGW_PREFIX}/lib/rustlib
mv dest-rust${MINGW_PREFIX}/lib/rustlib/wasm32* dest-wasm${MINGW_PREFIX}/lib/rustlib

# move src out of the way for splitting
mkdir -p dest-src${MINGW_PREFIX}/lib/rustlib
Expand All @@ -192,10 +181,8 @@ package_rust() {
"${MINGW_PACKAGE_PREFIX}-libxml2"
"${MINGW_PACKAGE_PREFIX}-zstd"
"${MINGW_PACKAGE_PREFIX}-zlib")
if [[ ${CARCH} != i686 ]]; then
optdepends=("${MINGW_PACKAGE_PREFIX}-gdb: for rust-gdb script"
"${MINGW_PACKAGE_PREFIX}-lldb: for rust-lldb script")
fi
optdepends=("${MINGW_PACKAGE_PREFIX}-gdb: for rust-gdb script"
"${MINGW_PACKAGE_PREFIX}-lldb: for rust-lldb script")
conflicts=("${MINGW_PACKAGE_PREFIX}-rust-docs")
replaces=("${MINGW_PACKAGE_PREFIX}-rust-docs")

Expand All @@ -204,12 +191,8 @@ package_rust() {
cp -a dest-rust/* "${pkgdir}"

# delete unnecessary files, e.g. components and manifest files only used for the uninstall script
# and rust-{gdb{,gui},lldb} for i686
cd "${pkgdir}${MINGW_PREFIX}/lib/rustlib"
rm components install.log manifest-* rust-installer-version uninstall.sh
if [[ ${CARCH} == i686 ]]; then
rm "${pkgdir}${MINGW_PREFIX}"/bin/rust-{gdb{,gui},lldb}
fi

install -d "${pkgdir}${MINGW_PREFIX}/share/bash-completion/completions"
mv "${pkgdir}${MINGW_PREFIX}/etc/bash_completion.d/cargo" \
Expand Down
5 changes: 5 additions & 0 deletions mingw-w64-rust/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ build = "$OSTYPE"
host = ["$OSTYPE"]
target = [
"$OSTYPE",
"wasm32-unknown-unknown",
"wasm32v1-none",
"wasm32-wasip1",
"wasm32-wasip1-threads",
"wasm32-wasip2",
]
build-dir = "build-$MSYSTEM"
python = "$MINGW_PREFIX/bin/python.exe"
Expand Down