nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at python-updates 164 lines 3.3 kB view raw
1{ 2 lib, 3 stdenv, 4 fetchFromGitLab, 5 gitUpdater, 6 pkg-config, 7 meson, 8 ninja, 9 libevdev, 10 mtdev, 11 udev, 12 wacomSupport ? true, 13 libwacom, 14 documentationSupport ? false, 15 doxygen, 16 graphviz, 17 runCommand, 18 eventGUISupport ? false, 19 cairo, 20 glib, 21 gtk3, 22 testsSupport ? false, 23 check, 24 valgrind, 25 python3, 26 nixosTests, 27 wayland-scanner, 28 udevCheckHook, 29}: 30 31let 32 mkFlag = optSet: flag: "-D${flag}=${lib.boolToString optSet}"; 33 34 sphinx-build = 35 let 36 env = python3.withPackages ( 37 pp: with pp; [ 38 sphinx 39 recommonmark 40 sphinx-rtd-theme 41 ] 42 ); 43 in 44 # Expose only the sphinx-build binary to avoid contaminating 45 # everything with Sphinx’s Python environment. 46 runCommand "sphinx-build" { } '' 47 mkdir -p "$out/bin" 48 ln -s "${env}/bin/sphinx-build" "$out/bin" 49 ''; 50in 51 52stdenv.mkDerivation rec { 53 pname = "libinput"; 54 version = "1.29.2"; 55 56 outputs = [ 57 "bin" 58 "out" 59 "dev" 60 ]; 61 62 src = fetchFromGitLab { 63 domain = "gitlab.freedesktop.org"; 64 owner = "libinput"; 65 repo = "libinput"; 66 rev = version; 67 hash = "sha256-oxDGUbZebxAmBd2j51qV9Jn8SXBjUX2NPRgkxbDz7Dk="; 68 }; 69 70 patches = [ 71 ./udev-absolute-path.patch 72 ]; 73 74 nativeBuildInputs = [ 75 pkg-config 76 meson 77 ninja 78 udevCheckHook 79 ] 80 ++ lib.optionals documentationSupport [ 81 doxygen 82 graphviz 83 sphinx-build 84 ]; 85 86 buildInputs = [ 87 libevdev 88 mtdev 89 (python3.withPackages ( 90 pp: with pp; [ 91 pp.libevdev # already in scope 92 pyudev 93 pyyaml 94 setuptools 95 ] 96 )) 97 ] 98 ++ lib.optionals wacomSupport [ 99 libwacom 100 ] 101 ++ lib.optionals eventGUISupport [ 102 # GUI event viewer 103 cairo 104 glib 105 gtk3 106 wayland-scanner 107 ]; 108 109 propagatedBuildInputs = [ 110 udev 111 ]; 112 113 nativeCheckInputs = [ 114 check 115 valgrind 116 ]; 117 118 mesonFlags = [ 119 (mkFlag documentationSupport "documentation") 120 (mkFlag eventGUISupport "debug-gui") 121 (mkFlag testsSupport "tests") 122 (mkFlag wacomSupport "libwacom") 123 "--sysconfdir=/etc" 124 "--libexecdir=${placeholder "bin"}/libexec" 125 ]; 126 127 doCheck = testsSupport && stdenv.hostPlatform == stdenv.buildPlatform; 128 129 doInstallCheck = true; 130 131 postPatch = '' 132 patchShebangs \ 133 test/symbols-leak-test \ 134 test/check-leftover-udev-rules.sh \ 135 test/helper-copy-and-exec-from-tmp.sh 136 137 # Don't create an empty directory under /etc. 138 sed -i "/install_emptydir(dir_etc \/ 'libinput')/d" meson.build 139 ''; 140 141 passthru = { 142 tests = { 143 libinput-module = nixosTests.libinput; 144 }; 145 updateScript = gitUpdater { 146 patchlevel-unstable = true; 147 }; 148 }; 149 150 meta = { 151 description = "Handles input devices in Wayland compositors and provides a generic X.Org input driver"; 152 mainProgram = "libinput"; 153 homepage = "https://www.freedesktop.org/wiki/Software/libinput/"; 154 license = lib.licenses.mit; 155 platforms = lib.platforms.linux; 156 maintainers = with lib.maintainers; [ codyopel ]; 157 teams = [ lib.teams.freedesktop ]; 158 changelog = "https://gitlab.freedesktop.org/libinput/libinput/-/releases/${version}"; 159 badPlatforms = [ 160 # Mandatory shared library. 161 lib.systems.inspect.platformPatterns.isStatic 162 ]; 163 }; 164}