Merge pull request #92715 from jtojnar/fix-libinput-commands

This commit is contained in:
Jan Tojnar 2020-07-16 04:58:38 +02:00 committed by GitHub
commit d49b38b73c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 65 additions and 6 deletions

View File

@ -1,4 +1,4 @@
{ stdenv, fetchurl, python3 }:
{ stdenv, fetchurl, fetchpatch, python3 }:
stdenv.mkDerivation rec {
pname = "libevdev";
@ -9,6 +9,15 @@ stdenv.mkDerivation rec {
sha256 = "17pb5375njb1r05xmk0r57a2j986ihglh2n5nqcylbag4rj8mqg7";
};
patches = [
# Fix libevdev-python tests on aarch64
# https://gitlab.freedesktop.org/libevdev/libevdev/merge_requests/63
(fetchpatch {
url = "https://gitlab.freedesktop.org/libevdev/libevdev/commit/66113fe84f62bab3a672a336eb10b255d2aa5ce7.patch";
sha256 = "gZKr/P+/OqU69IGslP8CQlcGuyzA/ulcm+nGwHdis58=";
})
];
nativeBuildInputs = [ python3 ];
meta = with stdenv.lib; {

View File

@ -47,10 +47,23 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ pkgconfig meson ninja ]
++ optionals documentationSupport [ doxygen graphviz sphinx-build ];
buildInputs = [ libevdev mtdev libwacom ]
buildInputs = [
libevdev
mtdev
libwacom
(python3.withPackages (pp: with pp; [
pp.libevdev # already in scope
pyudev
pyyaml
setuptools
]))
]
++ optionals eventGUISupport [ cairo glib gtk3 ];
checkInputs = [ (python3.withPackages (pkgs: with pkgs; [ evdev ])) check valgrind ];
checkInputs = [
check
valgrind
];
propagatedBuildInputs = [ udev ];
@ -60,6 +73,7 @@ stdenv.mkDerivation rec {
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;

View File

@ -1,4 +1,11 @@
{ stdenv, buildPythonPackage, isPy27, fetchPypi }:
{ stdenv
, buildPythonPackage
, isPy27
, fetchPypi
, substituteAll
, pkgs
, pytestCheckHook
}:
buildPythonPackage rec {
pname = "libevdev";
@ -10,7 +17,14 @@ buildPythonPackage rec {
sha256 = "17agnigmzscmdjqmrylg1lza03hwjhgxbpf4l705s6i7p7ndaqrs";
};
doCheck = false;
patches = [
(substituteAll {
src = ./fix-paths.patch;
libevdev = stdenv.lib.getLib pkgs.libevdev;
})
];
checkInputs = [ pytestCheckHook ];
meta = with stdenv.lib; {
description = "Python wrapper around the libevdev C library";

View File

@ -0,0 +1,22 @@
diff --git a/libevdev/_clib.py b/libevdev/_clib.py
index 6e4ab2c..9db54d1 100644
--- a/libevdev/_clib.py
+++ b/libevdev/_clib.py
@@ -120,7 +120,7 @@ class Libevdev(_LibraryWrapper):
@staticmethod
def _cdll():
- return ctypes.CDLL("libevdev.so.2", use_errno=True)
+ return ctypes.CDLL("@libevdev@/lib/libevdev.so.2", use_errno=True)
_api_prototypes = {
# const char *libevdev_event_type_get_name(unsigned int type);
@@ -910,7 +910,7 @@ class UinputDevice(_LibraryWrapper):
@staticmethod
def _cdll():
- return ctypes.CDLL("libevdev.so.2", use_errno=True)
+ return ctypes.CDLL("@libevdev@/lib/libevdev.so.2", use_errno=True)
_api_prototypes = {
# int libevdev_uinput_create_from_device(const struct libevdev *, int, struct libevdev_uinput **)

View File

@ -17,7 +17,7 @@ buildPythonPackage rec {
'';
checkInputs = [ pytest mock hypothesis docutils ];
propagatedBuildInputs = [ systemd six ];
propagatedBuildInputs = [ six ];
checkPhase = ''
py.test