# $Id$ # Maintainer: Alexander F Rødseth # Contributor: Daniel Micay # Contributor: userwithuid@gmail.com pkgname=('rust' 'rust-docs') epoch=1 pkgver=1.12.1 pkgrel=1 pkgdesc='Systems programming language focused on safety, speed and concurrency' arch=('x86_64' 'i686') url='http://www.rust-lang.org/' license=('MIT' 'Apache') groups=('rust') makedepends=('jemalloc' 'libffi' 'llvm' 'python2' 'rust') options=('staticlibs' '!strip') source=("https://static.rust-lang.org/dist/rustc-${pkgver}-src.tar.gz"{,.asc} "https://gist.githubusercontent.com/brson/ff61fef70ac30ed4a33672e2b230e7e1/raw/81dc04700a4c78405d42256a4a776851c5e88632/rust-boot-1.12.1-from-1.12.0.diff") sha256sums=('97913ae4cb255618aaacd1a534b11f343634b040b32656250d09d8d9ec02d3dc' 'SKIP' '78b995c34417141ef81419f25d95d835556b14b74c64570b692ead7b420c0c32') validpgpkeys=('108F66205EAEB0AAA8DD5E1C85AB96E6FA1BE5FE') # Rust Language (Tag and Release Signing Key) #gpg --keyserver hkp://keys.gnupg.net --recv-keys 108F66205EAEB0AAA8DD5E1C85AB96E6FA1BE5FE prepare() { cd "${srcdir}/rustc-${pkgver}" # temporary fix to bootstrap point release 1.12.1 from 1.12.0, see # https://users.rust-lang.org/t/bootstrapping-1-12-1-from-1-12-0/7715 patch -Np1 -i ../'rust-boot-1.12.1-from-1.12.0.diff' # needed for static linking to system llvm, see # https://github.com/rust-lang/rust/issues/34486 sed -i -e '$a #[link(name = "ffi")] extern {}' src/librustc_llvm/lib.rs # TODO: we should link to llvm shared libs, but llvm-config prefers static # fedora fixes this by splitting llvm and then building without libLLVM*.a # ensure we use system libs rm -r src/{llvm,jemalloc} # minimize makedepends # curl: used only to fetch stage0 rustc (we bootstrap with previous version) sed -i -e 's/^[[:blank:]]*probe_need CFG_CURL/#\0/' configure # cmake: used only to build custom llvm (we use system llvm) sed -i -e 's/^[[:blank:]]*probe_need CFG_CMAKE/#\0/' configure # TODO: python2 is most likely also not needed # use arch's build flags for non-rust sources (e.g. libbacktrace) sed -i -e "s/CFG_GCCISH_CFLAGS_.* :=/\0 $CFLAGS/" mk/cfg/*.mk sed -i -e "s/CFG_GCCISH_CXXFLAGS_.* :=/\0 $CXXFLAGS/" mk/cfg/*.mk sed -i -e "s/CFG_GCCISH_LINK_FLAGS_.* :=/\0 $LDFLAGS/" mk/cfg/*.mk # for rust sources, rustc/llvm flags could be set via $RUSTFLAGS } build() { cd "${srcdir}/rustc-${pkgver}" ./configure \ --prefix=/usr \ --release-channel=stable \ --disable-rpath \ --disable-manage-submodules \ --enable-local-rust --local-rust-root=/usr \ --enable-jemalloc --jemalloc-root=/usr/lib \ --llvm-root=/usr --disable-codegen-tests # d-cg-t: fix configure error on missing bin/FileCheck with system-llvm make } package_rust() { depends=('gcc-libs' 'llvm-libs') cd "${srcdir}/rustc-${pkgver}" make DESTDIR="${pkgdir}" install install -Dm644 -t "${pkgdir}"/usr/share/licenses/${pkgname}/ LICENSE-{APACHE,MIT} # delete rust-installer stuff (only useful for manual installs) rm "${pkgdir}"/usr/lib/rustlib/{components,install.log,manifest-*,rust-installer-version,uninstall.sh} # replace copies of shared libs with symlinks cd "${pkgdir}"/usr/lib ln -sf rustlib/*/lib/*.so . # split package for docs mv "${pkgdir}"/usr/share/doc "${srcdir}"/ } package_rust-docs() { pkgdesc='Documentation for the Rust programming language' cd "${srcdir}/rustc-${pkgver}" install -m755 -d "${pkgdir}"/usr/share mv "${srcdir}"/doc "${pkgdir}"/usr/share/ install -Dm644 -t "${pkgdir}"/usr/share/licenses/${pkgname}/ LICENSE-{APACHE,MIT} } # vim:set ts=2 sw=2 et: