Commit 3cb974b

kravantokh <kravantokh@noreply.codeberg.org>
2026-07-23 16:10:08
Add missing executables. main
1 parent 8ce9944
Changed files (1)
PKGBUILD
@@ -14,6 +14,21 @@ prepare() {
 	cd "${pkgname}-${pkgver}"
 	sed -i 's@/usr/local/lib/ghelper/@/usr/lib/ghelper/@g' ./install/ghelper-gpu-boot.service
 	echo -e "asus_nb_wmi\nasus_wmi" > ghelper.conf
+
+	SUDOERS_CONTENT="# G-Helper: passwordless access to the root-owned helper binaries
+ALL ALL=(root) NOPASSWD: /usr/lib/ghelper/gpu-block-helper.sh
+ALL ALL=(root) NOPASSWD: /usr/lib/ghelper/gpu-helper"
+
+	echo "$SUDOERS_CONTENT" > sudoers
+
+	sed -i 's@/usr/local/lib/ghelper/gpu-block-helper.sh@/usr/lib/ghelper/gpu-block-helper.sh@g' ./src/Install/Installer.cs
+	sed -i 's@/usr/local/lib/ghelper/ghelper-gpu-boot.sh@/usr/lib/ghelper/ghelper-gpu-boot.sh@g' ./src/Install/Installer.cs
+	sed -i 's@/etc/systemd/system/ghelper-gpu-boot.service@/usr/lib/systemd/system/ghelper-gpu-boot.service@g' ./src/Install/Installer.cs
+	sed -i 's@/etc/udev/rules.d/90-ghelper.rules@/usr/lib/udev/rules.d/90-ghelper.rules@g' ./src/Install/Installer.cs
+	sed -i 's@/etc/modules-load.d/ghelper.conf@/usr/lib/modules-load.d/ghelper.conf@g' ./src/Install/Installer.cs
+	sed -i 's@/etc/ghelper/gpu-helper@/usr/lib/ghelper/gpu-helper@g' ./src/Platform/Linux/SysfsHelper.cs
+	sed -i 's@/opt/ghelper/gpu-helper@/usr/lib/ghelper/gpu-helper@g' ./src/Platform/Linux/SysfsHelper.cs 
+	sed -i 's@rm -f "\$GPU_HELPER_DIR/gpu-helper"@echo "Not deleting the needed artifacts."@' ./build.sh
 }
 
 build() {
@@ -26,9 +41,12 @@ package() {
 	install -Dm755 "./dist/ghelper" "$pkgdir/usr/bin/ghelper"
 	install -Dm644 "./install/90-ghelper.rules" "$pkgdir/usr/lib/udev/rules.d/90-ghelper.rules"
 	install -Dm755 "./install/ghelper-gpu-boot.sh" "$pkgdir/usr/lib/ghelper/ghelper-gpu-boot.sh"
+	install -Dm755 "./install/gpu-block-helper.sh" "$pkgdir/usr/lib/ghelper/gpu-block-helper.sh"
+	install -Dm755 "./vendor/gpu-helper/gpu-helper" "$pkgdir/usr/lib/ghelper/gpu-helper"
 	install -Dm644 "./install/ghelper-gpu-boot.service" "$pkgdir/usr/lib/systemd/system/ghelper-gpu-boot.service"
 	install -Dm644 "./install/ghelper.desktop" "$pkgdir/usr/share/applications/ghelper.desktop"
 	install -Dm644 "./install/ghelper.png" "$pkgdir/usr/share/icons/hicolor/256x256/apps/ghelper.png"
 	install -Dm644 "./ghelper.conf" "$pkgdir/usr/lib/modules-load.d/ghelper.conf"
+	install -Dm0440 "./sudoers" "$pkgdir/etc/sudoers.d/ghelper-gpu"
 }