diff --git a/AGENTS.md b/AGENTS.md index 880a1db..394df46 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -34,7 +34,7 @@ and §7.9 (Messaging) and §8.1 (the frozen one). | `tests//main.cpp` | One test per directory, declared in `project.cpp`. | | `utilities/` | `fake-imsd.py`: imsd's Messaging interface on the session bus, for benches. | | `assets/` | The bundled font (Noto Sans, OFL 1.1). | -| `packaging/` | `build-libevdev.sh` (libevdev into a prefix, for the Crafter.Graphics build), the desktop entry and the icon. | +| `packaging/` | The desktop entry and the icon. | ## 3. Building and testing diff --git a/packaging/build-libevdev.sh b/packaging/build-libevdev.sh deleted file mode 100755 index 8c39ab5..0000000 --- a/packaging/build-libevdev.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/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" diff --git a/project.cpp b/project.cpp index ba3891a..278a19d 100644 --- a/project.cpp +++ b/project.cpp @@ -176,24 +176,6 @@ extern "C" Configuration CrafterBuildProject(std::span a ApplyGioFlags(cfg, gio); cfg.files.push_back("assets/NotoSans-Regular.ttf"); - // libevdev, for Crafter.Graphics's gamepad backend: the crafter-build - // Flatpak's SDK has none, so a sysroot build looks for it in the - // sysroot and a native build in the prefix of - // packaging/build-libevdev.sh. Crafter.Graphics itself names - // the host's directory, which is an ignored, absent path in the sandbox. - if (!cfg.sysroot.empty()) { - graphics->compileFlags.push_back("-I=/usr/include/libevdev-1.0"); - } else { - const std::string arch = cfg.target.substr(0, cfg.target.find('-')); - const char* env = std::getenv("IMSD_MESSAGES_LIBEVDEV"); - const char* home = std::getenv("HOME"); - const fs::path prefix = env ? fs::path(env) : fs::path(home ? home : ".") / ".cache" / "imsd-messages" / std::format("libevdev-{}", arch); - if (!fs::exists(prefix / "include" / "libevdev-1.0")) std::println(std::cerr, "imsd-messages: no libevdev at {} — run packaging/build-libevdev.sh first", prefix.string()); - graphics->compileFlags.push_back(std::format("-I{}", (prefix / "include" / "libevdev-1.0").string())); - cfg.linkFlags.push_back(std::format("-L{}", (prefix / "lib").string())); - cfg.linkFlags.push_back(std::format("-Wl,-rpath,{}", (prefix / "lib").string())); - } - cfg.AddTest("Number").Dependencies({ Core.get() }); cfg.AddTest("Time").Dependencies({ Core.get() }); cfg.AddTest("Wrap").Dependencies({ Core.get() });