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