Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 17 additions & 14 deletions tools/linux/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -26,50 +26,53 @@ source=("$pkgname-$pkgver.tar.gz::https://github.com/MonoEven/Autohotkey_Linux/a
sha256sums=('abb9e087e34ec957b9cda88752e5c0bb1ea11e5d1cf4dd106c50e7bfc557b27d')

build() {
export srcrepo="$srcdir"/$(tar --exclude='*/*' -tvf "$srcdir"/"$pkgname-$pkgver.tar.gz" | awk '{print $NF}')
cd $srcrepo
cmake -S . -B build-core -G Ninja \
-DCMAKE_BUILD_TYPE=Release
cmake --build build-core
}

package() {
install -Dm755 "$srcdir"/build-core/source/linux/core/ahk_core \
install -Dm755 "$srcrepo"/build-core/source/linux/core/ahk_core \
"$pkgdir"/usr/share/autohotkey/ahk_core
install -Dm755 "$srcdir"/build-core/source/linux/inputd/ahk-inputd \
install -Dm755 "$srcrepo"/build-core/source/linux/inputd/ahk-inputd \
"$pkgdir"/usr/share/autohotkey/ahk-inputd
install -Dm644 "$srcdir"/tools/linux/systemd/ahk-inputd.socket \
install -Dm644 "$srcrepo"/tools/linux/systemd/ahk-inputd.socket \
"$pkgdir"/usr/lib/systemd/system/ahk-inputd.socket
sed 's|@INPUTD_EXEC@|/usr/share/autohotkey/ahk-inputd|g' \
"$srcdir"/tools/linux/systemd/ahk-inputd.service.in \
"$srcrepo"/tools/linux/systemd/ahk-inputd.service.in \
> "$pkgdir"/usr/lib/systemd/system/ahk-inputd.service
chmod 644 "$pkgdir"/usr/lib/systemd/system/ahk-inputd.service
# Official upstream AutoHotkey icon: SNI pixmap + freedesktop theme name.
install -Dm644 "$srcdir"/source/resources/icon_main.ico \
install -Dm644 "$srcrepo"/source/resources/icon_main.ico \
"$pkgdir"/usr/share/autohotkey/icon_main.ico
install -Dm644 "$srcdir"/docs-v2/docs/static/ahk16.png \
install -Dm644 "$srcrepo"/docs-v2/docs/static/ahk16.png \
"$pkgdir"/usr/share/autohotkey/autohotkey.png
install -Dm644 "$srcdir"/docs-v2/docs/static/ahk16.png \
install -Dm644 "$srcrepo"/docs-v2/docs/static/ahk16.png \
"$pkgdir"/usr/share/icons/hicolor/16x16/apps/autohotkey.png
# launcher: full --update/--uninstall/--check rendered from the shared
# template; the package layout matches /usr, so the launcher's
# install-method detection (pacman) works on Arch.
install -Dm755 "$srcrepo"/tools/linux/ahk-launcher.in "$pkgdir/usr/bin/ahk"
sed -e 's|@PREFIX@|/usr|g' \
-e 's|@LIB_SUB@|share/autohotkey|g' \
-e 's|@BIN_SUB@|bin|g' \
-e 's|@DOC_SUB@|share/doc/autohotkey|g' \
-e "s|@AHK_VERSION@|$pkgver|g" \
"$srcdir"/tools/linux/ahk-launcher.in > "$pkgdir/usr/bin/ahk"
"$srcrepo"/tools/linux/ahk-launcher.in > "$pkgdir/usr/bin/ahk"
chmod 755 "$pkgdir/usr/bin/ahk"
# docs
install -d "$pkgdir/usr/share/doc/autohotkey"
cp -r "$srcdir"/docs-v2 "$pkgdir/usr/share/doc/autohotkey/docs-v2"
cp -r "$srcdir"/examples "$pkgdir/usr/share/doc/autohotkey/examples"
install -Dm644 "$srcdir/README.md" "$pkgdir/usr/share/doc/autohotkey/README.md"
install -Dm644 "$srcdir/LICENSE" "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
cp -r "$srcrepo"/docs-v2 "$pkgdir/usr/share/doc/autohotkey/docs-v2"
cp -r "$srcrepo"/examples "$pkgdir/usr/share/doc/autohotkey/examples"
install -Dm644 "$srcrepo/README.md" "$pkgdir/usr/share/doc/autohotkey/README.md"
install -Dm644 "$srcrepo/LICENSE" "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
# GNOME Shell global-hotkey extension (system-wide; pacman lifecycle:
# upgrades replace it, removal deletes it; enable per user via
# gnome-extensions enable, see post_install below).
EXT="$pkgdir/usr/share/gnome-shell/extensions/ahk-global-hotkeys@autohotkey.org"
install -d "$EXT"
install -Dm644 "$srcdir"/extension/ahk-global-hotkeys@autohotkey.org/metadata.json "$EXT/metadata.json"
install -Dm644 "$srcdir"/extension/ahk-global-hotkeys@autohotkey.org/extension.js "$EXT/extension.js"
install -Dm644 "$srcrepo"/extension/ahk-global-hotkeys@autohotkey.org/metadata.json "$EXT/metadata.json"
install -Dm644 "$srcrepo"/extension/ahk-global-hotkeys@autohotkey.org/extension.js "$EXT/extension.js"
}