From 285fc5db86b5d75f65e640160b860e20cc827596 Mon Sep 17 00:00:00 2001 From: kj_sh604 Date: Sat, 20 Dec 2025 23:59:56 -0500 Subject: feat: initial attempt at PKGBUILD --- README.md | 19 ++++++++++++++---- archlinux/.SRCINFO | 18 +++++++++++++++++ archlinux/.gitignore | 4 ++++ archlinux/PKGBUILD | 42 ++++++++++++++++++++++++++++++++++++++++ archlinux/README.md | 48 ++++++++++++++++++++++++++++++++++++++++++++++ archlinux/kjagave.desktop | 12 ++++++++++++ archlinux/kjagave.png | Bin 0 -> 4934 bytes 7 files changed, 139 insertions(+), 4 deletions(-) create mode 100644 archlinux/.SRCINFO create mode 100644 archlinux/.gitignore create mode 100644 archlinux/PKGBUILD create mode 100644 archlinux/README.md create mode 100644 archlinux/kjagave.desktop create mode 100644 archlinux/kjagave.png diff --git a/README.md b/README.md index fee083b..de6b601 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +![kjagave logo](./archlinux/kjagave.png) + # kjagave a color picker inspired by agave, but only with the features I actually used @@ -19,18 +21,27 @@ a color picker inspired by agave, but only with the features I actually used - gtk3 development libraries - `xcolor` or `grabc` for screen color picking -## building +## installation + +### arch linux + +```bash +cd archlinux +makepkg -si +``` + +see `archlinux/README.md` for more details. + +### manual build ```sh cd src go mod download -go build -o ./kjagave main.go +go build -o ../kjagave main.go ``` ## running -from the src/ directory: - ```bash ./kjagave ``` diff --git a/archlinux/.SRCINFO b/archlinux/.SRCINFO new file mode 100644 index 0000000..946d5be --- /dev/null +++ b/archlinux/.SRCINFO @@ -0,0 +1,18 @@ +pkgbase = kjagave-git + pkgdesc = a color picker inspired by agave, but only with the features that kj_sh604 used + pkgver = r4.1aecac2 + pkgrel = 1 + url = https://github.com/kj-sh604/kjagave + arch = x86_64 + license = GPL2 + makedepends = go + makedepends = git + depends = gtk3 + optdepends = xcolor: for screen color picking + optdepends = grabc: alternative for screen color picking + provides = kjagave + conflicts = kjagave + source = git+https://github.com/kj-sh604/kjagave.git + sha256sums = SKIP + +pkgname = kjagave-git diff --git a/archlinux/.gitignore b/archlinux/.gitignore new file mode 100644 index 0000000..acab16a --- /dev/null +++ b/archlinux/.gitignore @@ -0,0 +1,4 @@ +pkg/ +src/ +*.tar* +kjagave/ \ No newline at end of file diff --git a/archlinux/PKGBUILD b/archlinux/PKGBUILD new file mode 100644 index 0000000..bc906a6 --- /dev/null +++ b/archlinux/PKGBUILD @@ -0,0 +1,42 @@ +pkgname=kjagave-git +pkgver=r4.1aecac2 +pkgrel=1 +pkgdesc="a color picker inspired by agave, but only with the features that kj_sh604 used" +arch=('x86_64') +url="https://github.com/kj-sh604/kjagave" +license=('GPL2') +depends=('gtk3') +optdepends=('xcolor: for screen color picking' + 'grabc: alternative for screen color picking') +makedepends=('go' 'git') +provides=('kjagave') +conflicts=('kjagave') +source=("git+https://github.com/kj-sh604/kjagave.git") +sha256sums=('SKIP') + +pkgver() { + cd "${srcdir}/kjagave" + printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" +} + +build() { + cd "${srcdir}/kjagave/src" + export CGO_CPPFLAGS="${CPPFLAGS}" + export CGO_CFLAGS="${CFLAGS}" + export CGO_CXXFLAGS="${CXXFLAGS}" + export CGO_LDFLAGS="${LDFLAGS}" + export GOFLAGS="-buildmode=pie -trimpath -ldflags=-linkmode=external -modcacherw" + go mod download + go mod download github.com/gotk3/gotk3 + go build -x -o kjagave main.go +} + +package() { + install -Dm755 "${srcdir}/kjagave/src/kjagave" "${pkgdir}/usr/bin/kjagave" + install -Dm644 "kjagave.desktop" "${pkgdir}/usr/share/applications/kjagave.desktop" + install -Dm644 "kjagave.png" "${pkgdir}/usr/share/pixmaps/kjagave.png" + install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/kjagave/LICENSE" + install -Dm644 README.md "${pkgdir}/usr/share/doc/kjagave/README.md" +} + +# vim:set ts=2 sw=2 et: diff --git a/archlinux/README.md b/archlinux/README.md new file mode 100644 index 0000000..668155f --- /dev/null +++ b/archlinux/README.md @@ -0,0 +1,48 @@ +# Arch Linux Package + +This directory contains the PKGBUILD and related files for building and installing kjagave on Arch Linux. + +## Building the Package + +```bash +cd archlinux +makepkg -si +``` + +## Installing from AUR (future) + +Once uploaded to the AUR: + +```bash +yay -S kjagave +# or +paru -S kjagave +``` + +## Files + +- `PKGBUILD` - Build script for Arch Linux +- `kjagave.desktop` - XDG desktop entry +- `kjagave.png` - Application icon +- `.SRCINFO` - Package metadata (generated with `makepkg --printsrcinfo`) + +## Building from Local Repository + +If you're testing locally before tagging a release: + +```bash +# In the archlinux directory, edit PKGBUILD to use local source +# Replace the source line with: +# source=("${pkgname}::git+file://$(pwd)/..") + +makepkg -si +``` + +## Note + +The PKGBUILD expects a tagged release (v1.0) on GitHub. Make sure to create and push the tag before building: + +```bash +git tag v1.0 +git push origin v1.0 +``` diff --git a/archlinux/kjagave.desktop b/archlinux/kjagave.desktop new file mode 100644 index 0000000..d5635d4 --- /dev/null +++ b/archlinux/kjagave.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Version=1.0 +Type=Application +Name=kjagave +GenericName=Color Picker +Comment=Pick and save colors with screen grabbing support +Exec=kjagave +Icon=kjagave +Terminal=false +Categories=Graphics;Utility;GTK; +Keywords=color;picker;palette;screen;grab; +StartupNotify=true diff --git a/archlinux/kjagave.png b/archlinux/kjagave.png new file mode 100644 index 0000000..6f9763b Binary files /dev/null and b/archlinux/kjagave.png differ -- cgit v1.2.3