commit abd28f52c13fa7fddae7c95230b220ebc28dd3a9 Author: Virt <41426325+VirtCode@users.noreply.github.com> Date: Thu May 22 11:22:21 2025 +0200 init: pkgbuild with service file diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 0000000..63b6133 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,15 @@ +pkgbase = watt + pkgdesc = Modern CPU frequency and power management utility for Linux + pkgver = 0.3.1 + pkgrel = 1 + url = https://github.com/NotAShelf/watt + arch = x86_64 + arch = armv7h + license = MPL-2.0 + makedepends = cargo + source = watt-0.3.1.tar.gz::https://github.com/NotAShelf/watt/archive/refs/tags/v0.3.1.tar.gz + source = watt.service + sha256sums = 406834dae5e4734987d5777e207b62cb4e89f7acc992a423215ee38e99d88191 + sha256sums = SKIP + +pkgname = watt diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a66793b --- /dev/null +++ b/.gitignore @@ -0,0 +1,7 @@ +* + +!.gitignore +!PKGBUILD +!.SRCINFO + +!watt.service diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 0000000..d20b827 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,42 @@ +# Maintainer: Virt + +pkgname=watt +pkgver=0.3.1 +pkgrel=1 +pkgdesc='Modern CPU frequency and power management utility for Linux' +url='https://github.com/NotAShelf/watt' + +license=('MPL-2.0') +makedepends=('cargo') +depends=() +arch=('x86_64' 'armv7h') + +source=("$pkgname-$pkgver.tar.gz::$url/archive/refs/tags/v$pkgver.tar.gz" "$pkgname.service") +sha256sums=('406834dae5e4734987d5777e207b62cb4e89f7acc992a423215ee38e99d88191' 'SKIP') + +prepare() { + cd "$pkgname-$pkgver" + + export RUSTUP_TOOLCHAIN=stable + cargo fetch --locked --target "$(rustc -vV | sed -n 's/host: //p')" +} + +build() { + cd "$pkgname-$pkgver" + + export RUSTUP_TOOLCHAIN=stable + export CARGO_TARGET_DIR=target + cargo build --frozen --release --all-features +} + +package() { + # install custom systemd service adapted from the nix module + install -Dm644 "$pkgname.service" "$pkgdir/usr/lib/systemd/system/$pkgname.service" + + cd "$pkgname-$pkgver" + + # TODO: revert this + install -Dm0755 -t "$pkgdir/usr/bin/$pkgname" "target/release/superfreq" + install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE" +} + diff --git a/watt.service b/watt.service new file mode 100644 index 0000000..3cfbcf3 --- /dev/null +++ b/watt.service @@ -0,0 +1,13 @@ +[Unit] +Description=Modern CPU frequency and power management utility for Linux +Conflicts=auto-cpufreq.service power-profiles-daemon.service tlp.service cpupower-gui.service thermald.service + +[Service] +ExecStart=/usr/bin/superfreq daemon --verbose +Restart=on-failure + +RuntimeDirectory=superfreq +RuntimeDirectoryMode=0755 + +[Install] +WantedBy=multi-user.target