# $Id$ # Maintainer: Alexander F Rødseth # Contributor: Daniel Micay # Contributor: userwithuid pkgname=('rust' 'rust-docs') epoch=1 pkgver=1.15.1 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=('cargo' 'curl' 'jemalloc' 'llvm' 'python2' 'rust') source=("https://static.rust-lang.org/dist/rustc-$pkgver-src.tar.gz"{,.asc} 'destdir_1_15.patch' 'jemalloc_1_15.patch') sha256sums=('2e7daad418a830b45b977cd7ecf181b65f30f73df63ff36e124ea5fe5d1af327' 'SKIP' 'SKIP' 'SKIP') options=('!emptydirs') validpgpkeys=('108F66205EAEB0AAA8DD5E1C85AB96E6FA1BE5FE') # Rust Language (Tag and Release Signing Key) #gpg --keyserver hkp://keys.gnupg.net --recv-keys 108F66205EAEB0AAA8DD5E1C85AB96E6FA1BE5FE prepare() { cd "rustc-$pkgver-src" # backport $DESTDIR support for rustbuild # source: git cherry-pick -n 897cf9b 58b94bd 0a014c6 16f8372 patch -Np1 -i ../'destdir_1_15.patch' # backport fix for system-jemalloc build # source: commits 149242e and 3ccb87a (manual) patch -Np1 -i ../'jemalloc_1_15.patch' # ensure we use system libs rm -r src/{llvm,jemalloc} } build() { cd "rustc-$pkgver-src" ./configure \ --prefix=/usr \ --release-channel=stable \ --enable-llvm-link-shared \ --llvm-root=/usr \ --disable-codegen-tests \ --enable-local-rust \ --local-rust-root=/usr \ --enable-vendor \ --jemalloc-root=/usr/lib make } package_rust() { depends=('gcc-libs' 'llvm-libs') cd "rustc-$pkgver-src" make DESTDIR="$pkgdir" install for license in APACHE MIT; do install -Dm644 "LICENSE-$license" \ "$pkgdir/usr/share/licenses/$pkgname/LICENSE-$license"; done # remove rust-installer files (for manual uninstall, but we have pacman) rm "$pkgdir"/usr/lib/rustlib/{components,install.log,manifest-*,rust-installer-version,uninstall.sh} cd "$pkgdir/usr/lib" ln -sf rustlib/$CARCH-unknown-linux-gnu/lib/*.so . # move docs out of the way mv "$pkgdir/usr/share/doc" "$srcdir/" } package_rust-docs() { cd "rustc-$pkgver-src" msg2 "Packaging documentation" install -d "$pkgdir/usr/share/doc/" mv "$srcdir"/doc/* "$pkgdir"/usr/share/doc/rust/ msg2 "Packaging license files for the documentation" for license in APACHE MIT; do install -Dm644 "LICENSE-$license" \ "$pkgdir/usr/share/licenses/$pkgname/LICENSE-$license"; done } # vim:set ts=2 sw=2 et: