mirror of
https://github.com/archlinuxarm/PKGBUILDs.git
synced 2025-03-09 00:17:31 +00:00
added community/rust
This commit is contained in:
parent
6f232f15fd
commit
0df3a7b13f
1 changed files with 87 additions and 0 deletions
87
community/rust/PKGBUILD
Normal file
87
community/rust/PKGBUILD
Normal file
|
@ -0,0 +1,87 @@
|
|||
# $Id$
|
||||
# Maintainer: Johannes Löthberg <johannes@kyriasis.com>
|
||||
# Contributor: Alexander F Rødseth <xyproto@archlinux.org>
|
||||
# Contributor: Daniel Micay <danielmicay@gmail.com>
|
||||
# Contributor: userwithuid <userwithuid@gmail.com>
|
||||
|
||||
# ALARM: Kevin Mihelich <kevin@archlinuxarm.org>
|
||||
# - add a link to g++ to compensate for broken cross-compiler decisions
|
||||
|
||||
buildarch=28
|
||||
|
||||
pkgname=('rust' 'rust-docs')
|
||||
epoch=1
|
||||
pkgver=1.17.0
|
||||
pkgrel=1
|
||||
|
||||
pkgdesc='Systems programming language focused on safety, speed and concurrency'
|
||||
url='https://www.rust-lang.org/'
|
||||
arch=('x86_64' 'i686')
|
||||
license=('MIT' 'Apache')
|
||||
|
||||
makedepends=('rust' 'cargo' 'libffi' 'perl' 'python2' 'curl' 'llvm' 'jemalloc')
|
||||
|
||||
options=('!emptydirs')
|
||||
|
||||
source=("https://static.rust-lang.org/dist/rustc-$pkgver-src.tar.gz"{,.asc})
|
||||
|
||||
sha256sums=('4baba3895b75f2492df6ce5a28a916307ecd1c088dc1fd02dbfa8a8e86174f87'
|
||||
'SKIP')
|
||||
validpgpkeys=('108F66205EAEB0AAA8DD5E1C85AB96E6FA1BE5FE') # Rust Language (Tag and Release Signing Key) <rust-key@rust-lang.org>
|
||||
|
||||
prepare() {
|
||||
if [[ $CARCH == armv7h ]]; then
|
||||
mkdir path
|
||||
ln -s /usr/bin/g++ path/arm-linux-gnueabihf-g++
|
||||
export PATH="$srcdir/path:$PATH"
|
||||
fi
|
||||
}
|
||||
|
||||
build() {
|
||||
cd "rustc-$pkgver-src"
|
||||
|
||||
./configure \
|
||||
--prefix=/usr \
|
||||
--release-channel=stable \
|
||||
--llvm-root=/usr \
|
||||
--enable-llvm-link-shared \
|
||||
--disable-codegen-tests \
|
||||
--jemalloc-root=/usr/lib \
|
||||
--enable-local-rust
|
||||
|
||||
export RUSTFLAGS="$RUSTFLAGS -C link-args=-lffi"
|
||||
|
||||
python2 ./x.py build --verbose
|
||||
}
|
||||
|
||||
package_rust() {
|
||||
depends=('gcc-libs' 'llvm-libs')
|
||||
optdepends=('cargo')
|
||||
|
||||
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"
|
||||
|
||||
rm rustlib/{components,manifest-rustc,rust-installer-version}
|
||||
ln -sf rustlib/$CARCH-unknown-linux-gnu/lib/*.so .
|
||||
|
||||
# move docs out of the way
|
||||
mv "$pkgdir/usr/share/doc" "$srcdir/"
|
||||
}
|
||||
|
||||
package_rust-docs() {
|
||||
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-src/LICENSE-$license" \
|
||||
"$pkgdir/usr/share/licenses/$pkgname/LICENSE-$license"; done
|
||||
}
|
||||
|
||||
# vim:set ts=2 sw=2 et:
|
Loading…
Reference in a new issue