From 58fb597c43a9bfd4f128ed640cb9c46f232105e8 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Fri, 10 Dec 2021 09:10:29 +0000 Subject: [PATCH 1/4] =?UTF-8?q?libinput:=201.19.1=20=E2=86=92=201.19.3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://lists.x.org/archives/wayland-devel/2021-October/042003.html https://lists.x.org/archives/wayland-devel/2021-December/042068.html --- pkgs/development/libraries/libinput/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/libinput/default.nix b/pkgs/development/libraries/libinput/default.nix index 54843486e137..924237d58fbe 100644 --- a/pkgs/development/libraries/libinput/default.nix +++ b/pkgs/development/libraries/libinput/default.nix @@ -23,11 +23,11 @@ in stdenv.mkDerivation rec { pname = "libinput"; - version = "1.19.1"; + version = "1.19.3"; src = fetchurl { url = "https://www.freedesktop.org/software/libinput/libinput-${version}.tar.xz"; - sha256 = "sha256-C9z1sXg7c3hUt68coi32e8Nqb+fJz6cfAekUn5IgRG0="; + sha256 = "sha256-PK54zN4Z19Dzh+WLxzTU0Xq19kJvVKnotyjJCxe6oGg="; }; outputs = [ "bin" "out" "dev" ]; From 2144f37d365c36ed5b35d3f96c56969bc5becc11 Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Fri, 28 Jan 2022 19:20:16 +0100 Subject: [PATCH 2/4] 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) --- .../libraries/libinput/default.nix | 95 +++++++++++++------ 1 file changed, 65 insertions(+), 30 deletions(-) diff --git a/pkgs/development/libraries/libinput/default.nix b/pkgs/development/libraries/libinput/default.nix index 924237d58fbe..d34d50b19e3d 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 ]; }; } From 1e144d4d087eb9d751e6a776aafa6b08c34cf331 Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Fri, 28 Jan 2022 19:22:53 +0100 Subject: [PATCH 3/4] libinput: add freedesktop team to maintainers --- pkgs/development/libraries/libinput/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/libraries/libinput/default.nix b/pkgs/development/libraries/libinput/default.nix index d34d50b19e3d..30919baf5c04 100644 --- a/pkgs/development/libraries/libinput/default.nix +++ b/pkgs/development/libraries/libinput/default.nix @@ -121,6 +121,6 @@ stdenv.mkDerivation rec { homepage = "https://www.freedesktop.org/wiki/Software/libinput/"; license = licenses.mit; platforms = platforms.unix; - maintainers = with maintainers; [ codyopel ]; + maintainers = with maintainers; [ codyopel ] ++ teams.freedesktop.members; }; } From 818de15e48953cf0a3ffc65ae42d07ffe83acca7 Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Fri, 28 Jan 2022 20:06:49 +0100 Subject: [PATCH 4/4] libinput: fix docs build --- .../libraries/libinput/default.nix | 27 ++++++++++--------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/pkgs/development/libraries/libinput/default.nix b/pkgs/development/libraries/libinput/default.nix index 30919baf5c04..89bdc15ff62c 100644 --- a/pkgs/development/libraries/libinput/default.nix +++ b/pkgs/development/libraries/libinput/default.nix @@ -11,6 +11,7 @@ , documentationSupport ? false , doxygen , graphviz +, runCommand , eventGUISupport ? false , cairo , glib @@ -26,19 +27,19 @@ let mkFlag = optSet: flag: "-D${flag}=${lib.boolToString optSet}"; sphinx-build = - python3.pkgs.sphinx.overrideAttrs (attrs: { - propagatedBuildInputs = - attrs.propagatedBuildInputs - ++ (with python3.pkgs; [ - recommonmark - sphinx_rtd_theme - ]); - - postFixup = attrs.postFixup or "" + '' - # Do not propagate Python - rm $out/nix-support/propagated-build-inputs - ''; - }); + 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 {