summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD74
1 files changed, 34 insertions, 40 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 29b67d86b59b..d49fa322d434 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,17 +1,16 @@
-# Maintainer: pingplug <pingplug@foxmail.com>
-# Contributor: Johannes Löthberg <johannes@kyriasis.com>
-# Contributor: Alexander F Rødseth <xyproto@archlinux.org>
-# Contributor: Daniel Micay <danielmicay@gmail.com>
-# Contributor: userwithuid <userwithuid@gmail.com>
+# Maintainer: pingplug < aur at pingplug dot me >
+# Contributor: Johannes Löthberg < johannes at kyriasis dot com >
+# Contributor: Alexander F Rødseth < xyproto at archlinux dot org >
+# Contributor: Daniel Micay < danielmicay at gmail dot com >
+# Contributor: userwithuid < userwithuid at gmail dot com >
_pkgname=rust
-_date=2019-02-28
-_rustc=1.33.0
-_cargo=0.34.0
+_date=2024-03-21
+_rustc=1.77.0
pkgname=mingw-w64-rust
_prefix=opt/rust
-pkgver=1.34.0
+pkgver=1.78.0
pkgrel=1
pkgdesc="Systems programming language focused on safety, speed and concurrency (mingw-w64)"
arch=('x86_64')
@@ -20,80 +19,71 @@ license=('MIT' 'Apache' 'custom')
depends=('gcc-libs'
'curl'
'libgit2'
- 'mingw-w64-gcc')
+ 'mingw-w64-gcc>=10.1.0')
optdepends=('mingw-w64-wine: for cargo test support')
makedepends=('gdb'
'ninja'
'libffi'
'perl'
- 'python2'
+ 'python'
'nodejs'
+ 'procps-ng'
'cmake')
options=('!strip' 'staticlibs' '!buildflags')
source=("https://static.rust-lang.org/dist/rustc-${pkgver}-src.tar.xz"{,.asc}
"https://static.rust-lang.org/dist/${_date}/rust-std-${_rustc}-x86_64-unknown-linux-gnu.tar.xz"{,.asc}
"https://static.rust-lang.org/dist/${_date}/rustc-${_rustc}-x86_64-unknown-linux-gnu.tar.xz"{,.asc}
- "https://static.rust-lang.org/dist/${_date}/cargo-${_cargo}-x86_64-unknown-linux-gnu.tar.xz"{,.asc}
+ "https://static.rust-lang.org/dist/${_date}/cargo-${_rustc}-x86_64-unknown-linux-gnu.tar.xz"{,.asc}
"mingw-config.toml")
noextract=("rust-std-${_rustc}-x86_64-unknown-linux-gnu.tar.xz"
"rustc-${_rustc}-x86_64-unknown-linux-gnu.tar.xz"
- "cargo-${_cargo}-x86_64-unknown-linux-gnu.tar.xz")
-sha256sums=('a510b3b7ceca370a4b395065039b2a70297e3fb4103b7ff67b1eff771fd98504'
+ "cargo-${_rustc}-x86_64-unknown-linux-gnu.tar.xz")
+sha256sums=('8065824f0255faa3901db8206e6f9423f6f8c07cec28bc6f2797c6c948310ece'
'SKIP'
- '6f20343ed73faf5fdfc423bec38a9bb1910a0a962af6f2dddd7184407543ed0e'
+ 'e5fec840744c3ff63611f6801de80f5ec8e099fa8225bf46d064810a9545e9b5'
'SKIP'
- '57c5ced1a826d34f26e50adf041528dd0000f2a59e8be32d2359386843382ce1'
+ '89397dddb99733bad987e9fdc9d985a150af2e39c81766099e584d93991f5752'
'SKIP'
- '1730c8ebcacc1327eb28b328cb9f5a2c612bb3d9efff9c350647adf19f304e15'
+ '0af971f126e0307d4e4d974f0e9c33fd1c2923274b14a0861823b5a019e8faf5'
'SKIP'
- '4a6a05ee25e07797314ea01710a1a8e5602838489fff7c108e518965128c8291')
+ '14e684d6db06462a247c6af89dbfa55fc024a1c9c24448fa45abb7818f9433b6')
validpgpkeys=('108F66205EAEB0AAA8DD5E1C85AB96E6FA1BE5FE') # Rust Language (Tag and Release Signing Key) <rust-key@rust-lang.org>
backup=("opt/rust/cargo/config")
-PKGEXT=".pkg.tar.gz"
prepare() {
cd "rustc-${pkgver}-src"
cp "${srcdir}"/mingw-config.toml config.toml
sed -i "s|\@PREFIX\@|/${_prefix}|" config.toml
- cd "${srcdir}/rustc-${pkgver}-src/src/bootstrap"
- sed -i "s|tar.gz|tar.xz|" bootstrap.py
cd "${srcdir}"
mkdir -p "${srcdir}/rustc-${pkgver}-src/build/cache/${_date}"
cp rust-std-${_rustc}-x86_64-unknown-linux-gnu.tar.xz "rustc-${pkgver}-src/build/cache/${_date}"
cp rustc-${_rustc}-x86_64-unknown-linux-gnu.tar.xz "rustc-${pkgver}-src/build/cache/${_date}"
- cp cargo-${_cargo}-x86_64-unknown-linux-gnu.tar.xz "rustc-${pkgver}-src/build/cache/${_date}"
+ cp cargo-${_rustc}-x86_64-unknown-linux-gnu.tar.xz "rustc-${pkgver}-src/build/cache/${_date}"
}
build() {
cd "rustc-${pkgver}-src"
- export CFLAGS="-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions --param=ssp-buffer-size=4"
- export CXXFLAGS="-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions --param=ssp-buffer-size=4"
- python ./x.py build
+ export CFLAGS="-O2 -pipe -fno-plt -Wall -D_FORTIFY_SOURCE=2 -fexceptions --param=ssp-buffer-size=4"
+ export CXXFLAGS="-O2 -pipe -fno-plt -Wall -D_FORTIFY_SOURCE=2 -fexceptions --param=ssp-buffer-size=4"
+ # TODO: find a way to disable packaging
+ DESTDIR="${srcdir}/rust_install" python ./x.py install
}
package() {
cd "rustc-${pkgver}-src"
-
- # rust will build install tools there
- export CFLAGS="-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions --param=ssp-buffer-size=4"
- export CXXFLAGS="-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions --param=ssp-buffer-size=4"
- # TODO: find a way to disable packaging
- # use level 0 to speed up xz packaging
- sed -i 's|XzEncoder::new(create_new_file(tar_xz)?, 6)|XzEncoder::new(create_new_file(tar_xz)?, 0)|' "src/tools/rust-installer/src/tarballer.rs"
- DESTDIR="${pkgdir}" python2 ./x.py install
+ mv "${srcdir}/rust_install/"* "${pkgdir}"
# license
- install -dm755 "${pkgdir}/usr/share/licenses/${pkgname}/"{rust,cargo}
- mv "${pkgdir}"/${_prefix}/share/doc/rust/LICENSE-*.old "${pkgdir}/usr/share/licenses/${pkgname}/cargo/"
- rename '.old' '' "${pkgdir}/usr/share/licenses/${pkgname}/cargo/"*
- mv "${pkgdir}"/${_prefix}/share/doc/rust/{LICENSE-*,COPYRIGHT} "${pkgdir}/usr/share/licenses/${pkgname}/rust/"
+ install -dm755 "${pkgdir}/usr/share/licenses/${pkgname}/"{rustc,cargo}
+ mv "${pkgdir}"/${_prefix}/share/doc/cargo/LICENSE-* "${pkgdir}/usr/share/licenses/${pkgname}/cargo/"
+ mv "${pkgdir}"/${_prefix}/share/doc/rustc/{LICENSE-*,COPYRIGHT} "${pkgdir}/usr/share/licenses/${pkgname}/rustc/"
# remove unused files
- rm -r "${pkgdir}/etc/"
+ rm -r "${pkgdir}/etc"
rm -r "${pkgdir}/${_prefix}/share"
rm "${pkgdir}/${_prefix}/lib/rustlib/"{manifest-*,install.log,uninstall.sh,components,rust-installer-version}
@@ -110,15 +100,19 @@ package() {
# strip
strip --strip-all "${pkgdir}/${_prefix}/bin/"{cargo,rustc,rustdoc}
- strip --strip-all "${pkgdir}/${_prefix}/lib/rustlib/x86_64-unknown-linux-gnu/bin/"rust-lld
+ strip --strip-all "${pkgdir}/${_prefix}/lib/rustlib/x86_64-unknown-linux-gnu/bin/"rust-*
+ strip --strip-all "${pkgdir}/${_prefix}/lib/rustlib/x86_64-unknown-linux-gnu/bin/gcc-ld/"*
+ strip --strip-unneeded "${pkgdir}/${_prefix}/lib/librustc"*.so
strip --strip-unneeded "${pkgdir}/${_prefix}/lib/rustlib/x86_64-unknown-linux-gnu/lib/"*.so
- strip --strip-unneeded "${pkgdir}/${_prefix}/lib/rustlib/x86_64-unknown-linux-gnu/codegen-backends/"*.so
i686-w64-mingw32-strip --strip-unneeded "${pkgdir}/${_prefix}/lib/rustlib/i686-pc-windows-gnu/lib/"*.dll
x86_64-w64-mingw32-strip --strip-unneeded "${pkgdir}/${_prefix}/lib/rustlib/x86_64-pc-windows-gnu/lib/"*.dll
# config
install -dm777 "${pkgdir}/opt/rust/cargo"
cat << EOF >> "${pkgdir}/opt/rust/cargo/config"
+[net]
+git-fetch-with-cli = true
+
[target.i686-pc-windows-gnu]
linker = "/usr/bin/i686-w64-mingw32-gcc"
ar = "/usr/i686-w64-mingw32/bin/ar"