diff options
author | MusicalArtist12 | 2023-11-23 10:09:14 -0700 |
---|---|---|
committer | MusicalArtist12 | 2023-11-23 10:09:14 -0700 |
commit | fdc5b48b4b6eb346a5955a309a7fbdbe34c56c38 (patch) | |
tree | 50cfc9406cf7369ffac33ec38d25a469aa26ced3 | |
parent | ec2eb28de252f52fd101511df6c4e99cfeb739d0 (diff) | |
download | aur-fdc5b48b4b6eb346a5955a309a7fbdbe34c56c38.tar.gz |
i RTFM and realized how bad the previous system is
-rw-r--r-- | .SRCINFO | 15 | ||||
-rw-r--r-- | PKGBUILD | 27 | ||||
-rw-r--r-- | auto-cpufreq.install | 32 | ||||
-rw-r--r-- | auto-cpufreq.service | 12 |
4 files changed, 43 insertions, 43 deletions
@@ -1,21 +1,32 @@ pkgbase = auto-cpufreq pkgdesc = Automatic CPU speed & power optimizer pkgver = 2.1.0 - pkgrel = 3 + pkgrel = 4 url = https://github.com/AdnanHodzic/auto-cpufreq install = auto-cpufreq.install arch = any license = LGPL3 + makedepends = python-build + makedepends = python-installer + makedepends = python-wheel + makedepends = python-poetry-core + makedepends = python-poetry-dynamic-versioning depends = python - depends = python-pip depends = python-setuptools + depends = python-psutil + depends = python-click + depends = python-distro + depends = python-requests + depends = python-gobject depends = dmidecode depends = gobject-introspection depends = gtk3 source = auto-cpufreq-2.1.0.tar.gz::https://github.com/AdnanHodzic/auto-cpufreq/archive/v2.1.0.tar.gz + source = auto-cpufreq.service source = 001-fix-icon-n-style-locations.patch source = 002-fix-other-icon-path.patch sha256sums = 77a5ce9dc8044c5e5bf5770a6c3e16a252f8cef8c80ecc6eed9fefddc6ec825b + sha256sums = 296fe1fce542643ee21d1714ce8986f493ddaec6ac63b7aea5bdcbfb1b73d89e sha256sums = afe7e64dbde2ea599b319e8632d72a3c237b5c4275dd31d0f40e39719193a67b sha256sums = c89514e12efcb161d678e6c0c978e08faf41a08625bd4a83b893c1e05cd8429e @@ -4,17 +4,19 @@ # shellcheck disable=SC2034,2164,2154 pkgname=auto-cpufreq pkgver=2.1.0 -pkgrel=3 +pkgrel=4 pkgdesc="Automatic CPU speed & power optimizer" arch=('any') url="https://github.com/AdnanHodzic/auto-cpufreq" license=('LGPL3') -depends=('python' 'python-pip' 'python-setuptools' 'dmidecode' 'gobject-introspection' 'gtk3') +depends=('python' 'python-setuptools' 'python-psutil' 'python-click' 'python-distro' 'python-requests' 'python-gobject' 'dmidecode' 'gobject-introspection' 'gtk3') +makedepends=('python-build' 'python-installer' 'python-wheel' 'python-poetry-core' 'python-poetry-dynamic-versioning' ) install="$pkgname.install" source=( "$pkgname-$pkgver.tar.gz::$url/archive/v$pkgver.tar.gz" + "$pkgname.service" "001-fix-icon-n-style-locations.patch" "002-fix-other-icon-path.patch" ) @@ -24,25 +26,30 @@ prepare() { sed -i 's|usr/local|usr|g' "scripts/${pkgname}.service" auto_cpufreq/core.py patch --strip=2 --input=../001-fix-icon-n-style-locations.patch patch --strip=2 --input=../002-fix-other-icon-path.patch + } sha256sums=('77a5ce9dc8044c5e5bf5770a6c3e16a252f8cef8c80ecc6eed9fefddc6ec825b' + '296fe1fce542643ee21d1714ce8986f493ddaec6ac63b7aea5bdcbfb1b73d89e' 'afe7e64dbde2ea599b319e8632d72a3c237b5c4275dd31d0f40e39719193a67b' 'c89514e12efcb161d678e6c0c978e08faf41a08625bd4a83b893c1e05cd8429e' ) -package() { - cd "$srcdir" - mkdir -p $pkgdir/opt/$pkgname/ - mkdir -p $pkgdir/opt/$pkgname/venv/ +build() { + cd "$srcdir/$pkgname-$pkgver" - cp -R $pkgname-$pkgver $pkgdir/opt/$pkgname/src + POETRY_DYNAMIC_VERSIONING_BYPASS=1 python -m build --wheel --no-isolation +} +package() { + cd "$srcdir" cd $pkgname-$pkgver - install -Dm755 scripts/auto-cpufreq-venv-wrapper "$pkgdir/usr/bin/auto-cpufreq" - install -Dm755 scripts/start_app "$pkgdir/usr/bin/auto-cpufreq-gtk" + python -m installer --destdir="$pkgdir" dist/*.whl + + # install -Dm755 scripts/auto-cpufreq-venv-wrapper "$pkgdir/usr/bin/auto-cpufreq" + # install -Dm755 scripts/start_app "$pkgdir/usr/bin/auto-cpufreq-gtk" install -Dm644 scripts/org.auto-cpufreq.pkexec.policy -t "$pkgdir/usr/share/polkit-1/actions/" install -Dm644 images/icon.png "$pkgdir/usr/share/pixmaps/auto-cpufreq.png" install -Dm644 images/icon.png -t "$pkgdir/usr/share/$pkgname/" @@ -51,7 +58,7 @@ package() { install -Dm755 scripts/auto-cpufreq-install.sh "$pkgdir/usr/share/$pkgname/scripts/" install -Dm755 scripts/auto-cpufreq-remove.sh "$pkgdir/usr/share/$pkgname/scripts/" - install -Dm644 scripts/auto-cpufreq.service "$pkgdir/etc/systemd/system/$pkgname.service" + install -Dm644 $srcdir/auto-cpufreq.service "$pkgdir/etc/systemd/system/$pkgname.service" install -Dm755 scripts/cpufreqctl.sh "$pkgdir/usr/share/$pkgname/scripts/" install -Dm644 scripts/style.css "$pkgdir/usr/share/$pkgname/scripts/" install -Dm644 scripts/auto-cpufreq-gtk.desktop -t "$pkgdir/usr/share/applications/" diff --git a/auto-cpufreq.install b/auto-cpufreq.install index 13c06e1cb206..9df56a901b8a 100644 --- a/auto-cpufreq.install +++ b/auto-cpufreq.install @@ -2,20 +2,6 @@ post_install() { # This is needed on SELinux enabled systems (see also ConditionPathExists in .service) touch /var/log/auto-cpufreq.log - DIR="/opt/auto-cpufreq/" - - echo -e "\nInstalling necessary Python packages\n" - - python -m venv $DIR/venv - source $DIR/venv/bin/activate - echo $(which python) - python3 -m pip install --upgrade pip wheel - - echo -e "\nBuilding auto-cpufreq\n" - - git config --global --add safe.directory $DIR - POETRY_DYNAMIC_VERSIONING_BYPASS=1 python3 -m pip install $DIR/src - echo -e "\nauto-cpufreq $1 installed\n" echo -e 'Important notice: the daemon installer provided does not work, instead run the following command:\n' @@ -28,21 +14,7 @@ post_install() { echo -e 'sudo systemctl mask power-profiles-daemon.service\n' } -post_upgrade() { - DIR="/opt/auto-cpufreq/" - - echo -e "\nInstalling necessary Python packages\n" - - python -m venv $DIR/venv - source $DIR/venv/bin/activate - echo $(which python) - python3 -m pip install --upgrade pip wheel - - echo -e "\nBuilding auto-cpufreq\n" - - git config --global --add safe.directory $DIR - POETRY_DYNAMIC_VERSIONING_BYPASS=1 python3 -m pip install $DIR/src - +post_upgrade() { echo -e "\nauto-cpufreq $1 installed\n" echo -e 'Reload systemd manager configuration:\n' @@ -55,6 +27,4 @@ post_upgrade() { post_remove() { # Remove auto-cpufreq log file rm /var/log/auto-cpufreq.log - - rm -R /opt/cpu-autofreq/ } diff --git a/auto-cpufreq.service b/auto-cpufreq.service new file mode 100644 index 000000000000..390d25d74ce3 --- /dev/null +++ b/auto-cpufreq.service @@ -0,0 +1,12 @@ +[Unit] +Description=auto-cpufreq - Automatic CPU speed & power optimizer for Linux +After=network.target network-online.target + +[Service] +Type=simple +User=root +ExecStart= auto-cpufreq --daemon +Restart=on-failure + +[Install] +WantedBy=multi-user.target |