PKGBUILDs/community/rust/PKGBUILD

88 lines
2.4 KiB
Bash
Raw Normal View History

2016-12-28 01:38:15 +00:00
# $Id$
2017-03-21 00:08:54 +00:00
# Maintainer: Johannes Löthberg <johannes@kyriasis.com>
# Contributor: Alexander F Rødseth <xyproto@archlinux.org>
2016-12-28 01:38:15 +00:00
# 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-21 00:08:54 +00:00
pkgver=1.16.0
2016-12-28 01:38:15 +00:00
pkgrel=1
2017-03-21 00:08:54 +00:00
2016-12-28 01:38:15 +00:00
pkgdesc='Systems programming language focused on safety, speed and concurrency'
url='https://www.rust-lang.org/'
2017-03-21 00:08:54 +00:00
arch=('x86_64' 'i686')
2016-12-28 01:38:15 +00:00
license=('MIT' 'Apache')
2017-03-21 00:08:54 +00:00
2017-03-21 00:36:05 +00:00
makedepends=('libffi' 'perl' 'python2' 'curl' 'llvm' 'jemalloc' 'cargo' 'rust')
2017-03-21 00:08:54 +00:00
options=('!emptydirs')
source=("https://static.rust-lang.org/dist/rustc-$pkgver-src.tar.gz"{,.asc}
0001-liballoc_jemalloc-fix-linking-with-system-library.patch)
sha256sums=('f966b31eb1cd9bd2df817c391a338eeb5b9253ae0a19bf8a11960c560f96e8b4'
'SKIP'
'b61d9aae58925b222cd44d7b41f0aa648fde89a48e7772aa659acd0d74dde612')
2016-12-28 01:38:15 +00:00
validpgpkeys=('108F66205EAEB0AAA8DD5E1C85AB96E6FA1BE5FE') # Rust Language (Tag and Release Signing Key) <rust-key@rust-lang.org>
2017-03-21 00:08:54 +00:00
prepare() {
cd "rustc-$pkgver-src"
# Backport of https://github.com/rust-lang/rust/pull/39481
patch -p1 <"$srcdir"/0001-liballoc_jemalloc-fix-linking-with-system-library.patch
}
2016-12-28 01:38:15 +00:00
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 \
--llvm-root=/usr \
--disable-codegen-tests \
--jemalloc-root=/usr/lib \
--enable-local-rust \
--local-rust-root=/usr
export RUSTFLAGS="$RUSTFLAGS -C link-args=-lffi"
2017-03-21 00:08:54 +00:00
python2 ./x.py build --verbose
2016-12-28 01:38:15 +00:00
}
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: