summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorMusicalArtist122023-11-22 11:48:14 -0700
committerMusicalArtist122023-11-22 11:48:14 -0700
commit70790abd81248d07b4d077eb74ea83111722a983 (patch)
tree65107ce1b8b743c43f3ec2d366386bc72cb01716
parent3acf5e88a131d354c3790a2324a23909930f8259 (diff)
downloadaur-70790abd81248d07b4d077eb74ea83111722a983.tar.gz
build system hotfix
-rw-r--r--PKGBUILD33
-rw-r--r--auto-cpufreq.install43
2 files changed, 36 insertions, 40 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 52b3cec30c2f..af711ac7a656 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -3,7 +3,7 @@
# shellcheck disable=SC2034,2164,2154
pkgname=auto-cpufreq
pkgver=2.1.0
-pkgrel=1
+pkgrel=2
pkgdesc="Automatic CPU speed & power optimizer"
arch=('any')
url="https://github.com/AdnanHodzic/auto-cpufreq"
@@ -30,33 +30,15 @@ sha256sums=('77a5ce9dc8044c5e5bf5770a6c3e16a252f8cef8c80ecc6eed9fefddc6ec825b'
'c89514e12efcb161d678e6c0c978e08faf41a08625bd4a83b893c1e05cd8429e'
)
-build() {
- cd "$srcdir/$pkgname-$pkgver"
- DIR="$srcdir/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 $pkgname\n"
-
- git config --global --add safe.directory $DIR
- python3 -m pip install .
-
- # patch pyvenv.cfg to the final install directory instead of the build directory
- TEMP=$(cat $DIR/venv/pyvenv.cfg | grep -v command)
- echo "$TEMP" > $DIR/venv/pyvenv.cfg
+package() {
+ cd "$srcdir"
- echo "command = /usr/bin/python -m venv /opt/auto-cpufreq/venv" >> $DIR/venv/pyvenv.cfg
+ mkdir -p $pkgdir/opt/$pkgname/
+ mkdir -p $pkgdir/opt/$pkgname/venv/
- echo ""
-}
+ cp -R $pkgname-$pkgver $pkgdir/opt/$pkgname/src
-package() {
- cd "$srcdir/$pkgname-$pkgver"
+ 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"
@@ -73,5 +55,4 @@ package() {
install -Dm644 scripts/style.css "$pkgdir/usr/share/$pkgname/scripts/"
install -Dm644 scripts/auto-cpufreq-gtk.desktop -t "$pkgdir/usr/share/applications/"
- cp -pr $srcdir/opt -t $pkgdir/
}
diff --git a/auto-cpufreq.install b/auto-cpufreq.install
index 066b1c604605..6e0873e7dde1 100644
--- a/auto-cpufreq.install
+++ b/auto-cpufreq.install
@@ -2,28 +2,43 @@ 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 'Important notice: the daemon installer provided does not work, instead run the following command:'
- echo 'systemctl enable --now auto-cpufreq'
- echo ''
- echo 'To view live log, run:'
- echo 'auto-cpufreq --stats'
- echo ''
- echo 'If the GNOME Power Profiles daemon is installed, it must be masked manually as it conflicts with auto-cpufreq.service:'
- echo 'sudo systemctl mask power-profiles-daemon.service'
+ echo -e 'Important notice: the daemon installer provided does not work, instead run the following command:\n'
+ echo -e 'systemctl enable --now auto-cpufreq\n'
+
+ echo -e 'To view live log, run:\n'
+ echo -e 'auto-cpufreq --stats\n'
+
+ echo -e 'If the GNOME Power Profiles daemon is installed, it must be masked manually as it conflicts with auto-cpufreq.service:\n'
+ echo -e 'sudo systemctl mask power-profiles-daemon.service\n'
}
post_upgrade() {
- echo 'Reload systemd manager configuration:'
- echo 'systemctl daemon-reload'
- echo ''
- echo 'Restart auto-cpufreq daemon service:'
- echo 'systemctl restart auto-cpufreq'
- echo ''
+ echo -e 'Reload systemd manager configuration:\n'
+ echo -e 'systemctl daemon-reload\n'
+
+ echo -e 'Restart auto-cpufreq daemon service:\n'
+ echo -e 'systemctl restart auto-cpufreq\n'
}
post_remove() {
# Remove auto-cpufreq log file
rm /var/log/auto-cpufreq.log
+
+ rm -R /opt/cpu-autofreq/
}