diff options
author | Jakub Jirutka <jakub@jirutka.cz> | 2017-04-08 14:05:55 +0200 |
---|---|---|
committer | Jakub Jirutka <jakub@jirutka.cz> | 2017-04-09 15:41:28 +0200 |
commit | 9345f4e5b2cf8b19131734a79f41a7936b015dca (patch) | |
tree | 1527a9054abaa2969ad3967f4487dbcc9017af41 /testing | |
parent | 745ddd39dcb00ad3e72e68cc883db3f470f32ef6 (diff) | |
download | aports-9345f4e5b2cf8b19131734a79f41a7936b015dca.tar.bz2 aports-9345f4e5b2cf8b19131734a79f41a7936b015dca.tar.xz |
testing/rust: modernize abuild
Diffstat (limited to 'testing')
-rw-r--r-- | testing/rust/APKBUILD | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/testing/rust/APKBUILD b/testing/rust/APKBUILD index 44836913e9..8dee3c1677 100644 --- a/testing/rust/APKBUILD +++ b/testing/rust/APKBUILD @@ -11,7 +11,7 @@ depends="$pkgname-stdlib" # libffi-dev is needed just because we compile llvm3.7 with LLVM_ENABLE_FFI. makedepends="cmake file libffi-dev llvm3.7 llvm3.7-dev llvm3.7-static musl-dev python2 tar zlib-dev" -subpackages="$pkgname-stdlib $pkgname-gdb $pkgname-lldb $pkgname-doc" +subpackages="$pkgname-stdlib $pkgname-gdb::noarch $pkgname-lldb::noarch $pkgname-doc" # XXX: Rust is self-hosted, so you need rustc to build rustc... The problem is # that Rust doesn't provide prebuilt rustc for musl yet. Thus I cross-compiled @@ -29,20 +29,20 @@ source="https://static.rust-lang.org/dist/rustc-$pkgver-src.tar.gz llvm-with-ffi.patch move-py-scripts-to-share.patch " -options="!strip" +options="!check !strip" builddir="$srcdir/rustc-$pkgver" +_ctarget="$CARCH-unknown-linux-musl" _sharedir="usr/share/rust" _stage0dir="$srcdir/stage0" -_CTARGET="$CARCH-unknown-linux-musl" prepare() { - default_prepare || return 1 + default_prepare cd "$builddir" # Remove some bundled dependencies. - rm -Rf src/llvm/ src/jemalloc/ || return 1 + rm -Rf src/llvm/ src/jemalloc/ # These tests assume that alloc_jemalloc is present, disable them. sed -i "1i // ignore-test jemalloc is disabled" \ @@ -52,9 +52,9 @@ prepare() { # Prepare our stage0 for bootstrapping. mkdir -p "$_stage0dir" - cp -flr "$srcdir"/rustc-*$_CTARGET/rustc/* \ - "$srcdir"/rust-std-*$_CTARGET/rust-std-*/* \ - "$srcdir"/cargo-*$_CTARGET/cargo/* \ + cp -flr "$srcdir"/rustc-*$_ctarget/rustc/* \ + "$srcdir"/rust-std-*$_ctarget/rust-std-*/* \ + "$srcdir"/cargo-*$_ctarget/cargo/* \ "$_stage0dir"/ } @@ -85,8 +85,8 @@ build() { # Note: rustc doesn't work well with jemalloc on musl (yet) ./configure \ - --build="$_CTARGET" \ - --host="$_CTARGET" \ + --build="$_ctarget" \ + --host="$_ctarget" \ --prefix="/usr" \ --enable-rustbuild \ --release-channel="stable" \ @@ -94,15 +94,17 @@ build() { --llvm-root="/usr/lib/llvm-3.7" \ --disable-docs \ --disable-jemalloc \ - --disable-rpath || return 1 + --disable-rpath # This is really stupid, but rustbuild doesn't provide "install" # command yet, so we must create a dist tarball... # https://github.com/rust-lang/rust/issues/34675 - make dist VERBOSE=1 || return 1 + make dist VERBOSE=1 +} - #msg "Running tests..." - #make check VERBOSE=1 +check() { + cd "$builddir" + make check VERBOSE=1 } # XXX: so libs doesn't have stable ABI, so they should not be registered as @@ -111,8 +113,8 @@ build() { package() { cd "$builddir" - _install build/dist/rustc-$pkgver-$_CTARGET.tar.gz \ - "$pkgdir"/usr || return 1 + _install build/dist/rustc-$pkgver-$_ctarget.tar.gz \ + "$pkgdir"/usr # Python scripts are noarch, so move them to /usr/share. # Requires move-py-scripts-to-share.patch to be applied. @@ -124,31 +126,29 @@ stdlib() { depends="$pkgname" cd "$builddir" - _install build/dist/rust-std-$pkgver-$_CTARGET.tar.gz \ - "$subpkgdir"/usr || return 1 + _install build/dist/rust-std-$pkgver-$_ctarget.tar.gz \ + "$subpkgdir"/usr } gdb() { pkgdesc="GDB pretty printers for Rust" - arch="noarch" depends="$pkgname gdb" mkdir -p "$subpkgdir" cd "$subpkgdir" - _mv "$pkgdir"/usr/bin/rust-gdb usr/bin/ || return 1 + _mv "$pkgdir"/usr/bin/rust-gdb usr/bin/ _mv "$pkgdir"/$_sharedir/etc/gdb_*.py $_sharedir/etc/ } lldb() { pkgdesc="LLDB pretty printers for Rust" - arch="noarch" depends="$pkgname lldb py-lldb" mkdir -p "$subpkgdir" cd "$subpkgdir" - _mv "$pkgdir"/usr/bin/rust-lldb usr/bin/ || return 1 + _mv "$pkgdir"/usr/bin/rust-lldb usr/bin/ _mv "$pkgdir"/$_sharedir/etc/lldb_*.py $_sharedir/etc/ } |