89023c38fc
I made a mistake merge. Reverting it inc778945806
undid the state on master, but now I realize it crippled the git merge mechanism. As the merge contained a mix of commits from `master..staging-next` and other commits from `staging-next..staging`, it got the `staging-next` branch into a state that was difficult to recover. I reconstructed the "desired" state of staging-next tree by: - checking out the last commit of the problematic range:4effe769e2
- `git rebase -i --preserve-merges a8a018ddc0` - dropping the mistaken merge commit and its revert from that range (while keeping reapplication from4effe769e2
) - merging the last unaffected staging-next commit (803ca85c20
) - fortunately no other commits have been pushed to staging-next yet - applying a diff on staging-next to get it into that state
92 lines
2.6 KiB
Nix
92 lines
2.6 KiB
Nix
{ stdenv, fetchFromGitLab, pkgconfig, meson, ninja
|
|
, libevdev, mtdev, udev, libwacom
|
|
, documentationSupport ? false, doxygen ? null, graphviz ? null # Documentation
|
|
, eventGUISupport ? false, cairo ? null, glib ? null, gtk3 ? null # GUI event viewer support
|
|
, testsSupport ? false, check ? null, valgrind ? null, python3 ? null
|
|
}:
|
|
|
|
assert documentationSupport -> doxygen != null && graphviz != null && python3 != null;
|
|
assert eventGUISupport -> cairo != null && glib != null && gtk3 != null;
|
|
assert testsSupport -> check != null && valgrind != null && python3 != null;
|
|
|
|
let
|
|
mkFlag = optSet: flag: "-D${flag}=${stdenv.lib.boolToString optSet}";
|
|
|
|
sphinx-build = if documentationSupport then
|
|
python3.pkgs.sphinx.overrideAttrs (super: {
|
|
propagatedBuildInputs = super.propagatedBuildInputs ++ (with python3.pkgs; [ recommonmark sphinx_rtd_theme ]);
|
|
|
|
postFixup = super.postFixup or "" + ''
|
|
# Do not propagate Python
|
|
rm $out/nix-support/propagated-build-inputs
|
|
'';
|
|
})
|
|
else null;
|
|
in
|
|
|
|
with stdenv.lib;
|
|
stdenv.mkDerivation rec {
|
|
pname = "libinput";
|
|
version = "1.16.2";
|
|
|
|
src = fetchFromGitLab {
|
|
domain = "gitlab.freedesktop.org";
|
|
owner = pname;
|
|
repo = pname;
|
|
rev = version;
|
|
sha256 = "0qii6yh3dlhgv9z970cpzbz19ii8zjvq4k7pg75sy2gmia7smwd1";
|
|
};
|
|
|
|
outputs = [ "bin" "out" "dev" ];
|
|
|
|
mesonFlags = [
|
|
(mkFlag documentationSupport "documentation")
|
|
(mkFlag eventGUISupport "debug-gui")
|
|
(mkFlag testsSupport "tests")
|
|
"--sysconfdir=/etc"
|
|
"--libexecdir=${placeholder "bin"}/libexec"
|
|
];
|
|
|
|
nativeBuildInputs = [ pkgconfig meson ninja ]
|
|
++ optionals documentationSupport [ doxygen graphviz sphinx-build ];
|
|
|
|
buildInputs = [
|
|
libevdev
|
|
mtdev
|
|
libwacom
|
|
(python3.withPackages (pp: with pp; [
|
|
pp.libevdev # already in scope
|
|
pyudev
|
|
pyyaml
|
|
setuptools
|
|
]))
|
|
]
|
|
++ optionals eventGUISupport [ cairo glib gtk3 ];
|
|
|
|
checkInputs = [
|
|
check
|
|
valgrind
|
|
];
|
|
|
|
propagatedBuildInputs = [ udev ];
|
|
|
|
patches = [ ./udev-absolute-path.patch ];
|
|
|
|
postPatch = ''
|
|
patchShebangs tools/helper-copy-and-exec-from-tmp.sh
|
|
patchShebangs test/symbols-leak-test
|
|
patchShebangs test/check-leftover-udev-rules.sh
|
|
patchShebangs test/helper-copy-and-exec-from-tmp.sh
|
|
'';
|
|
|
|
doCheck = testsSupport && stdenv.hostPlatform == stdenv.buildPlatform;
|
|
|
|
meta = {
|
|
description = "Handles input devices in Wayland compositors and provides a generic X.Org input driver";
|
|
homepage = "https://www.freedesktop.org/wiki/Software/libinput/";
|
|
license = licenses.mit;
|
|
platforms = platforms.unix;
|
|
maintainers = with maintainers; [ codyopel ];
|
|
};
|
|
}
|