core/rust/PKGBUILD
2017-03-05 23:25:22 +00:00

50 lines
1.5 KiB
Bash

# Originally imported from Arch Linux with
# Arch Maintainer: Alexander Rødseth <rodseth@gmail.com>
# Arch Contributor: Daniel Micay <danielmicay@gmail.com>
pkgname=rust
pkgver=1.15.1
pkgrel=1
arch=('x86_64')
pkgdesc='Systems programming language focused on safety, speed and concurrency'
url='https://www.rust-lang.org/'
license=('MIT' 'Apache')
depends=('gcc-libs' 'llvm-libs')
makedepends=('libffi' 'perl' 'python2' 'curl' 'cmake' 'ninja' 'jemalloc' 'llvm')
source=("http://static.rust-lang.org/dist/rustc-$pkgver-src.tar.gz")
sha256sums=('2e7daad418a830b45b977cd7ecf181b65f30f73df63ff36e124ea5fe5d1af327')
install="$pkgname.install"
options=('staticlibs' '!strip' '!emptydirs')
build() {
cd "rustc-$pkgver-src"
./configure --prefix=/usr \
--release-channel=stable \
--enable-ninja \
--llvm-root=/usr \
--disable-codegen-tests \
--jemalloc-root=/usr/lib \
--disable-rustbuild
export RUSTFLAGS="$RUSTFLAGS -C link-args=-lffi"
export CFLAGS="$CFLAGS -fPIC -w"
make
}
package() {
cd "rustc-$pkgver-src"
make DESTDIR="$pkgdir" install
install -Dm644 LICENSE-APACHE \
"$pkgdir/usr/share/licenses/$pkgname/LICENSE-APACHE"
install -Dm644 LICENSE-MIT "$pkgdir/usr/share/licenses/$pkgname/LICENSE-MIT"
cd "$pkgdir/usr/lib"
rm rustlib/{components,manifest-rustc,rust-installer-version}
ln -sf rustlib/$CARCH-unknown-linux-gnu/lib/*.so .
rm rustlib/uninstall.sh # remove uninstall.sh, pacman manages the files anyway
}