--- a/PKGBUILD +++ b/PKGBUILD @@ -5,51 +5,70 @@ pkgname=('rust' 'rust-docs') epoch=1 -pkgver=1.14.0 +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=('libffi' 'perl' 'python2' 'curl' 'llvm' 'cmake' 'ninja' 'jemalloc') -source=("https://static.rust-lang.org/dist/rustc-$pkgver-src.tar.gz"{,.asc}) -sha256sums=('c790edd2e915bd01bea46122af2942108479a2fda9a6f76d1094add520ac3b6b' +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=('staticlibs' '!strip' '!emptydirs') +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" + cd "rustc-$pkgver-src" ./configure \ --prefix=/usr \ --release-channel=stable \ - --enable-ninja \ + --enable-llvm-link-shared \ --llvm-root=/usr \ --disable-codegen-tests \ + --enable-local-rust \ + --local-rust-root=/usr \ + --enable-vendor \ --jemalloc-root=/usr/lib - export RUSTFLAGS="$RUSTFLAGS -C link-args=-lffi" - export CFLAGS="$CFLAGS -fPIC -w" - make } package_rust() { depends=('gcc-libs' 'llvm-libs') - cd "rustc-$pkgver" + 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 - cd "$pkgdir/usr/lib" + # 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} - rm rustlib/{components,manifest-rustc,rust-installer-version} + cd "$pkgdir/usr/lib" ln -sf rustlib/$CARCH-unknown-linux-gnu/lib/*.so . # move docs out of the way @@ -57,12 +76,14 @@ package_rust() { } 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 "rustc-$pkgver/LICENSE-$license" \ + for license in APACHE MIT; do install -Dm644 "LICENSE-$license" \ "$pkgdir/usr/share/licenses/$pkgname/LICENSE-$license"; done }