# Originally imported from Arch Linux with # Arch Maintainer: Alexander Rødseth # Arch Contributor: Daniel Micay pkgname=rust pkgver=1.20.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') provides=('cargo') conflicts=('cargo') replaces=('cargo') depends=('gcc-libs' 'llvm-libs') makedepends=('rust' 'libffi' 'perl' 'python2' 'curl' 'cmake' 'llvm' 'cargo') source=("http://static.rust-lang.org/dist/rustc-$pkgver-src.tar.gz" 0001-librustc_llvm-build-Force-link-against-libffi.patch bootstrap-config.toml) sha256sums=('2aa4875ff4472c6e35262bbb9052cb2623da3dae6084a858cc59d36f33f18214' '563529da8e02f575ddde7247d5fc5350d74031daa54743b86d075f3c45ae2713' '4252d4873a840216115ee306e4d689819bc791ee05bedd1faa0b00c49ff91c62') install="$pkgname.install" options=('staticlibs' '!strip' '!emptydirs') prepare() { cd "rustc-$pkgver-src" patch -p1 <"$srcdir"/0001-librustc_llvm-build-Force-link-against-libffi.patch cp "$srcdir"/bootstrap-config.toml config.toml } build() { cd "rustc-$pkgver-src" msg2 "Run build under x.py" python2 ./x.py build } package() { cd "rustc-$pkgver-src" DESTDIR="$pkgdir" python2 ./x.py 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 }