project, packaging: libevdev comes with Crafter.Graphics

Crafter.Graphics vendors libevdev since dfb70bc and links it statically:
its gamepad backend compiles against its own copy, which comes first on
the include path, and the executable needs no libevdev.so. The prefix
build-libevdev.sh made, the include and library paths project.cpp added
for libevdev and the executable's rpath into ~/.cache are left with
nothing to do, so they go.
This commit is contained in:
Jorijn van der Graaf 2026-10-20 23:18:53 +02:00
commit b27200a3c5
Signed by: jorijnvdgraaf
GPG key ID: 2937E59CDCC1BCFB
3 changed files with 1 additions and 49 deletions

View file

@ -176,24 +176,6 @@ extern "C" Configuration CrafterBuildProject(std::span<const std::string_view> 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() });