diff options
author | Jan Tojnar <jtojnar@gmail.com> | 2022-01-28 19:20:16 +0100 |
---|---|---|
committer | Jan Tojnar <jtojnar@gmail.com> | 2022-01-28 19:26:03 +0100 |
commit | 2144f37d365c36ed5b35d3f96c56969bc5becc11 (patch) | |
tree | b59d4cd7bfdd89b672a25d52d77af75a3c617ecd /pkgs/development/libraries/libinput | |
parent | 58fb597c43a9bfd4f128ed640cb9c46f232105e8 (diff) |
libinput: Clean up
- format with nixpkgs-fmt - use more conventional attribute ordering - remove non-existent file from patchShebang args - remove unnecessary if from sphinx-build binding (Nix is lazy so we do not need to null it when not used)
Diffstat (limited to 'pkgs/development/libraries/libinput')
-rw-r--r-- | pkgs/development/libraries/libinput/default.nix | 95 |
1 files changed, 65 insertions, 30 deletions
diff --git a/pkgs/development/libraries/libinput/default.nix b/pkgs/development/libraries/libinput/default.nix index 924237d58fbed..d34d50b19e3d7 100644 --- a/pkgs/development/libraries/libinput/default.nix +++ b/pkgs/development/libraries/libinput/default.nix @@ -1,47 +1,70 @@ -{ lib, stdenv, fetchurl, pkg-config, meson, ninja -, libevdev, mtdev, udev, libwacom -, documentationSupport ? false, doxygen, graphviz # Documentation -, eventGUISupport ? false, cairo, glib, gtk3 # GUI event viewer support -, testsSupport ? false, check, valgrind, python3 +{ lib +, stdenv +, fetchurl +, pkg-config +, meson +, ninja +, libevdev +, mtdev +, udev +, libwacom +, documentationSupport ? false +, doxygen +, graphviz +, eventGUISupport ? false +, cairo +, glib +, gtk3 +, testsSupport ? false +, check +, valgrind +, python3 , nixosTests }: let mkFlag = optSet: flag: "-D${flag}=${lib.boolToString optSet}"; - sphinx-build = if documentationSupport then - python3.pkgs.sphinx.overrideAttrs (super: { - propagatedBuildInputs = super.propagatedBuildInputs ++ (with python3.pkgs; [ recommonmark sphinx_rtd_theme ]); + sphinx-build = + python3.pkgs.sphinx.overrideAttrs (attrs: { + propagatedBuildInputs = + attrs.propagatedBuildInputs + ++ (with python3.pkgs; [ + recommonmark + sphinx_rtd_theme + ]); - postFixup = super.postFixup or "" + '' + postFixup = attrs.postFixup or "" + '' # Do not propagate Python rm $out/nix-support/propagated-build-inputs ''; - }) - else null; + }); in stdenv.mkDerivation rec { pname = "libinput"; version = "1.19.3"; + outputs = [ "bin" "out" "dev" ]; + src = fetchurl { url = "https://www.freedesktop.org/software/libinput/libinput-${version}.tar.xz"; sha256 = "sha256-PK54zN4Z19Dzh+WLxzTU0Xq19kJvVKnotyjJCxe6oGg="; }; - outputs = [ "bin" "out" "dev" ]; - - mesonFlags = [ - (mkFlag documentationSupport "documentation") - (mkFlag eventGUISupport "debug-gui") - (mkFlag testsSupport "tests") - "--sysconfdir=/etc" - "--libexecdir=${placeholder "bin"}/libexec" + patches = [ + ./udev-absolute-path.patch ]; - nativeBuildInputs = [ pkg-config meson ninja ] - ++ lib.optionals documentationSupport [ doxygen graphviz sphinx-build ]; + nativeBuildInputs = [ + pkg-config + meson + ninja + ] ++ lib.optionals documentationSupport [ + doxygen + graphviz + sphinx-build + ]; buildInputs = [ libevdev @@ -53,20 +76,34 @@ stdenv.mkDerivation rec { pyyaml setuptools ])) - ] ++ lib.optionals eventGUISupport [ cairo glib gtk3 ]; + ] ++ lib.optionals eventGUISupport [ + # GUI event viewer + cairo + glib + gtk3 + ]; + + propagatedBuildInputs = [ + udev + ]; checkInputs = [ check valgrind ]; - propagatedBuildInputs = [ udev ]; + mesonFlags = [ + (mkFlag documentationSupport "documentation") + (mkFlag eventGUISupport "debug-gui") + (mkFlag testsSupport "tests") + "--sysconfdir=/etc" + "--libexecdir=${placeholder "bin"}/libexec" + ]; - patches = [ ./udev-absolute-path.patch ]; + doCheck = testsSupport && stdenv.hostPlatform == stdenv.buildPlatform; postPatch = '' patchShebangs \ - tools/helper-copy-and-exec-from-tmp.sh \ test/symbols-leak-test \ test/check-leftover-udev-rules.sh \ test/helper-copy-and-exec-from-tmp.sh @@ -75,17 +112,15 @@ stdenv.mkDerivation rec { sed -i "/install_subdir('libinput', install_dir : dir_etc)/d" meson.build ''; - doCheck = testsSupport && stdenv.hostPlatform == stdenv.buildPlatform; - passthru.tests = { libinput-module = nixosTests.libinput; }; meta = with lib; { 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; + homepage = "https://www.freedesktop.org/wiki/Software/libinput/"; + license = licenses.mit; + platforms = platforms.unix; maintainers = with maintainers; [ codyopel ]; }; } |