Commit 47c35241 authored by alice's avatar alice 🗡 Committed by alice
Browse files

community/rust: modernise aport

set python3 - we don't have 2 anymore
sort depends
use amove where possible
parent 79d5ca1d
......@@ -19,7 +19,6 @@ 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,26 +28,26 @@ _python=python3
# cargo and since we need cargo to rebuild cargo... this already happened
# several times. For this reason we build cargo with vendored libgit2.
makedepends_build="
$_python
!libgit2-dev
file
tar
coreutils
llvm$_llvmver-dev
llvm$_llvmver-test-utils
rust-bootstrap=>$_bootver
cargo-bootstrap=>$_bootver
coreutils
curl-dev
file
libssh2-dev
llvm$_llvmver-dev
llvm$_llvmver-test-utils
openssl1.1-compat-dev
python3
rust-bootstrap=>$_bootver
tar
wasi-libc
zlib-dev
"
makedepends_host="
curl-dev
libssh2-dev
openssl1.1-compat-dev
llvm$_llvmver-dev
openssl1.1-compat-dev
zlib-dev
"
......@@ -161,7 +160,7 @@ build() {
--enable-locked-deps \
--enable-vendor \
--dist-compression-formats=gz \
--python="$_python" \
--python="python3" \
--set="rust.musl-root=/usr" \
--set="rust.codegen-units=1" \
--set="rust.codegen-units-std=1" \
......@@ -190,7 +189,7 @@ build() {
sed 's/#deny-warnings = .*/deny-warnings = false/' -i config.toml
sed 's|deny(warnings,|deny(|' -i src/bootstrap/lib.rs
$_python ./x.py dist -v --jobs ${JOBS:-2}
python3 ./x.py dist --jobs ${JOBS:-2}
}
check() {
......@@ -208,7 +207,7 @@ check() {
# VERBOSE=1
msg "Running tests for cargo..."
CFG_DISABLE_CROSS_TESTS=1 $_python ./x.py test --no-fail-fast src/tools/cargo
CFG_DISABLE_CROSS_TESTS=1 python3 ./x.py test --no-fail-fast src/tools/cargo
unset LD_LIBRARY_PATH
}
......@@ -266,7 +265,7 @@ stdlib() {
pkgdesc="Standard library for Rust (static rlibs)"
depends=
_mv "$pkgdir"/$_rlibdir/*.rlib "$subpkgdir"/$_rlibdir/
amove $_rlibdir/*.rlib
}
wasm() {
......@@ -280,30 +279,23 @@ analysis() {
pkgdesc="Compiler analysis data for the Rust standard library"
depends="$pkgname-stdlib=$pkgver-r$pkgrel"
_mv "$pkgdir"/$_rlibdir/../analysis "$subpkgdir"/${_rlibdir%/*}/
amove $_rlibdir/../analysis
}
gdb() {
pkgdesc="GDB pretty printers for Rust"
depends="$pkgname=$pkgver-r$pkgrel gdb"
mkdir -p "$subpkgdir"
cd "$subpkgdir"
_mv "$pkgdir"/usr/bin/rust-gdb usr/bin/
_mv "$pkgdir"/$_sharedir/etc/gdb_*.py $_sharedir/etc/
amove usr/bin/rust-gdb
amove $_sharedir/etc/gdb_*.py
}
lldb() {
local _pyver=${_python#python}
pkgdesc="LLDB pretty printers for Rust"
depends="$pkgname=$pkgver-r$pkgrel lldb py$_pyver-lldb"
depends="$pkgname=$pkgver-r$pkgrel lldb py3-lldb"
mkdir -p "$subpkgdir"
cd "$subpkgdir"
_mv "$pkgdir"/usr/bin/rust-lldb usr/bin/
_mv "$pkgdir"/$_sharedir/etc/lldb_*.py $_sharedir/etc/
amove usr/bin/rust-lldb
amove $_sharedir/etc/lldb_*.py
}
src() {
......@@ -325,7 +317,7 @@ cargo() {
# XXX: See comment on top-level provides=.
provides="cargo-bootstrap=$pkgver-r$pkgrel"
_mv "$pkgdir"/usr/bin/cargo "$subpkgdir"/usr/bin/
amove usr/bin/cargo
}
rustfmt() {
......@@ -354,10 +346,7 @@ _cargo_zshcomp() {
depends=""
install_if="cargo=$pkgver-r$pkgrel zsh"
cd "$pkgdir"
_mv usr/share/zsh/site-functions/_cargo \
"$subpkgdir"/usr/share/zsh/site-functions/
rmdir -p usr/share/zsh/site-functions 2>/dev/null || true
amove usr/share/zsh/site-functions/_cargo
}
_cargo_doc() {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment