diff options
author | Amolith | 2024-01-05 16:58:09 -0500 |
---|---|---|
committer | Amolith | 2024-01-05 16:58:41 -0500 |
commit | 71f6aa1ceb4079ff1889f17ce49134971cf9e490 (patch) | |
tree | fe951ecd0145a46288e20dff63370ee8929b9593 | |
download | aur-71f6aa1ceb4079ff1889f17ce49134971cf9e490.tar.gz |
Initial commit
-rw-r--r-- | .SRCINFO | 17 | ||||
-rw-r--r-- | .gitignore | 4 | ||||
-rw-r--r-- | PKGBUILD | 47 |
3 files changed, 68 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..cdd2782cfffa --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,17 @@ +pkgbase = watt-wiser-sensors-git + pkgdesc = A software energy consumption estimation tool + pkgver = r68.ff39752 + pkgrel = 1 + url = https://git.sr.ht/~whereswaldon/watt-wiser + arch = any + license = Unlicense + makedepends = git + makedepends = go + makedepends = gcc + makedepends = lm_sensors + provides = watt-wiser-sensors + conflicts = watt-wiser-sensors + source = watt-wiser::git+https://git.sr.ht/~whereswaldon/watt-wiser#branch=main + sha256sums = SKIP + +pkgname = watt-wiser-sensors-git diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000000..d850cdb19a96 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +*.pkg.tar.zst +/watt-wiser/ +/pkg/ +/src/ diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..ccabaf6af4c2 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,47 @@ +# Maintainer: Amolith <amolith@secluded.site> +pkgname=watt-wiser-sensors-git +_pkgname=${pkgname%-git} +_repo=watt-wiser +pkgdesc='A software energy consumption estimation tool' +arch=("any") +url="https://git.sr.ht/~whereswaldon/$_repo" +_branch='main' +pkgver=r68.ff39752 +pkgrel=1 +license=("Unlicense") +makedepends=("git" "go" "gcc" "lm_sensors") +source=("$_repo::git+$url#branch=$_branch") +sha256sums=("SKIP") +provides=($_pkgname) +conflicts=($_pkgname) + +pkgver() { + cd "$_repo" + ( set -o pipefail + git describe --long --abbrev=7 2>/dev/null | sed 's/\([^-]*-g\)/r\1/;s/-/./g' || + printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short=7 HEAD)" + ) +} + +build() { + cd $_repo + + export CGO_LDFLAGS="${LDFLAGS}" + export CGO_CFLAGS="${CFLAGS}" + export CGO_CPPFLAGS="${CPPFLAGS}" + export CGO_CXXFLAGS="${CXXFLAGS}" + export GOFLAGS="-buildmode=pie -trimpath -ldflags=-linkmode=external -mod=readonly -modcacherw" + + go build -o "$_pkgname" . +} + +check() { + cd "$_repo" + go test ./... +} + +package() { + cd "$_repo" + install -Dm755 "$_pkgname" "$pkgdir/usr/bin/$_pkgname" + install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$_pkgname/LICENSE" +} |