summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorCaleb Bassi2020-01-13 14:03:56 -0800
committerCaleb Bassi2020-01-13 14:03:56 -0800
commit04c17cd7e376aea20480262580e0f95fe068901f (patch)
treed28b779cdb2da38a2106ee5dc36ddfde18aa4c04
downloadaur-04c17cd7e376aea20480262580e0f95fe068901f.tar.gz
Initial commit
-rw-r--r--.SRCINFO16
-rw-r--r--PKGBUILD42
2 files changed, 58 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..5aac4bdf8027
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,16 @@
+pkgbase = ytop-git
+ pkgdesc = A TUI system monitor written in Rust
+ pkgver = r85.0611d52
+ pkgrel = 1
+ url = https://github.com/cjbassi/ytop
+ arch = x86_64
+ license = MIT
+ makedepends = git
+ makedepends = cargo
+ provides = ytop
+ conflicts = ytop
+ source = git+https://github.com/cjbassi/ytop
+ md5sums = SKIP
+
+pkgname = ytop-git
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..1005eacb3cdd
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,42 @@
+# Maintainer: Caleb Bassi <calebjbassi@gmail.com>
+
+pkgname=ytop-git
+_pkgname=${pkgname%-git}
+pkgver=r85.0611d52
+pkgrel=1
+pkgdesc="A TUI system monitor written in Rust"
+arch=(x86_64)
+url="https://github.com/cjbassi/ytop"
+license=("MIT")
+makedepends=("git" "cargo")
+provides=(${_pkgname})
+conflicts=(${_pkgname})
+source=("git+${url}")
+md5sums=("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)"
+ )
+}
+
+# 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
+}
+
+package() {
+ install -Dm755 "${srcdir}/${_pkgname}/target/release/${_pkgname}" "${pkgdir}/usr/bin/${_pkgname}"
+}