Skip to content

Commit

Permalink
rust: drop 32-bit
Browse files Browse the repository at this point in the history
  • Loading branch information
ognevny committed Feb 12, 2025
1 parent e9ad55a commit 154213a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 29 deletions.
44 changes: 15 additions & 29 deletions mingw-w64-rust/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +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-wasm"
"${MINGW_PACKAGE_PREFIX}-rust-src")
pkgver=1.84.1
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 @@ -39,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 @@ -57,7 +58,7 @@ sha256sums=('5e2fb5d49628a549f7671b2ccf9855ab379fd442831a7c2af16e0cdcc31bb375'
'SKIP'
'1aeb932158bd710538c73702db6945cb68a8fb08c519e6e12706b94263b36db8'
'200b9ff220857e53e184257720a14553b2f4aa02577d2ed9842d45d4b9654810'
'9ae64f78af216795bfa31acb8f9a8c2e9ed0e66f61f6565a8b89b58a8dab93b8'
'97316faa124ecd70157d79c64afac399fc706008f902c76baf8889498cde7cc0'
'7cb1773c288ffb1c1e751edc49b1890c84bf9c362742bc5225d19d474edb73a0'
'56882f1a0f1404c10c7726d6cc37444f2b343e72b969badfcb43760f80db0f32'
'98bc3f2bd7371a5b8d14fd7b03bf05574e206d1d9e52bcfbe66d71398504da3c'
Expand Down Expand Up @@ -109,10 +110,8 @@ prepare() {
apply_patch_with_msg \
0013-update-psm.patch

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

# update cc dependency for library and bootstrap to fix compilation for `wasm32v1-none` target
apply_patch_with_msg \
Expand Down Expand Up @@ -169,14 +168,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

# Enable CFGuard for gnullvm
Expand All @@ -192,11 +186,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 @@ -215,10 +207,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 @@ -227,12 +217,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

0 comments on commit 154213a

Please sign in to comment.