PKGBUILDs/community/rust/PKGBUILD

78 lines
2.2 KiB
Bash
Raw Normal View History

2016-12-28 01:38:15 +00:00
# $Id$
# Maintainer: Alexander F Rødseth <xyproto@archlinux.org>
# Contributor: Daniel Micay <danielmicay@gmail.com>
# Contributor: userwithuid <userwithuid@gmail.com>
# ALARM: Kevin Mihelich <kevin@archlinuxarm.org>
# - makedepend on rust, use local rust since bootstrapping is broken on ARM
buildarch=28
pkgname=('rust' 'rust-docs')
epoch=1
2017-03-04 18:45:08 +00:00
pkgver=1.15.1
2016-12-28 01:38:15 +00:00
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})
2017-03-04 18:45:08 +00:00
sha256sums=('2e7daad418a830b45b977cd7ecf181b65f30f73df63ff36e124ea5fe5d1af327'
2016-12-28 01:38:15 +00:00
'SKIP')
options=('staticlibs' '!strip' '!emptydirs')
validpgpkeys=('108F66205EAEB0AAA8DD5E1C85AB96E6FA1BE5FE') # Rust Language (Tag and Release Signing Key) <rust-key@rust-lang.org>
#gpg --keyserver hkp://keys.gnupg.net --recv-keys 108F66205EAEB0AAA8DD5E1C85AB96E6FA1BE5FE
build() {
2017-03-04 18:45:08 +00:00
cd "rustc-$pkgver-src"
2016-12-28 01:38:15 +00:00
./configure \
--prefix=/usr \
--release-channel=stable \
--enable-ninja \
--llvm-root=/usr \
--disable-codegen-tests \
--jemalloc-root=/usr/lib \
2017-03-04 18:45:08 +00:00
--disable-rustbuild \
2016-12-28 01:38:15 +00:00
--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')
2017-03-04 18:45:08 +00:00
cd "rustc-$pkgver-src"
2016-12-28 01:38:15 +00:00
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"
2017-03-04 18:45:08 +00:00
for license in APACHE MIT; do install -Dm644 "rustc-$pkgver-src/LICENSE-$license" \
2016-12-28 01:38:15 +00:00
"$pkgdir/usr/share/licenses/$pkgname/LICENSE-$license"; done
}
# vim:set ts=2 sw=2 et: