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 <noreply@anthropic.com>
This commit is contained in:
Si
2026-09-26 10:22:18 +02:00
co-authored by Claude Opus 5.5
parent b9f905e04c
commit 520c7c45fb
9 changed files with 75 additions and 2 deletions
+4
View File
@@ -5,3 +5,7 @@ compile_commands.json
__pycache__/
*.o
*.a
packaging/arch/effector/
packaging/arch/src/
packaging/arch/pkg/
packaging/arch/*.pkg.tar*
+7
View File
@@ -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
+3 -1
View File
@@ -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
+3 -1
View File
@@ -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)
+7
View File
@@ -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<version>` from
this repository and installs it with pacman, desktop entry included:
```bash
cd packaging/arch && makepkg -si
```
## Run
```bash
+12
View File
@@ -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
+30
View File
@@ -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
}
+2
View File
@@ -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)
+7
View File
@@ -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"});