diff options
author | Tatsuyuki Ishi | 2017-05-28 10:48:00 +0900 |
---|---|---|
committer | Tatsuyuki Ishi | 2017-05-28 10:48:00 +0900 |
commit | 378cb98f195020b5cf26de80cc3ee26389313b9e (patch) | |
tree | 0ba8dd88667ed81e03d326d0cc69e487f6a91b6b /PKGBUILD | |
parent | f4b4bc1e15f8bfa1c8d4dd9e498ac6dd2f704753 (diff) | |
download | aur-378cb98f195020b5cf26de80cc3ee26389313b9e.tar.gz |
Use the revamped PKGBUILD
Diffstat (limited to 'PKGBUILD')
-rw-r--r-- | PKGBUILD | 221 |
1 files changed, 127 insertions, 94 deletions
@@ -1,127 +1,160 @@ # Maintainer: spider-mario <spidermario@free.fr> # Contributor: Taras Shpot <mrshpot@gmail.com> # Contributor: Tatsuyuki Ishi <ishitatsuyuki@gmail.com> -pkgname=('rust-git' 'rust-docs-git' 'rust-src-git') -pkgver=1.0.0.beta.2833.gb850046 +_gitname='rust' +pkgname=('rust-git' 'rust-docs-git' 'rust-src-git' 'rust-analysis-git' 'cargo-git' 'rls-git') +pkgver=1.19.0.r64389.4f9c9ed1a5 epoch=3 -pkgrel=3 +pkgrel=1 pkgdesc="Systems programming language focused on safety, speed and concurrency" arch=('i686' 'x86_64') url="http://www.rust-lang.org/" license=('MIT' 'Apache') -makedepends=('git' 'libffi' 'python2' 'curl' 'llvm' 'jemalloc') -source=("git+https://github.com/rust-lang/rust.git" - "git+https://github.com/rust-lang/cargo.git" - "git+https://github.com/rust-lang/compiler-rt.git" - "git+https://github.com/rust-lang/libc.git" - "git+https://github.com/rust-lang/hoedown.git" - "git+https://github.com/rust-lang/rust-installer.git" - - "git+https://github.com/rust-lang-nursery/nomicon.git" - "git+https://github.com/rust-lang-nursery/reference.git" - - "git+https://github.com/rust-lang/rust.vim.git" - "git+https://github.com/rust-lang/rust-mode.git" - "git+https://github.com/rust-lang/zsh-config.git") -_noclone=(cargo compiler-rt libc hoedown rust-installer nomicon reference) -sha512sums=('SKIP' - 'SKIP' - 'SKIP' - 'SKIP' - 'SKIP' - 'SKIP' - 'SKIP' - 'SKIP' - 'SKIP' - 'SKIP' - 'SKIP') +makedepends=('git' 'libffi' 'perl' 'python2' 'curl' 'llvm' 'cmake' +'jemalloc') +source=("git+https://github.com/rust-lang/rust.git") +options=('staticlibs' '!strip' '!emptydirs') +sha256sums=('SKIP') + +rustbuild_pkgver() { + grep '^pub const CFG_RELEASE_NUM' src/bootstrap/channel.rs|head -n1|cut -d\" -f2 +} -pkgver() { - cd rust - echo "$(grep -m1 'CFG_RELEASE_NUM' src/bootstrap/channel.rs | cut -d'"' -f2)"."$(git rev-parse --short HEAD)" +cargo_pkgver() { + grep '^version =' Cargo.toml|head -n1|cut -d\" -f2 } -prepare() { - rm -rf -- "${_noclone[@]}" +install_component() { + if [ -z "${3}" ]; then + release=$(rustbuild_pkgver) + else + release=$(cd "${3}" && cargo_pkgver) + fi + triple="${CARCH}-unknown-linux-gnu" + fullver="${release}-dev-${triple}" + + "./build/tmp/dist/${1}-${fullver}/install.sh" \ + --prefix=$pkgdir/usr \ + --sysconfdir=$pkgdir/etc \ + --docdir=$pkgdir/usr/share/doc/$2 \ + --bindir=$pkgdir/usr/bin \ + --mandir=$pkgdir/usr/share/man \ + --libdir=$pkgdir/usr/lib \ + --disable-ldconfig + + rm $pkgdir/usr/lib/rustlib/{components,install.log,manifest-*,rust-installer-version,uninstall.sh} +} - cd rust - _srcdest="$SRCDEST" perl -pi -- /dev/stdin .gitmodules <<'END' - if (m{(?<assignment> \s* url \s* = \s*) .* / (?<submodule> [^/]*?)(?:\.git)?$}x) { - my $local = "$ENV{_srcdest}/$+{submodule}"; - $_ = "$+{assignment}$local\n" if -d $local; - } -END +pkgver() { + cd "$_gitname" + echo "$(rustbuild_pkgver).r$(git rev-list --count HEAD).$(git rev-parse --short HEAD)" } build() { - cd rust + cd "$_gitname" + + ./configure \ + --prefix=/usr \ + --llvm-root=/usr \ + --disable-codegen-tests \ + --enable-llvm-link-shared \ + --jemalloc-root=/usr/lib/ \ + --disable-dist-src \ + --enable-extended \ + --enable-sanitizers + + make dist +} + +package_rust-git() { + depends=('gcc-libs' 'llvm-libs') + provides=('rust') + conflicts=('rust') - ./configure \ - --prefix=/usr \ - --llvm-root=/usr \ - --enable-llvm-link-shared \ - --jemalloc-root=/usr/lib/ \ - --disable-dist-src + cd $_gitname - make + install_component rust-std rust + install_component rustc rust + + for license in APACHE MIT; do install -Dm644 "LICENSE-$license" \ + "$pkgdir/usr/share/licenses/$pkgname/LICENSE-$license"; done + + cd "$pkgdir/usr/lib" + + ln -sf rustlib/$CARCH-unknown-linux-gnu/lib/*.so . } -package_rust-git() { - depends=('shared-mime-info' 'llvm-libs') - optdepends=('rust-docs-git: language and API documentation') - provides=('rust') - conflicts=('rust') - options=('staticlibs') - install=rust.install +package_rust-docs-git() { + pkgdesc="Systems programming language focused on safety, speed and concurrency (Language and API documentation)" + arch=('any') + provides=('rust-docs') + conflicts=('rust-docs') - cd rust + cd "$_gitname" - make DESTDIR="$pkgdir" install + install_component rust-docs rust - rm -f "$pkgdir"/usr/lib/rustlib/{components,manifest-rust-docs,install.log,uninstall.sh} + for license in APACHE MIT; do install -Dm644 "LICENSE-$license" \ + "$pkgdir/usr/share/licenses/$pkgname/LICENSE-$license"; done +} - install --directory "$pkgdir"/usr/share/licenses/$pkgname/ - install -m644 COPYRIGHT LICENSE-* "$pkgdir"/usr/share/licenses/$pkgname/ +package_rust-src-git() { + pkgdesc="Systems programming language focused on safety, speed and concurrency (Source code)" + arch=('any') + provides=('rust-src') + conflicts=('rust-src') + + cd "$_gitname" + + mkdir -p "$pkgdir/usr/src/rust/" + git checkout-index -a --prefix "$pkgdir/usr/src/rust/" - install --directory "$pkgdir"/usr/share/vim/vimfiles/ - cp -a "$srcdir"/rust.vim/*/ "$pkgdir"/usr/share/vim/vimfiles/ + for license in APACHE MIT; do install -Dm644 "LICENSE-$license" \ + "$pkgdir/usr/share/licenses/$pkgname/LICENSE-$license"; done +} + +package_rust-analysis-git() { + pkgdesc="Systems programming language focused on safety, speed and concurrency (Code completion data)" + depends=('rust-git') + provides=('rust-analysis') + conflicts=('rust-analysis') - install --directory "$pkgdir"/usr/share/zsh/functions/Completion/Zsh/ - cp -a "$srcdir"/zsh-config/_* "$pkgdir"/usr/share/zsh/functions/Completion/Zsh/ + cd "$_gitname" - cd "$srcdir"/rust-mode - emacs --eval '(byte-recompile-directory "." 0)' --quick --batch 2> /dev/null || true - install --directory "$pkgdir"/usr/share/emacs/site-lisp/ - cp -a rust-mode.* "$pkgdir"/usr/share/emacs/site-lisp/ + install_component rust-analysis rust - rm -fr "$pkgdir"/usr/share/doc + for license in APACHE MIT; do install -Dm644 "LICENSE-$license" \ + "$pkgdir/usr/share/licenses/$pkgname/LICENSE-$license"; done } -package_rust-docs-git() { - pkgdesc="Systems programming language focused on safety, speed and concurrency (Language and API documentation)" - arch=('any') - options+=('!strip' '!emptydirs') - optdepends=('rust-git: to compile and run the programs you can write using this documentation') - provides=('rust-doc' 'rust-docs') - conflicts=('rust-doc' 'rust-docs') - replaces=('rust-doc-git') - - cd rust - - install --directory "$pkgdir"/usr/share/licenses/$pkgname/ - install -m644 COPYRIGHT LICENSE-* "$pkgdir"/usr/share/licenses/$pkgname/ - - cd build/dist/doc - install --directory "$pkgdir"/usr/share/doc - cp -r * "$pkgdir"/usr/share/doc/rust +package_cargo-git() { + local _srcdir=src/tools/cargo + pkgdesc="The Rust package manager" + depends=('rust') + provides=('cargo') + conflicts=('cargo') + pkgver=$(cd "$_gitname/$_srcdir" && echo "$(cargo_pkgver).r$(git rev-list --count HEAD).$(git rev-parse --short HEAD)").rust.$(pkgver) + + cd "$_gitname" + + install_component cargo cargo $_srcdir + + for license in APACHE MIT; do install -Dm644 "LICENSE-$license" \ + "$pkgdir/usr/share/licenses/$pkgname/LICENSE-$license"; done } -package_rust-src-git() { - pkgdesc="Systems programming language focused on safety, speed and concurrency (Source Code)" - arch=('any') - provides=('rust-src') - conflicts=('rust-src') +package_rls-git() { + local _srcdir=src/tools/rls + pkgdesc="Rust language server" + depends=('rust-git' 'rust-src-git' 'rust-analysis-git') + provides=('rls') + conflicts=('rls') + pkgver=$(cd "$_gitname/$_srcdir" && echo "$(cargo_pkgver).r$(git rev-list --count HEAD).$(git rev-parse --short HEAD)").rust.$(pkgver) + + cd "$_gitname" + + install_component rls rls $_srcdir - cd rust - git checkout-index -a --prefix "$pkgdir"/usr/src/rust/ + for license in APACHE MIT; do install -Dm644 "LICENSE-$license" \ + "$pkgdir/usr/share/licenses/$pkgname/LICENSE-$license"; done } |