Files
omarchy-pkgs/pkgbuilds/omarchy-power-profiles-daemon/PKGBUILD
T
David Heinemeier HanssonandClaude Opus 5.5 cbded97503 Add omarchy-power-profiles-daemon 0.30, with a CPPC driver for ARM laptops (#897)
power-profiles-daemon only drives intel_pstate, amd_pstate and ACPI
platform_profile, so ARM laptops on cppc_cpufreq (NVIDIA N1X, Snapdragon X)
get placeholder profiles that change nothing and no performance profile.

This packages upstream 0.30 with a CPPC driver patch: balanced (EPP 64) and
power-saver (EPP 192) use CPPC autonomous frequency selection, performance
runs the performance governor. The driver only claims policies with the
schedutil and performance governors and writable autonomous selection knobs,
restores probe-time settings if the first activation fails, and reapplies the
profile on resume. The package provides and conflicts with
power-profiles-daemon, and fixes the powerprofilesctl shebang at package time
so Omarchy no longer needs to sed it.

Tested on an NVIDIA N1X laptop: median keystroke-to-frame latency in Chromium
went from ~130ms (schedutil) to ~56ms on balanced at the same idle power, and
~32ms on performance, which Omarchy selects on AC. All 137 upstream tests
pass, including five new CPPC tests.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-09 14:40:56 +00:00

69 lines
2.1 KiB
Bash

# Maintainer: David Heinemeier Hansson <david@hey.com>
# Contributor: Antonio Rojas <arojas@archlinux.org>
# Contributor: tinywrkb <tinywrkb@gmail.com>
pkgname=omarchy-power-profiles-daemon
_pkgname=power-profiles-daemon
pkgver=0.30
pkgrel=1
pkgdesc='Makes power profiles handling available over D-Bus (with CPPC support for ARM laptops)'
url='https://gitlab.freedesktop.org/upower/power-profiles-daemon'
license=(GPL-3.0-only)
arch=(x86_64 aarch64)
depends=(glib2
glibc
libgcc
libgudev
polkit
upower)
optdepends=('python-gobject: for powerprofilesctl')
makedepends=(bash-completion
git
glib2-devel
python-argparse-manpage
python-shtab
meson)
checkdepends=(python-dbusmock
python-isort
python-mccabe
umockdev)
provides=(power-profiles-daemon)
conflicts=(power-profiles-daemon)
source=(git+https://gitlab.freedesktop.org/upower/$_pkgname#tag=$pkgver
cppc-cpufreq-driver.patch)
sha256sums=('e955e833b01cbff9b5b00349592239e58c559d717eb49f3371f42932676e7a40'
'7fc9d53cc5c5d07cafbff1d249544128d3d11e4a5cfd3784d7a55dee5870cddb')
prepare() {
cd $_pkgname
# Upstream only drives intel_pstate, amd_pstate and ACPI platform_profile, so
# ARM laptops on cppc_cpufreq (NVIDIA N1X, Snapdragon X) get placeholder
# profiles that change nothing. This adds a CPPC driver: balanced and
# power-saver use CPPC autonomous frequency selection, performance runs the
# performance governor.
patch -p1 -i "$srcdir/cppc-cpufreq-driver.patch"
}
build() {
meson $_pkgname build \
--prefix /usr \
--libexec lib \
--sysconfdir /usr/share \
-Dzshcomp=/usr/share/zsh/site-functions \
-Dbashcomp=enabled \
-Dmanpage=enabled
meson compile -C build
}
check() {
meson test -C build
}
package() {
meson install -C build --destdir "$pkgdir"
# Run powerprofilesctl with the system Python, not whichever python3 a mise
# or venv puts first on PATH, which lacks PyGObject.
sed -i '1c #!/usr/bin/python3' "$pkgdir/usr/bin/powerprofilesctl"
}