From 520c7c45fb7f5747699c13e959b860d8ae9ba1af Mon Sep 17 00:00:00 2001 From: Si Date: Sat, 26 Sep 2026 10:22:18 +0200 Subject: [PATCH] Package Effector for Arch and give it a desktop entry packaging/arch/PKGBUILD builds the tagged release from this repository and installs it with pacman; the version test keeps its pkgver in step with CMakeLists.txt. A desktop entry puts the interface in the app menu. Co-Authored-By: Claude Opus 5.5 --- .gitignore | 4 ++++ CHANGELOG.md | 7 +++++++ CLAUDE.md | 4 +++- CMakeLists.txt | 4 +++- README.md | 7 +++++++ data/org.effector.Effector.desktop | 12 ++++++++++++ packaging/arch/PKGBUILD | 30 ++++++++++++++++++++++++++++++ tests/CMakeLists.txt | 2 ++ tests/core_tests.cpp | 7 +++++++ 9 files changed, 75 insertions(+), 2 deletions(-) create mode 100644 data/org.effector.Effector.desktop create mode 100644 packaging/arch/PKGBUILD diff --git a/.gitignore b/.gitignore index 1cef816..ee31baa 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,7 @@ compile_commands.json __pycache__/ *.o *.a +packaging/arch/effector/ +packaging/arch/src/ +packaging/arch/pkg/ +packaging/arch/*.pkg.tar* diff --git a/CHANGELOG.md b/CHANGELOG.md index 39f0ef9..573c27e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,13 @@ Every release of Effector, newest first. The version lives in one place, the `project()` line of `CMakeLists.txt`, and each release is a `vX.Y.Z` tag on the commit that made it. The interface shows this file under Changelog in its menu. +## [0.5.1] - 2026-09-26 + +### Added +- An Arch Linux `PKGBUILD` in `packaging/arch`: `makepkg -si` there builds and + installs the tagged release with pacman. +- A desktop entry, so an installed Effector shows up in the app menu. + ## [0.5.0] - 2026-09-26 ### Added diff --git a/CLAUDE.md b/CLAUDE.md index 2d96ad5..af84268 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -41,7 +41,9 @@ CMake writes it, together with the text of `CHANGELOG.md`, into a generated in the build tree. `--version` prints it, and the header-bar menu shows it under About Effector and the changelog under Changelog. The `version` core test fails unless the newest `## [X.Y.Z]` entry in `CHANGELOG.md` is the current -version, so a bump and its changelog entry go in together. Each release is an +version, so a bump and its changelog entry go in together, and it also fails unless +`pkgver` in `packaging/arch/PKGBUILD` matches (that PKGBUILD builds the +`vX.Y.Z` tag, so reset `pkgrel=1` on a bump). Each release is an annotated `vX.Y.Z` tag on the commit that made it. When you add a user-visible change, add a line to the newest changelog entry, or start a new entry if that one is already tagged. The Changelog window reads only headings, `- ` bullets diff --git a/CMakeLists.txt b/CMakeLists.txt index f6b371b..5e58db6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.20) -project(effector VERSION 0.5.0 LANGUAGES CXX) +project(effector VERSION 0.5.1 LANGUAGES CXX) set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD_REQUIRED ON) @@ -77,6 +77,8 @@ target_link_libraries(effector PRIVATE effector_gui) target_compile_options(effector PRIVATE -Wall -Wextra -Wpedantic) install(TARGETS effector RUNTIME DESTINATION bin) +# The launcher entry, so the interface shows up in the desktop's app menu. +install(FILES data/org.effector.Effector.desktop DESTINATION share/applications) # --- tests -------------------------------------------------------------------- include(CTest) diff --git a/README.md b/README.md index d33e748..06e0061 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,13 @@ ctest --test-dir build --output-on-failure The binary lands at `build/effector`; `cmake --install build --prefix ~/.local` installs it to `~/.local/bin`. +On Arch, `packaging/arch/PKGBUILD` builds the release tagged `v` from +this repository and installs it with pacman, desktop entry included: + +```bash +cd packaging/arch && makepkg -si +``` + ## Run ```bash diff --git a/data/org.effector.Effector.desktop b/data/org.effector.Effector.desktop new file mode 100644 index 0000000..0e5ff3b --- /dev/null +++ b/data/org.effector.Effector.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Application +Name=Effector +GenericName=Image Effects +Comment=Cascade glitch and collage effects over your photographs +Exec=effector %F +Icon=applications-graphics +Terminal=false +Categories=Graphics;2DGraphics;RasterGraphics;GTK; +MimeType=image/jpeg;image/png;image/webp;image/tiff;image/bmp; +Keywords=glitch;collage;scanlines;photo;effect; +StartupNotify=true diff --git a/packaging/arch/PKGBUILD b/packaging/arch/PKGBUILD new file mode 100644 index 0000000..821d39e --- /dev/null +++ b/packaging/arch/PKGBUILD @@ -0,0 +1,30 @@ +# Builds the release tagged v$pkgver from the repository this file sits in, +# so pkgver must follow the project() line of CMakeLists.txt (the version core +# test checks it). From this folder: makepkg -si +pkgname=effector +pkgver=0.5.1 +pkgrel=1 +pkgdesc='Image effects app: a GTK4 interface and a headless CLI over pluggable effects' +arch=('x86_64' 'aarch64') +url='https://git.plan9.uber.space/hans/effector' +license=('unknown') +depends=('gtkmm-4.0' 'gdk-pixbuf2' 'pango' 'cairo' 'glib2' 'glibc' 'gcc-libs') +makedepends=('cmake' 'ninja' 'git') +checkdepends=('xorg-server-xvfb') +source=("$pkgname::git+file://${startdir%/packaging/arch}#tag=v$pkgver") +sha256sums=('SKIP') + +build() { + cmake -S "$pkgname" -B build -G Ninja \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=/usr + cmake --build build +} + +check() { + ctest --test-dir build --output-on-failure +} + +package() { + DESTDIR="$pkgdir" cmake --install build +} diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 863498c..c85cb2d 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -3,6 +3,8 @@ add_executable(effector_tests core_tests.cpp ../src/cli/options.cpp) target_link_libraries(effector_tests PRIVATE effector_core) target_compile_options(effector_tests PRIVATE -Wall -Wextra -Wpedantic) +# The version test reads the Arch PKGBUILD to keep its pkgver in step. +target_compile_definitions(effector_tests PRIVATE EFFECTOR_SOURCE_DIR="${PROJECT_SOURCE_DIR}") add_test(NAME core COMMAND effector_tests) diff --git a/tests/core_tests.cpp b/tests/core_tests.cpp index 1a791f7..2267cf0 100644 --- a/tests/core_tests.cpp +++ b/tests/core_tests.cpp @@ -1725,6 +1725,13 @@ int main() { check(newest != std::string_view::npos && log.substr(newest + 5).starts_with(std::string(kVersion) + "]"), "the newest changelog entry is this version"); + std::ifstream pkgbuild(std::string(EFFECTOR_SOURCE_DIR) + "/packaging/arch/PKGBUILD"); + std::string line; + std::string pkgver; + while (std::getline(pkgbuild, line)) { + if (line.starts_with("pkgver=")) pkgver = line.substr(7); + } + check(pkgver == kVersion, "the Arch PKGBUILD packages this version"); const auto options = parsedOptions({"--version"}); check(options && options->showVersion, "--version is understood"); const auto shortOptions = parsedOptions({"-V"});