aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2020-04-07 09:50:55 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2020-04-09 07:37:32 +0000
commit7bb907ec23f7672218ff018e4fdefdea2048ac23 (patch)
tree3d3c3801feb6c1a3f78422730b939b31b6eb7c4f
parentc5f99bf2f9fd24e470ced2f09154f5171f0a7a0e (diff)
community/rust: unify triples on all architectures
Rebuild with target=$CTARGET to fix the tripliet to be consistent on all arches. also use python3 fixes #11349
-rw-r--r--community/rust/APKBUILD43
-rw-r--r--community/rust/python3.patch12
2 files changed, 40 insertions, 15 deletions
diff --git a/community/rust/APKBUILD b/community/rust/APKBUILD
index bcde30fbd3d..2d35f6cc1a2 100644
--- a/community/rust/APKBUILD
+++ b/community/rust/APKBUILD
@@ -7,7 +7,7 @@ pkgname=rust
pkgver=1.42.0
_llvmver=10
_bootver=1.41.1
-pkgrel=1
+pkgrel=2
pkgdesc="The Rust Programming Language"
url="https://www.rust-lang.org"
arch="x86_64 armv7 armhf aarch64 x86 ppc64le"
@@ -18,6 +18,7 @@ license="Apache-2.0 AND MIT"
# See: https://github.com/rust-lang/rust/issues/11937
depends="$pkgname-stdlib=$pkgver-r$pkgrel gcc musl-dev"
+_python=python3
# * Rust is self-hosted, so you need rustc (and cargo) to build rustc...
# The last revision of this abuild that does not depend on itself (uses
# prebuilt rustc and cargo) is 2e6769eb39eaff3029d8298fc02856623c563cd8.
@@ -29,12 +30,12 @@ makedepends="
openssl-dev
llvm$_llvmver-dev
llvm$_llvmver-test-utils
- python2
+ $_python
tar
zlib-dev
coreutils
rust-bootstrap=>$_bootver
- cargo-bootstrap
+ cargo-bootstrap=>$_bootver
"
# XXX: This is a hack to allow this abuild to depend on itself. Adding "rust"
@@ -68,6 +69,7 @@ source="https://static.rust-lang.org/dist/rustc-$pkgver-src.tar.gz
alpine-target.patch
install-template-shebang.patch
check-rustc
+ python3.patch
link-musl-dynamically.patch
musl-dont-use-crt-static.patch
0006-Prefer-libgcc_eh-over-libunwind-for-musl.patch"
@@ -86,23 +88,23 @@ builddir="$srcdir/rustc-$pkgver-src"
case "$CARCH" in
x86)
_build="i686-unknown-linux-musl"
- _target="$_build"
+ _target="$CTARGET"
;;
armv7)
_build="armv7-unknown-linux-musleabihf"
- _target="$_build"
+ _target="$CTARGET"
;;
armhf)
_build="arm-unknown-linux-musleabihf"
- _target="$_build"
+ _target="$CTARGET"
;;
ppc64le)
_build="powerpc64le-unknown-linux-musl"
- _target="$_build"
+ _target="$CTARGET"
;;
aarch64)
_build="aarch64-unknown-linux-musl"
- _target="$_build"
+ _target="$CTARGET"
;;
*)
_build="$CBUILD"
@@ -144,6 +146,9 @@ build() {
export CFLAGS="$CFLAGS -fno-stack-protector"
;;
esac
+ if [ "$_build" != "$_target" ]; then
+ export PKG_CONFIG_ALLOW_CROSS=1
+ fi
./configure \
--build="$_build" \
@@ -161,6 +166,9 @@ build() {
--enable-option-checking \
--enable-locked-deps \
--enable-vendor \
+ --python="$_python" \
+ --set="rust.musl-root=/usr" \
+ --set="target.$_target.llvm-config=/usr/lib/llvm$_llvmver/bin/llvm-config" \
--set="target.$_build.musl-root=/usr" \
--set="target.$_build.crt-static=false"
@@ -168,7 +176,7 @@ build() {
sed 's/#deny-warnings = .*/deny-warnings = false/' -i config.toml
sed 's|deny(warnings,|deny(|' -i src/bootstrap/lib.rs
- ./x.py build --jobs ${JOBS:-2}
+ $_python ./x.py build --jobs ${JOBS:-2}
}
check() {
@@ -186,13 +194,13 @@ check() {
# VERBOSE=1
msg "Running tests for cargo..."
- CFG_DISABLE_CROSS_TESTS=1 ./x.py test --no-fail-fast src/tools/cargo
+ CFG_DISABLE_CROSS_TESTS=1 $_python ./x.py test --no-fail-fast src/tools/cargo
unset LD_LIBRARY_PATH
}
package() {
- DESTDIR="$pkgdir" ./x.py install -v
+ DESTDIR="$pkgdir" $_python ./x.py install -v
cd "$pkgdir"
@@ -204,6 +212,9 @@ package() {
# Remove some clutter.
cd usr/lib/rustlib
rm components install.log manifest-* rust-installer-version uninstall.sh
+ if [ "$_build" != "$_target" ]; then
+ rm -rf "$pkgdir"/usr/lib/rustlib/$_build
+ fi
}
stdlib() {
@@ -221,7 +232,7 @@ analysis() {
gdb() {
pkgdesc="GDB pretty printers for Rust"
- depends="$pkgname gdb"
+ depends="$pkgname=$pkgver-r$pkgrel gdb"
mkdir -p "$subpkgdir"
cd "$subpkgdir"
@@ -231,8 +242,9 @@ gdb() {
}
lldb() {
+ local _pyver=${_python#python}
pkgdesc="LLDB pretty printers for Rust"
- depends="$pkgname lldb py2-lldb"
+ depends="$pkgname=$pkgver-r$pkgrel lldb py$_pyver-lldb"
mkdir -p "$subpkgdir"
cd "$subpkgdir"
@@ -243,7 +255,7 @@ lldb() {
src() {
pkgdesc="$pkgdesc (source code)"
- depends="$pkgname"
+ depends="$pkgname=$pkgver-r$pkgrel"
license="$license OFL-1.1 GPL-3.0-or-later GPL-3.0-with-GCC-exception CC-BY-SA-3.0 LGPL-3.0"
_mv "$pkgdir"/usr/lib/rustlib/src/rust "$subpkgdir"/usr/src/
@@ -256,7 +268,7 @@ src() {
cargo() {
pkgdesc="The Rust package manager"
license="Apache-2.0 MIT UNLICENSE"
- depends="$pkgname"
+ depends="$pkgname=$pkgver-r$pkgrel"
# XXX: See comment on top-level provides=.
provides="cargo-bootstrap=$pkgver-r$pkgrel"
@@ -313,6 +325,7 @@ d4659b56dbf1218da98b995a0a89a8cfd069dd94b3e9aef4aee987484d96fc8b92f6d695ea4123ef
080c3c1af15936c3795724d3cf0f60798ef470bce898e43b6757843bf56f6d46de3dd5b9ea3b116b2011b40373cf8daf17abc94cfff4bdb6221bd431aa0844fd alpine-target.patch
7d59258d4462eba0207739a5c0c8baf1f19d9a396e5547bb4d59d700eb94d50ba6add2e523f3e94e29e993821018594625ea4ac86304fb58f7f8c82622a26ab0 install-template-shebang.patch
c31fdfe8a9b3411576c75da46645cf0465b9053000a2ab49cf9b2f2733f679d6d33acbf236d67a20e14935d094a685453b7f1840180249f39d610fd0902c3125 check-rustc
+f71f25f4b5a0a8c3ab20ca75a63b891a89983c5ab1b25283934b175bb5142aa094f1fef515ac223ab2fa1211f2d018016e7756adb125f96f52fc35b1916a53c3 python3.patch
2a91c0d149f19a2268b2db8e375e0c10820529f588161d8d8e68900d929235d9b1cb4f0d64539c1e20ecca3948b4715f2d9d3d16a2754373d56b4b5808bed6bd link-musl-dynamically.patch
795194976763326c5e4a9eefc8b651b6d5fb533d2d000631ed48a92bafac90e9ca33b8d662e6c53ef109ea1a90c69def715d7d7154e3f9fb9035a58a313a7db3 musl-dont-use-crt-static.patch
9cb9542a13cc356b9f67be02cbe43cfd8d95c79fd561ed5ff5fe1741219e7571904046312be7ab3bda0944ce83bf10c5ddd3e32f19a16334ee445031128354da 0006-Prefer-libgcc_eh-over-libunwind-for-musl.patch"
diff --git a/community/rust/python3.patch b/community/rust/python3.patch
new file mode 100644
index 00000000000..5a9a53dec65
--- /dev/null
+++ b/community/rust/python3.patch
@@ -0,0 +1,12 @@
+diff --git a/configure b/configure
+index eeb8d08..81e2001 100755
+--- a/configure
++++ b/configure
+@@ -11,6 +11,7 @@ try() {
+ fi
+ }
+
++try python3 "$@"
+ try python2.7 "$@"
+ try python27 "$@"
+ try python2 "$@"