mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-07-13 12:08:49 +00:00
Diff: https://gitlab.freedesktop.org/libinput/libinput/-/compare/1.31.2...1.31.3
Changelog: https://gitlab.freedesktop.org/libinput/libinput/-/releases/1.31.3
(cherry picked from commit 4064388abf)
173 lines
3.5 KiB
Nix
173 lines
3.5 KiB
Nix
{
|
||
lib,
|
||
stdenv,
|
||
fetchFromGitLab,
|
||
gitUpdater,
|
||
pkg-config,
|
||
meson,
|
||
ninja,
|
||
libevdev,
|
||
mtdev,
|
||
udev,
|
||
wacomSupport ? stdenv.hostPlatform.isLinux,
|
||
libwacom,
|
||
documentationSupport ? false,
|
||
doxygen,
|
||
graphviz,
|
||
runCommand,
|
||
eventGUISupport ? false,
|
||
cairo,
|
||
glib,
|
||
gtk3,
|
||
luaSupport ? true,
|
||
lua5_4,
|
||
testsSupport ? false,
|
||
check,
|
||
valgrind,
|
||
python3,
|
||
nixosTests,
|
||
wayland-scanner,
|
||
udevCheckHook,
|
||
epoll-shim,
|
||
libudev-devd,
|
||
}:
|
||
|
||
let
|
||
sphinx-build =
|
||
let
|
||
env = python3.withPackages (
|
||
pp: with pp; [
|
||
sphinx
|
||
recommonmark
|
||
sphinx-rtd-theme
|
||
]
|
||
);
|
||
in
|
||
# Expose only the sphinx-build binary to avoid contaminating
|
||
# everything with Sphinx’s Python environment.
|
||
runCommand "sphinx-build" { } ''
|
||
mkdir -p "$out/bin"
|
||
ln -s "${env}/bin/sphinx-build" "$out/bin"
|
||
'';
|
||
in
|
||
|
||
stdenv.mkDerivation rec {
|
||
pname = "libinput";
|
||
version = "1.31.3";
|
||
|
||
outputs = [
|
||
"bin"
|
||
"out"
|
||
"dev"
|
||
];
|
||
|
||
src = fetchFromGitLab {
|
||
domain = "gitlab.freedesktop.org";
|
||
owner = "libinput";
|
||
repo = "libinput";
|
||
rev = version;
|
||
hash = "sha256-2l+YGD1AFTwJRouMg0d3nQX+2me6A4yOB4g2WE2H//g=";
|
||
};
|
||
|
||
nativeBuildInputs = [
|
||
pkg-config
|
||
meson
|
||
ninja
|
||
udevCheckHook
|
||
]
|
||
++ lib.optionals documentationSupport [
|
||
doxygen
|
||
graphviz
|
||
sphinx-build
|
||
];
|
||
|
||
buildInputs = [
|
||
libevdev
|
||
mtdev
|
||
(python3.withPackages (
|
||
pp: with pp; [
|
||
pp.libevdev # already in scope
|
||
pyudev
|
||
pyyaml
|
||
setuptools
|
||
]
|
||
))
|
||
]
|
||
++ lib.optionals stdenv.hostPlatform.isFreeBSD [
|
||
epoll-shim
|
||
]
|
||
++ lib.optionals wacomSupport [
|
||
libwacom
|
||
]
|
||
++ lib.optionals luaSupport [
|
||
lua5_4
|
||
]
|
||
++ lib.optionals eventGUISupport [
|
||
# GUI event viewer
|
||
cairo
|
||
glib
|
||
gtk3
|
||
wayland-scanner
|
||
];
|
||
|
||
propagatedBuildInputs =
|
||
lib.optional stdenv.hostPlatform.isLinux udev
|
||
++ lib.optional stdenv.hostPlatform.isFreeBSD libudev-devd;
|
||
|
||
nativeCheckInputs = [
|
||
check
|
||
valgrind
|
||
];
|
||
|
||
mesonFlags = [
|
||
(lib.mesonBool "documentation" documentationSupport)
|
||
(lib.mesonBool "debug-gui" eventGUISupport)
|
||
(lib.mesonBool "tests" testsSupport)
|
||
(lib.mesonBool "libwacom" wacomSupport)
|
||
(lib.mesonEnable "lua-plugins" luaSupport)
|
||
"--sysconfdir=/etc"
|
||
"--libexecdir=${placeholder "bin"}/libexec"
|
||
]
|
||
++ lib.optionals stdenv.hostPlatform.isBSD [
|
||
"-Depoll-dir=${epoll-shim}"
|
||
];
|
||
|
||
doCheck = testsSupport && stdenv.hostPlatform == stdenv.buildPlatform;
|
||
|
||
doInstallCheck = true;
|
||
|
||
postPatch = ''
|
||
patchShebangs \
|
||
test/symbols-leak-test \
|
||
test/check-leftover-udev-rules.sh \
|
||
test/helper-copy-and-exec-from-tmp.sh
|
||
|
||
# Don't create an empty directory under /etc.
|
||
sed -i "/install_emptydir(dir_etc \/ 'libinput')/d" meson.build
|
||
'';
|
||
|
||
passthru = {
|
||
tests = {
|
||
libinput-module = nixosTests.libinput;
|
||
};
|
||
updateScript = gitUpdater {
|
||
patchlevel-unstable = true;
|
||
};
|
||
};
|
||
|
||
meta = {
|
||
description = "Handles input devices in Wayland compositors and provides a generic X.Org input driver";
|
||
mainProgram = "libinput";
|
||
homepage = "https://www.freedesktop.org/wiki/Software/libinput/";
|
||
license = lib.licenses.mit;
|
||
platforms = lib.platforms.linux ++ lib.platforms.freebsd;
|
||
maintainers = [ ];
|
||
teams = [ lib.teams.freedesktop ];
|
||
changelog = "https://gitlab.freedesktop.org/libinput/libinput/-/releases/${version}";
|
||
badPlatforms = [
|
||
# Mandatory shared library.
|
||
lib.systems.inspect.platformPatterns.isStatic
|
||
];
|
||
};
|
||
}
|