diff options
author | Caleb Bassi | 2020-01-18 10:40:49 -0800 |
---|---|---|
committer | Caleb Bassi | 2020-01-18 10:40:49 -0800 |
commit | 9da222b06206cb1855664cf567c79445ae8f7369 (patch) | |
tree | e205037d0a69a3e7b37a3f344264cef89353fe7f /PKGBUILD | |
parent | 04c17cd7e376aea20480262580e0f95fe068901f (diff) | |
download | aur-9da222b06206cb1855664cf567c79445ae8f7369.tar.gz |
Refactor pkgbuild
Diffstat (limited to 'PKGBUILD')
-rw-r--r-- | PKGBUILD | 35 |
1 files changed, 14 insertions, 21 deletions
@@ -1,8 +1,11 @@ # Maintainer: Caleb Bassi <calebjbassi@gmail.com> +# https://wiki.archlinux.org/index.php/VCS_package_guidelines +# https://wiki.archlinux.org/index.php/Rust_package_guidelines + pkgname=ytop-git _pkgname=${pkgname%-git} -pkgver=r85.0611d52 +pkgver=r101.115fb7f pkgrel=1 pkgdesc="A TUI system monitor written in Rust" arch=(x86_64) @@ -11,32 +14,22 @@ license=("MIT") makedepends=("git" "cargo") provides=(${_pkgname}) conflicts=(${_pkgname}) -source=("git+${url}") -md5sums=("SKIP") +source=("${_pkgname}::git+${url}") +sha256sums=("SKIP") -# https://wiki.archlinux.org/index.php/VCS_package_guidelines pkgver() { - cd "${_pkgname}" - ( set -o pipefail - git describe --long 2>/dev/null | sed 's/\([^-]*-g\)/r\1/;s/-/./g' || - printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" - ) + cd "${_pkgname}" + ( set -o pipefail + git describe --long 2>/dev/null | sed 's/\([^-]*-g\)/r\1/;s/-/./g' || + printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" + ) } -# https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=loop build() { - cd "${_pkgname}" - if command -v rustup > /dev/null 2>&1; then - RUSTFLAGS="-C target-cpu=native" rustup run stable \ - cargo build --release - elif rustc --version | grep -q nightly; then - RUSTFLAGS="-C target-cpu=native" \ - cargo build --release - else - cargo build --release - fi + cd "${_pkgname}" + cargo build --release --locked --all-features } package() { - install -Dm755 "${srcdir}/${_pkgname}/target/release/${_pkgname}" "${pkgdir}/usr/bin/${_pkgname}" + install -Dm755 "${srcdir}/${_pkgname}/target/release/${_pkgname}" "${pkgdir}/usr/bin/${_pkgname}" } |