core/rust/PKGBUILD
2017-03-21 07:25:22 +00:00

57 lines
1.8 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.16.0
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' 'jemalloc' 'llvm')
optdepends=('cargo')
source=("http://static.rust-lang.org/dist/rustc-$pkgver-src.tar.gz"
0001-liballoc_jemalloc-fix-linking-with-system-library.patch)
sha256sums=('f966b31eb1cd9bd2df817c391a338eeb5b9253ae0a19bf8a11960c560f96e8b4'
'b61d9aae58925b222cd44d7b41f0aa648fde89a48e7772aa659acd0d74dde612')
install="$pkgname.install"
options=('staticlibs' '!strip' '!emptydirs')
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
}
build() {
cd "rustc-$pkgver-src"
./configure --prefix=/usr \
--release-channel=stable \
--llvm-root=/usr \
--disable-codegen-tests \
--jemalloc-root=/usr/lib
export RUSTFLAGS="$RUSTFLAGS -C link-args=-lffi"
python2 ./x.py build --verbose
}
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
}