diff --git a/gitkraken-aur/.SRCINFO b/gitkraken-aur/.SRCINFO index 8c8a2d6..7b17db4 100644 --- a/gitkraken-aur/.SRCINFO +++ b/gitkraken-aur/.SRCINFO @@ -1,7 +1,7 @@ pkgbase = gitkraken pkgdesc = The intuitive, fast, and beautiful cross-platform Git client. pkgver = 12.2.1 - pkgrel = 1 + pkgrel = 2 url = https://www.gitkraken.com/ arch = x86_64 arch = aarch64 @@ -16,11 +16,13 @@ pkgbase = gitkraken options = !strip options = !debug source = GitKraken.desktop + source = gitkraken-url-handler.desktop + source = gk-cli-url-handler.desktop source = eula.html - source = gitkraken.sh - sha256sums = 078fa2cdf6826d956bf73387fb2ef147b1aca5f4a7a3cb4be8c71e6105fc9c6c + sha256sums = af2d2e5a44ec6e543c34f94cfb89fe34b6c05d2baf6ca9db5b6d332e4a5686e5 + sha256sums = 4342596839114228740e5d61cdc49fbe9e98d05d1aabe2694ffe9d48ffd4082e + sha256sums = 4b3eaf932b79e8f1d6a6a6efd030e73cb544d3d0fbe6bf7b61b884f4c6042b0a sha256sums = 5b7b39b331bc32a606e1e79c695df4519c9b220225be00fb34ef368c3af319a6 - sha256sums = c78ef86324946f856cc5c11549990722155a5e883dc94f92a95169c7ab5fb63e source_x86_64 = gitkraken-12.2.1-x86_64.tar.gz::https://api.gitkraken.dev/releases/production/linux/x64/12.2.1/gitkraken-amd64.tar.gz sha256sums_x86_64 = 939aa5dbffde7e76e8bff922f2b5febdcf01cc037e7770400c49e2523d8f132f source_aarch64 = gitkraken-12.2.1-aarch64.tar.gz::https://api.gitkraken.dev/releases/production/linux/arm64/12.2.1/gitkraken-aarch64.tar.gz diff --git a/gitkraken-aur/GitKraken.desktop b/gitkraken-aur/GitKraken.desktop old mode 100755 new mode 100644 index a49cb98..6ec7ec6 --- a/gitkraken-aur/GitKraken.desktop +++ b/gitkraken-aur/GitKraken.desktop @@ -2,9 +2,8 @@ Name=GitKraken Comment=Unleash your repo GenericName=Git Client -Exec=gitkraken %f +Exec=/opt/gitkraken/gitkraken %U Icon=gitkraken -Terminal=false Type=Application StartupNotify=true Categories=GNOME;GTK;Development;RevisionControl; diff --git a/gitkraken-aur/PKGBUILD b/gitkraken-aur/PKGBUILD index 4d59a9b..ca500db 100644 --- a/gitkraken-aur/PKGBUILD +++ b/gitkraken-aur/PKGBUILD @@ -8,9 +8,10 @@ # Contributor: Jeff Moody # Contributor: KokaKiwi # Contributor: iBernd81 +# Contributor: mosi0815 pkgname=gitkraken -pkgrel=1 +pkgrel=2 pkgver=12.2.1 pkgdesc="The intuitive, fast, and beautiful cross-platform Git client." url="https://www.gitkraken.com/" @@ -25,14 +26,16 @@ backup=() install='' source=( "GitKraken.desktop" + "gitkraken-url-handler.desktop" + "gk-cli-url-handler.desktop" "eula.html" - "gitkraken.sh" ) source_x86_64=("${pkgname}-${pkgver}-x86_64.tar.gz::https://api.gitkraken.dev/releases/production/linux/x64/${pkgver}/gitkraken-amd64.tar.gz") source_aarch64=("${pkgname}-${pkgver}-aarch64.tar.gz::https://api.gitkraken.dev/releases/production/linux/arm64/${pkgver}/gitkraken-aarch64.tar.gz") -sha256sums=('078fa2cdf6826d956bf73387fb2ef147b1aca5f4a7a3cb4be8c71e6105fc9c6c' - '5b7b39b331bc32a606e1e79c695df4519c9b220225be00fb34ef368c3af319a6' - 'c78ef86324946f856cc5c11549990722155a5e883dc94f92a95169c7ab5fb63e') +sha256sums=('af2d2e5a44ec6e543c34f94cfb89fe34b6c05d2baf6ca9db5b6d332e4a5686e5' + '4342596839114228740e5d61cdc49fbe9e98d05d1aabe2694ffe9d48ffd4082e' + '4b3eaf932b79e8f1d6a6a6efd030e73cb544d3d0fbe6bf7b61b884f4c6042b0a' + '5b7b39b331bc32a606e1e79c695df4519c9b220225be00fb34ef368c3af319a6') sha256sums_x86_64=('939aa5dbffde7e76e8bff922f2b5febdcf01cc037e7770400c49e2523d8f132f') sha256sums_aarch64=('48c142f9ca2a75a121e881b99fedc08482774d70b27efa09c121128fe325660d') options=('!strip' '!debug') @@ -41,10 +44,28 @@ package() { install -d "$pkgdir"/opt cp -R "$srcdir"/gitkraken "$pkgdir"/opt/gitkraken + # chrome-sandbox must be setuid root for Electron's SUID sandbox; cp drops the + # bit. Restore it to match upstream's deb. namcap will flag this as a setuid + # binary -- that warning is expected and intentional, not a packaging mistake. + chmod 4755 "$pkgdir"/opt/gitkraken/chrome-sandbox + install -d "$pkgdir"/usr/bin + # CLI and URL entrypoint. Symlink to the launcher bundled in the tarball (as + # the upstream deb does) instead of carrying our own wrapper; it resolves its + # own real path, so it works unchanged from /opt. The URL-handler entries + # invoke this via `--uri=`. + ln -s /opt/gitkraken/resources/bin/gitkraken.sh "$pkgdir"/usr/bin/gitkraken - install -D -m755 "./gitkraken.sh" "${pkgdir}/usr/bin/gitkraken" install -D -m644 "./eula.html" "${pkgdir}/usr/share/licenses/${pkgname}/eula.html" + + # Desktop entries taken from upstream's deb: the visible launcher plus the two + # scheme handlers that make gitkraken:// and gk:// links (e.g. OAuth callbacks) + # register and open via `/usr/bin/gitkraken --uri=`. The launcher drops the + # deb's MimeType=text/plain, which wrongly associated GitKraken with every + # plaintext file (issue #260). install -D -m644 "./GitKraken.desktop" "${pkgdir}/usr/share/applications/GitKraken.desktop" + install -D -m644 "./gitkraken-url-handler.desktop" "${pkgdir}/usr/share/applications/gitkraken-url-handler.desktop" + install -D -m644 "./gk-cli-url-handler.desktop" "${pkgdir}/usr/share/applications/gk-cli-url-handler.desktop" + install -D -m644 "$pkgdir/opt/gitkraken/gitkraken.png" "$pkgdir/usr/share/pixmaps/gitkraken.png" } diff --git a/gitkraken-aur/gitkraken-url-handler.desktop b/gitkraken-aur/gitkraken-url-handler.desktop new file mode 100644 index 0000000..23ea380 --- /dev/null +++ b/gitkraken-aur/gitkraken-url-handler.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Name=GitKraken +Comment=Unleash your repo +GenericName=Git Client +Exec=/usr/bin/gitkraken --uri=%U +Icon=gitkraken +Type=Application +NoDisplay=true +StartupNotify=true +Categories=GNOME;GTK;Development;RevisionControl; +MimeType=x-scheme-handler/gitkraken; +StartupWMClass=gitkraken diff --git a/gitkraken-aur/gitkraken.sh b/gitkraken-aur/gitkraken.sh deleted file mode 100755 index a609c9a..0000000 --- a/gitkraken-aur/gitkraken.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -if [[ "$#" == '1' && "${1:0:1}" != '-' ]]; then - exec /opt/gitkraken/gitkraken -p "$1" -else - exec /opt/gitkraken/gitkraken "$@" -fi diff --git a/gitkraken-aur/gk-cli-url-handler.desktop b/gitkraken-aur/gk-cli-url-handler.desktop new file mode 100644 index 0000000..d42f31c --- /dev/null +++ b/gitkraken-aur/gk-cli-url-handler.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Name=GitKraken +Comment=Unleash your repo +GenericName=Git Client +Exec=/usr/bin/gitkraken --uri=%U +Icon=gitkraken +Type=Application +NoDisplay=true +StartupNotify=true +Categories=GNOME;GTK;Development;RevisionControl; +MimeType=x-scheme-handler/gk; +StartupWMClass=gk