2022-02-10 20:34:41 +00:00
|
|
|
|
{ lib
|
|
|
|
|
, stdenv
|
2022-04-15 01:41:22 +00:00
|
|
|
|
, fetchFromGitLab
|
|
|
|
|
, gitUpdater
|
2022-02-10 20:34:41 +00:00
|
|
|
|
, pkg-config
|
|
|
|
|
, meson
|
|
|
|
|
, ninja
|
|
|
|
|
, libevdev
|
|
|
|
|
, mtdev
|
|
|
|
|
, udev
|
|
|
|
|
, libwacom
|
|
|
|
|
, documentationSupport ? false
|
|
|
|
|
, doxygen
|
|
|
|
|
, graphviz
|
|
|
|
|
, runCommand
|
|
|
|
|
, eventGUISupport ? false
|
|
|
|
|
, cairo
|
|
|
|
|
, glib
|
|
|
|
|
, gtk3
|
|
|
|
|
, testsSupport ? false
|
|
|
|
|
, check
|
|
|
|
|
, valgrind
|
|
|
|
|
, python3
|
2021-12-06 16:07:01 +00:00
|
|
|
|
, nixosTests
|
2020-04-24 23:36:52 +00:00
|
|
|
|
}:
|
|
|
|
|
|
|
|
|
|
let
|
2021-02-05 17:12:51 +00:00
|
|
|
|
mkFlag = optSet: flag: "-D${flag}=${lib.boolToString optSet}";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
2022-02-10 20:34:41 +00:00
|
|
|
|
sphinx-build =
|
|
|
|
|
let
|
|
|
|
|
env = python3.withPackages (pp: with pp; [
|
|
|
|
|
sphinx
|
|
|
|
|
recommonmark
|
2022-08-12 12:06:08 +00:00
|
|
|
|
sphinx-rtd-theme
|
2022-02-10 20:34:41 +00:00
|
|
|
|
]);
|
|
|
|
|
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"
|
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
in
|
|
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
|
pname = "libinput";
|
2022-07-14 12:49:19 +00:00
|
|
|
|
version = "1.21.0";
|
2022-02-10 20:34:41 +00:00
|
|
|
|
|
|
|
|
|
outputs = [ "bin" "out" "dev" ];
|
2021-09-18 10:52:07 +00:00
|
|
|
|
|
2022-04-15 01:41:22 +00:00
|
|
|
|
src = fetchFromGitLab {
|
|
|
|
|
domain = "gitlab.freedesktop.org";
|
|
|
|
|
owner = "libinput";
|
|
|
|
|
repo = "libinput";
|
|
|
|
|
rev = version;
|
2022-07-14 12:49:19 +00:00
|
|
|
|
sha256 = "R94BdrjI4szNbVtQ+ydRNUg9clR8mkRL7+GE9b2FcDs=";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
};
|
|
|
|
|
|
2022-02-10 20:34:41 +00:00
|
|
|
|
patches = [
|
|
|
|
|
./udev-absolute-path.patch
|
2020-04-24 23:36:52 +00:00
|
|
|
|
];
|
|
|
|
|
|
2022-02-10 20:34:41 +00:00
|
|
|
|
nativeBuildInputs = [
|
|
|
|
|
pkg-config
|
|
|
|
|
meson
|
|
|
|
|
ninja
|
|
|
|
|
] ++ lib.optionals documentationSupport [
|
|
|
|
|
doxygen
|
|
|
|
|
graphviz
|
|
|
|
|
sphinx-build
|
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
2020-08-20 17:08:02 +00:00
|
|
|
|
buildInputs = [
|
|
|
|
|
libevdev
|
|
|
|
|
mtdev
|
|
|
|
|
libwacom
|
|
|
|
|
(python3.withPackages (pp: with pp; [
|
|
|
|
|
pp.libevdev # already in scope
|
|
|
|
|
pyudev
|
|
|
|
|
pyyaml
|
|
|
|
|
setuptools
|
|
|
|
|
]))
|
2022-02-10 20:34:41 +00:00
|
|
|
|
] ++ lib.optionals eventGUISupport [
|
|
|
|
|
# GUI event viewer
|
|
|
|
|
cairo
|
|
|
|
|
glib
|
|
|
|
|
gtk3
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
|
udev
|
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
|
nativeCheckInputs = [
|
2020-08-20 17:08:02 +00:00
|
|
|
|
check
|
|
|
|
|
valgrind
|
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
2022-02-10 20:34:41 +00:00
|
|
|
|
mesonFlags = [
|
|
|
|
|
(mkFlag documentationSupport "documentation")
|
|
|
|
|
(mkFlag eventGUISupport "debug-gui")
|
|
|
|
|
(mkFlag testsSupport "tests")
|
|
|
|
|
"--sysconfdir=/etc"
|
|
|
|
|
"--libexecdir=${placeholder "bin"}/libexec"
|
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
2022-02-10 20:34:41 +00:00
|
|
|
|
doCheck = testsSupport && stdenv.hostPlatform == stdenv.buildPlatform;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
|
|
postPatch = ''
|
2021-09-18 10:52:07 +00:00
|
|
|
|
patchShebangs \
|
|
|
|
|
test/symbols-leak-test \
|
|
|
|
|
test/check-leftover-udev-rules.sh \
|
|
|
|
|
test/helper-copy-and-exec-from-tmp.sh
|
|
|
|
|
|
|
|
|
|
# Don't create an empty /etc directory.
|
|
|
|
|
sed -i "/install_subdir('libinput', install_dir : dir_etc)/d" meson.build
|
2020-04-24 23:36:52 +00:00
|
|
|
|
'';
|
|
|
|
|
|
2022-04-15 01:41:22 +00:00
|
|
|
|
passthru = {
|
|
|
|
|
tests = {
|
|
|
|
|
libinput-module = nixosTests.libinput;
|
|
|
|
|
};
|
|
|
|
|
updateScript = gitUpdater {
|
|
|
|
|
patchlevel-unstable = true;
|
|
|
|
|
};
|
2021-12-06 16:07:01 +00:00
|
|
|
|
};
|
|
|
|
|
|
2021-09-18 10:52:07 +00:00
|
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
|
description = "Handles input devices in Wayland compositors and provides a generic X.Org input driver";
|
2022-02-10 20:34:41 +00:00
|
|
|
|
homepage = "https://www.freedesktop.org/wiki/Software/libinput/";
|
|
|
|
|
license = licenses.mit;
|
|
|
|
|
platforms = platforms.unix;
|
|
|
|
|
maintainers = with maintainers; [ codyopel ] ++ teams.freedesktop.members;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
};
|
|
|
|
|
}
|