From 69d085682ab9ca4f58449dc635ac6867c52c0c70 Mon Sep 17 00:00:00 2001 From: Artemis Tosini Date: Thu, 12 Feb 2026 16:42:44 -0500 Subject: [PATCH] libinput: Add support for FreeBSD --- .../development/libraries/libinput/default.nix | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/pkgs/development/libraries/libinput/default.nix b/pkgs/development/libraries/libinput/default.nix index 2d474b660a1d..7da2a96338ca 100644 --- a/pkgs/development/libraries/libinput/default.nix +++ b/pkgs/development/libraries/libinput/default.nix @@ -9,7 +9,7 @@ libevdev, mtdev, udev, - wacomSupport ? true, + wacomSupport ? stdenv.hostPlatform.isLinux, libwacom, documentationSupport ? false, doxygen, @@ -26,6 +26,8 @@ nixosTests, wayland-scanner, udevCheckHook, + epoll-shim, + libudev-devd, }: let @@ -95,6 +97,9 @@ stdenv.mkDerivation rec { ] )) ] + ++ lib.optionals stdenv.hostPlatform.isFreeBSD [ + epoll-shim + ] ++ lib.optionals wacomSupport [ libwacom ] @@ -106,9 +111,9 @@ stdenv.mkDerivation rec { wayland-scanner ]; - propagatedBuildInputs = [ - udev - ]; + propagatedBuildInputs = + lib.optional stdenv.hostPlatform.isLinux udev + ++ lib.optional stdenv.hostPlatform.isFreeBSD libudev-devd; nativeCheckInputs = [ check @@ -122,6 +127,9 @@ stdenv.mkDerivation rec { (mkFlag wacomSupport "libwacom") "--sysconfdir=/etc" "--libexecdir=${placeholder "bin"}/libexec" + ] + ++ lib.optionals stdenv.hostPlatform.isBSD [ + "-Depoll-dir=${epoll-shim}" ]; doCheck = testsSupport && stdenv.hostPlatform == stdenv.buildPlatform; @@ -152,7 +160,7 @@ stdenv.mkDerivation rec { mainProgram = "libinput"; homepage = "https://www.freedesktop.org/wiki/Software/libinput/"; license = lib.licenses.mit; - platforms = lib.platforms.linux; + platforms = lib.platforms.linux ++ lib.platforms.freebsd; maintainers = [ ]; teams = [ lib.teams.freedesktop ]; changelog = "https://gitlab.freedesktop.org/libinput/libinput/-/releases/${version}";