From 985519b97045aa7db7dfd43657f1310ade3715ed Mon Sep 17 00:00:00 2001 From: Jorijn van der Graaf Date: Sat, 17 Oct 2026 23:48:01 +0200 Subject: [PATCH] packaging: libevdev into a prefix for the Crafter.Graphics build The crafter-build Flatpak's SDK ships no libevdev, headers or library, and neither does the Freedesktop Platform, while Crafter.Graphics's gamepad backend includes and links it. The script builds the release tarball (checksum pinned) with the SDK's meson into a prefix. Tested: run inside the sandbox on the workstation, the prefix holds libevdev.so.2.3.0 and libevdev-1.0/libevdev/libevdev.h. --- AGENTS.md | 2 +- packaging/build-libevdev.sh | 30 ++++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100755 packaging/build-libevdev.sh diff --git a/AGENTS.md b/AGENTS.md index 7156716..abf9087 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -32,7 +32,7 @@ and §7.9 (Messaging) and §8.1 (the frozen one). | `implementations/main.cpp` | The executable `imsd-messages`. | | `tests//main.cpp` | One test per directory, declared in `project.cpp`. | | `assets/` | The bundled font (Noto Sans, OFL 1.1). | -| `packaging/` | Desktop entry, metainfo, icon, the sysroot and flatpak scripts. | +| `packaging/` | `build-libevdev.sh`: libevdev into a prefix. | ## 3. Building and testing diff --git a/packaging/build-libevdev.sh b/packaging/build-libevdev.sh new file mode 100755 index 0000000..8c39ab5 --- /dev/null +++ b/packaging/build-libevdev.sh @@ -0,0 +1,30 @@ +#!/bin/sh +# SPDX-License-Identifier: GPL-3.0-only +# SPDX-FileCopyrightText: Copyright (C) 2026 Catcrafts® + +# build-libevdev.sh — libevdev into a prefix, for Crafter.Graphics's gamepad +# backend. The crafter-build Flatpak's SDK ships no libevdev (headers or +# library) and neither does the Freedesktop Platform, so the library is +# built from source into a prefix. +# +# packaging/build-libevdev.sh [prefix] # default: ~/.cache/imsd-messages/libevdev- +# +# Runs inside the crafter-build sandbox (meson, ninja, python3 and a C +# compiler are the SDK's). Network: the release tarball from freedesktop.org. +set -eu +VERSION=1.13.4 +# pinned at the first download (2026-10-17); a mismatch stops the build +SHA256=f00ab8d42ad8b905296fab67e13b871f1a424839331516642100f82ad88127cd +ARCH=$(uname -m) +PREFIX="${1:-$HOME/.cache/imsd-messages/libevdev-$ARCH}" +work=$(mktemp -d) +trap 'rm -rf "$work"' EXIT +echo ">> libevdev $VERSION into $PREFIX" +curl -fsSL -o "$work/libevdev.tar.xz" "https://www.freedesktop.org/software/libevdev/libevdev-$VERSION.tar.xz" +got=$(sha256sum "$work/libevdev.tar.xz" | cut -d' ' -f1) +[ "$got" = "$SHA256" ] || { echo "libevdev-$VERSION.tar.xz: sha256 $got, expected $SHA256" >&2; exit 1; } +tar -xJf "$work/libevdev.tar.xz" -C "$work" +cd "$work/libevdev-$VERSION" +meson setup build --prefix="$PREFIX" --libdir=lib -Dtests=disabled -Ddocumentation=disabled -Dcoverity=false >/dev/null +ninja -C build install >/dev/null +echo ">> done: $(ls "$PREFIX"/lib/libevdev.so*) ; headers in $PREFIX/include/libevdev-1.0"