From 897c64ddec4c72fbfba832d0635d30827a0d9fcb Mon Sep 17 00:00:00 2001 From: Kevin Mihelich Date: Wed, 28 Dec 2016 01:38:15 +0000 Subject: [PATCH] added community/rust --- community/rust/PKGBUILD | 76 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 community/rust/PKGBUILD diff --git a/community/rust/PKGBUILD b/community/rust/PKGBUILD new file mode 100644 index 000000000..1b1934aba --- /dev/null +++ b/community/rust/PKGBUILD @@ -0,0 +1,76 @@ +# $Id$ +# Maintainer: Alexander F Rødseth +# Contributor: Daniel Micay +# Contributor: userwithuid + +# ALARM: Kevin Mihelich +# - makedepend on rust, use local rust since bootstrapping is broken on ARM + +buildarch=28 + +pkgname=('rust' 'rust-docs') +epoch=1 +pkgver=1.14.0 +pkgrel=1 +arch=('x86_64' 'i686') +pkgdesc='Systems programming language focused on safety, speed and concurrency' +url='https://www.rust-lang.org/' +groups=('rust') +license=('MIT' 'Apache') +makedepends=('libffi' 'perl' 'python2' 'curl' 'llvm' 'cmake' 'ninja' 'jemalloc' 'rust') +source=("https://static.rust-lang.org/dist/rustc-$pkgver-src.tar.gz"{,.asc}) +sha256sums=('c790edd2e915bd01bea46122af2942108479a2fda9a6f76d1094add520ac3b6b' + 'SKIP') +options=('staticlibs' '!strip' '!emptydirs') +validpgpkeys=('108F66205EAEB0AAA8DD5E1C85AB96E6FA1BE5FE') # Rust Language (Tag and Release Signing Key) +#gpg --keyserver hkp://keys.gnupg.net --recv-keys 108F66205EAEB0AAA8DD5E1C85AB96E6FA1BE5FE + +build() { + cd "rustc-$pkgver" + + ./configure \ + --prefix=/usr \ + --release-channel=stable \ + --enable-ninja \ + --llvm-root=/usr \ + --disable-codegen-tests \ + --jemalloc-root=/usr/lib \ + --enable-local-rust \ + --local-rust-root=/usr + + export RUSTFLAGS="$RUSTFLAGS -C link-args=-lffi" + export CFLAGS="$CFLAGS -fPIC -w" + + make +} + +package_rust() { + depends=('gcc-libs' 'llvm-libs') + + cd "rustc-$pkgver" + + make DESTDIR="$pkgdir" install + + for license in APACHE MIT; do install -Dm644 "LICENSE-$license" \ + "$pkgdir/usr/share/licenses/$pkgname/LICENSE-$license"; done + + cd "$pkgdir/usr/lib" + + rm rustlib/{components,manifest-rustc,rust-installer-version} + ln -sf rustlib/$CARCH-unknown-linux-gnu/lib/*.so . + + # move docs out of the way + mv "$pkgdir/usr/share/doc" "$srcdir/" +} + +package_rust-docs() { + msg2 "Packaging documentation" + install -d "$pkgdir/usr/share/doc/" + mv "$srcdir"/doc/* "$pkgdir"/usr/share/doc/rust/ + + msg2 "Packaging license files for the documentation" + for license in APACHE MIT; do install -Dm644 "rustc-$pkgver/LICENSE-$license" \ + "$pkgdir/usr/share/licenses/$pkgname/LICENSE-$license"; done +} + +# vim:set ts=2 sw=2 et: