Skip to content

Instantly share code, notes, and snippets.

@p0358
Created February 11, 2026 19:53
Show Gist options
  • Select an option

  • Save p0358/b1975e23f8208fb0e1a2774d7ff9d6e6 to your computer and use it in GitHub Desktop.

Select an option

Save p0358/b1975e23f8208fb0e1a2774d7ff9d6e6 to your computer and use it in GitHub Desktop.
Improvements to AUR `pince` package
diff --git a/.SRCINFO b/.SRCINFO
index eba5453..2188c3b 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,9 +1,8 @@
pkgbase = pince
pkgdesc = A Linux reverse engineering tool inspired by Cheat Engine.
pkgver = 0.4.5
- pkgrel = 1
+ pkgrel = 2
url = https://github.com/korcankaraokcu/PINCE
- install = note.install
arch = any
license = GPL-3.0-or-later WITH CC-BY-3.0
makedepends = cmake
@@ -15,9 +14,13 @@ pkgbase = pince
makedepends = sed
optdepends = qt6-wayland: wayland support
source = pince::git+https://github.com/korcankaraokcu/PINCE.git#tag=v0.4.5
- source = PINCE.desktop
- sha1sums = d805da72c8be7b284c2642d2d8c6c6513a3008e4
- sha1sums = 719d18d69abc299f739cc04041967e9d05a34104
+ source = pince.desktop
+ source = pince.sh
+ source = io.github.korcankaraokcu.PINCE.policy
+ sha256sums = 381dafd683fdad1b476fb4fbcf96fa91e613540f06ea4071020bc7e60cf1de5a
+ sha256sums = c3497150719bc7ed20d5a5ad882d7405f5fc2eab127fdc9a17798c9cc1342da7
+ sha256sums = 58bbcddf4ef9415ea14a6b38221ea9d56523aa71d25f97ff8462e135a25ac464
+ sha256sums = 528a66294cbf93e141b392c41b3e972973fe39a79161d0c91c09928b78406c42
pkgname = pince
depends = gdb
diff --git a/.gitignore b/.gitignore
index 4cc2389..46ee07e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,4 +3,6 @@
!PKGBUILD
!.gitignore
!PINCE.*
+!pince.*
+!*.policy
!*.install
diff --git a/PKGBUILD b/PKGBUILD
index 8f5f8d8..9aa821b 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,11 +1,12 @@
# Maintainer: detiam <dehe_tian at outlook dot com>
# Contributor: Jakob Kreuze <jakob@memeware.net>
# Contributor: Bader <Bad3r@unsigned.sh>
+# Contributor: p0358
# shellcheck disable=SC1090,SC2207
pkgname=pince
pkgver=0.4.5
-pkgrel=1
+pkgrel=2
pkgdesc="A Linux reverse engineering tool inspired by Cheat Engine."
arch=('any')
url="https://github.com/korcankaraokcu/PINCE"
@@ -15,11 +16,15 @@ makedepends=('cmake' 'python-pip' 'qt6-tools' 'lsb-release' 'pkgconf' 'git' 'sed
optdepends=(
'qt6-wayland: wayland support'
)
-source=("$pkgname::git+$url.git#tag=v$pkgver" 'PINCE.desktop')
-install="note.install"
-sha1sums=('d805da72c8be7b284c2642d2d8c6c6513a3008e4'
- '719d18d69abc299f739cc04041967e9d05a34104')
-_installpath='/usr/share/PINCE'
+source=("$pkgname::git+$url.git#tag=v$pkgver"
+ 'pince.desktop'
+ 'pince.sh'
+ 'io.github.korcankaraokcu.PINCE.policy')
+sha256sums=('381dafd683fdad1b476fb4fbcf96fa91e613540f06ea4071020bc7e60cf1de5a'
+ 'c3497150719bc7ed20d5a5ad882d7405f5fc2eab127fdc9a17798c9cc1342da7'
+ '58bbcddf4ef9415ea14a6b38221ea9d56523aa71d25f97ff8462e135a25ac464'
+ '528a66294cbf93e141b392c41b3e972973fe39a79161d0c91c09928b78406c42')
+_installpath='/usr/lib/pince'
_installsh='install.sh'
prepare() {
@@ -48,9 +53,9 @@ build() {
}
package() {
- # Install desktop entity
- install -d "$pkgdir"/usr/share/applications
- install -Dm755 PINCE.desktop "$pkgdir/usr/share/applications"
+ install -Dm755 pince.sh "$pkgdir/usr/bin/pince"
+ install -Dm644 pince.desktop -t "$pkgdir/usr/share/applications/"
+ install -Dm644 io.github.korcankaraokcu.PINCE.policy -t "$pkgdir/usr/share/polkit-1/actions/"
pushd "$pkgname" || exit 1
@@ -89,37 +94,16 @@ package() {
depends=($(printf "%s\n" "${depends[@]}" | sort -u))
- # Copy files
- install -d "$pkgdir/usr/bin"
+ # Copy app files
install -d "$pkgdir/$_installpath/i18n"
- install PINCE.sh PINCE.py \
- COPYING COPYING.CC-BY AUTHORS THANKS "$pkgdir/$_installpath"
- cp -r GUI libpince media tr "$pkgdir/$_installpath"
+ install -Dm755 PINCE.py -t "$pkgdir/$_installpath/"
+ cp -r GUI libpince media tr "$pkgdir/$_installpath/"
cp -r i18n/qm "$pkgdir/$_installpath/i18n"
- # Create a start script
- install -Dm755 /dev/stdin "$pkgdir/usr/bin/pince" <<- SHELL
- #!/usr/bin/env bash
-
- syncicon() {
- local logo_path iconpath destpath
- . <(grep '^logo_path=.*' "\${XDG_CONFIG_HOME:-"\$HOME/.config"}/PINCE/PINCE.conf")
- iconpath="/usr/share/PINCE/media/logo/\$logo_path"
- destpath="\${XDG_DATA_HOME:-"\$HOME/.local/share"}/icons/hicolor/256x256/apps/PINCE.png"
- mkdir -p "\$(dirname "\$destpath")"
- ln -sf "\$iconpath" "\$destpath"
- echo -e "\nDesktop icon updated: \$destpath"
- echo "If the setting of icon changed, Re-login for setting to take effect."
- }
-
- pushd "$_installpath" || exit 1
- sh PINCE.sh "\$@"
- syncicon
- popd || exit 1
-
- read -p "Press enter to exit..."
-
- SHELL
+ # Copy system files
+ install -Dm644 COPYING COPYING.CC-BY -t "$pkgdir"/usr/share/licenses/$pkgname/
+ install -Dm644 README.md AUTHORS THANKS -t "$pkgdir"/usr/share/doc/$pkgname/
+ install -Dm644 media/logo/ozgurozbek/pince_small_transparent.png "$pkgdir"/usr/share/icons/hicolor/256x256/apps/pince.png
popd || exit 1
diff --git a/io.github.korcankaraokcu.PINCE.policy b/io.github.korcankaraokcu.PINCE.policy
new file mode 100644
index 0000000..5b0e2c3
--- /dev/null
+++ b/io.github.korcankaraokcu.PINCE.policy
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE policyconfig PUBLIC "-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN" "http://www.freedesktop.org/standards/PolicyKit/1/policyconfig.dtd">
+<policyconfig>
+ <vendor>PINCE</vendor>
+ <vendor_url>https://github.com/korcankaraokcu/PINCE</vendor_url>
+ <icon_name>pince</icon_name>
+ <action id="io.github.korcankaraokcu.PINCE">
+ <description>Run PINCE as root</description>
+ <message>Authentication is required to run PINCE as root</message>
+ <defaults>
+ <allow_any>auth_admin</allow_any>
+ <allow_inactive>auth_admin</allow_inactive>
+ <allow_active>auth_admin</allow_active>
+ </defaults>
+ <annotate key="org.freedesktop.policykit.exec.path">/usr/bin/pince</annotate>
+ <annotate key="org.freedesktop.policykit.exec.allow_gui">true</annotate>
+ </action>
+</policyconfig>
diff --git a/note.install b/note.install
deleted file mode 100644
index 4c78ba5..0000000
--- a/note.install
+++ /dev/null
@@ -1,18 +0,0 @@
-# Colored makepkg-like functions
-msg_blue() {
- printf "${blue}==>${bold} $1${all_off}\n"
-}
-
-note() {
- printf "${blue}==>${yellow} NOTE:${bold} $1${all_off}\n"
-}
-
-all_off="$(tput sgr0)"
-bold="${all_off}$(tput bold)"
-blue="${bold}$(tput setaf 4)"
-yellow="${bold}$(tput setaf 3)"
-
-pre_remove() {
- note 'You probably want to remove the following file.'
- msg_blue "\${XDG_DATA_HOME:-"\$HOME/.local/share"}/icons/hicolor/256x256/apps/PINCE.png"
-}
diff --git a/PINCE.desktop b/pince.desktop
similarity index 57%
rename from PINCE.desktop
rename to pince.desktop
index 5aab128..fbb2642 100644
--- a/PINCE.desktop
+++ b/pince.desktop
@@ -3,10 +3,11 @@ Name=PINCE
Comment=Reverse engineering tool for linux games
Comment[zh_CN]=用于 Linux 游戏的逆向工程工具
GenericName=PINCE
-Exec=pince %U
-Icon=PINCE
+Exec=pkexec /usr/bin/pince
+Icon=pince
Type=Application
-Terminal=true
+Terminal=false
StartupNotify=false
+# https://github.com/korcankaraokcu/PINCE/issues/313
+StartupWMClass=com/korcankaraokcu/PINCE.github.python3
Categories=Qt;Utility;Development;
-MimeType=x-scheme-handler/PINCE;
diff --git a/pince.sh b/pince.sh
new file mode 100755
index 0000000..f2782d1
--- /dev/null
+++ b/pince.sh
@@ -0,0 +1,2 @@
+#!/bin/sh
+exec /usr/lib/pince/PINCE.py "$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment