archpkgs/elan/PKGBUILD
2020-12-26 19:51:36 +01:00

39 lines
1.5 KiB
Bash

pkgname=elan
pkgver=0.10.2
pkgrel=1
pkgdesc="Lean version manager"
arch=('x86_64')
url="https://github.com/Kha/elan"
license=('MIT' 'Apache')
depends=('curl' 'xz')
makedepends=('cargo')
provides=('lean')
conflicts=('lean')
source=("elan-${pkgver}.tar.gz::https://github.com/kha/elan/archive/v${pkgver}.tar.gz")
sha512sums=('d4d32ddc33285acaedea0aa781c24b589e5ee1e1a438aad1d4f854c0eb9d59f14287acce84fd2892748fdf25f4c5da34026cb6692cdccab2175d8c872bfcaf74')
_binlinks=(lean leanpkg leanchecker leanc leanmake)
build() {
cd "$srcdir/$pkgname-${pkgver}"
cargo build --release --features no-self-update
}
package() {
cd "$pkgname-${pkgver}"
install -Dm755 "target/release/elan-init" "${pkgdir}/usr/bin/elan"
for link in "${_binlinks[@]}"; do
ln -s /usr/bin/elan "${pkgdir}/usr/bin/${link}"
done
# Generate completion files.
mkdir -p "$pkgdir/usr/share/bash-completion/completions"
"$pkgdir"/usr/bin/elan completions bash > "$pkgdir/usr/share/bash-completion/completions/elan"
mkdir -p "$pkgdir/usr/share/fish/vendor_completions.d"
"$pkgdir"/usr/bin/elan completions fish > "$pkgdir/usr/share/fish/vendor_completions.d/elan.fish"
mkdir -p "$pkgdir/usr/share/zsh/site-functions"
"$pkgdir"/usr/bin/elan completions zsh > "$pkgdir/usr/share/zsh/site-functions/_elan"
install -Dm644 LICENSE-MIT "${pkgdir}"/usr/share/licenses/$pkgname/LICENSE-MIT
install -Dm644 LICENSE-APACHE "${pkgdir}"/usr/share/licenses/$pkgname/LICENSE-APACHE
}