aboutsummaryrefslogtreecommitdiffstats
path: root/community/rust
diff options
context:
space:
mode:
authorOrson Teodoro <orsonteodoro@hotmail.com>2018-01-31 17:48:19 -0800
committerJakub Jirutka <jakub@jirutka.cz>2018-02-08 16:01:15 +0100
commit4cf67fa60c887fb2665462846f8874f0be514b32 (patch)
treef7541b58d3e78c36229a26541f1da2b32df1bae2 /community/rust
parent97ed414dac426de224ac23712363618f97223302 (diff)
downloadaports-4cf67fa60c887fb2665462846f8874f0be514b32.tar.bz2
aports-4cf67fa60c887fb2665462846f8874f0be514b32.tar.xz
community/rust: add subpackage -src with full sources
Diffstat (limited to 'community/rust')
-rw-r--r--community/rust/APKBUILD16
1 files changed, 14 insertions, 2 deletions
diff --git a/community/rust/APKBUILD b/community/rust/APKBUILD
index 42497a136e..2a7c9a3e05 100644
--- a/community/rust/APKBUILD
+++ b/community/rust/APKBUILD
@@ -6,7 +6,7 @@ pkgname=rust
pkgver=1.23.0
_llvmver=4
_bootver=1.22.0
-pkgrel=0
+pkgrel=1
pkgdesc="The Rust Programming Language (compiler)"
url="http://www.rust-lang.org"
arch="x86_64"
@@ -26,7 +26,7 @@ makedepends="rust>=$_bootver cargo
python2 tar zlib-dev"
subpackages="$pkgname-dbg $pkgname-stdlib
- $pkgname-gdb::noarch $pkgname-lldb::noarch $pkgname-doc"
+ $pkgname-gdb::noarch $pkgname-lldb::noarch $pkgname-doc $pkgname-src"
source="https://static.rust-lang.org/dist/rustc-$pkgver-src.tar.gz
musl-fix-static-linking.patch
musl-fix-linux_musl_base.patch
@@ -58,6 +58,9 @@ prepare() {
# Make sure to use the system LLVM.
printf '[target.%s]\nllvm-config = "/usr/lib/llvm%s/bin/llvm-config"\n' \
"$CTARGET" "$_llvmver" > config.toml
+
+ # Save untouched sources for packaging in -src subpackage.
+ cp -a "$builddir"/src "$srcdir"/rust-src
}
build() {
@@ -161,6 +164,15 @@ lldb() {
_mv "$pkgdir"/$_sharedir/etc/lldb_*.py $_sharedir/etc/
}
+src() {
+ pkgdesc="$pkgdesc (source code)"
+ depends="$pkgname"
+ license="$license OFL-1.1 GPL-3.0-or-later GPL-3.0-with-GCC-exception CC-BY-SA-3.0 LGPL-3.0"
+
+ mkdir -p "$subpkgdir"/usr/src
+ mv "$srcdir"/rust-src "$subpkgdir"/usr/src/rust
+}
+
_mv() {
local dest; for dest; do true; done # get last argument
mkdir -p "$dest"