commit
2cb5b58180
|
@ -1,19 +1,18 @@
|
||||||
{ lib, stdenv, fetchurl, pkg-config, cmake, libyamlcpp,
|
{ lib, stdenv, fetchFromGitLab, pkg-config, cmake, libyamlcpp,
|
||||||
libevdev, udev }:
|
libevdev, udev, boost }:
|
||||||
|
|
||||||
let
|
stdenv.mkDerivation rec {
|
||||||
version = "0.2.1";
|
pname = "interception-tools";
|
||||||
baseName = "interception-tools";
|
version = "0.6.6";
|
||||||
in stdenv.mkDerivation {
|
src = fetchFromGitLab {
|
||||||
name = "${baseName}-${version}";
|
owner = "interception/linux";
|
||||||
|
repo = "tools";
|
||||||
src = fetchurl {
|
rev = "v${version}";
|
||||||
url = "https://gitlab.com/interception/linux/tools/repository/v${version}/archive.tar.gz";
|
sha256 = "0k9h14a9d65nwvv7pj0kigjgzfv453mm3r4svnxfg1h5lccmy8jj";
|
||||||
sha256 = "0lqz89wsf9r5xdgflincysxg4l8fpgg5z8zczhhrg9s5787srfzi";
|
|
||||||
};
|
};
|
||||||
|
|
||||||
nativeBuildInputs = [ cmake pkg-config ];
|
nativeBuildInputs = [ cmake pkg-config ];
|
||||||
buildInputs = [ libevdev udev libyamlcpp ];
|
buildInputs = [ libevdev udev libyamlcpp boost ];
|
||||||
|
|
||||||
prePatch = ''
|
prePatch = ''
|
||||||
substituteInPlace CMakeLists.txt --replace \
|
substituteInPlace CMakeLists.txt --replace \
|
||||||
|
@ -21,12 +20,10 @@ in stdenv.mkDerivation {
|
||||||
"\"$(pkg-config --cflags libevdev | cut -c 3-)\""
|
"\"$(pkg-config --cflags libevdev | cut -c 3-)\""
|
||||||
'';
|
'';
|
||||||
|
|
||||||
patches = [ ./fix-udevmon-configuration-job-path.patch ];
|
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
description = "A minimal composable infrastructure on top of libudev and libevdev";
|
description = "A minimal composable infrastructure on top of libudev and libevdev";
|
||||||
homepage = "https://gitlab.com/interception/linux/tools";
|
homepage = "https://gitlab.com/interception/linux/tools";
|
||||||
license = lib.licenses.gpl3;
|
license = lib.licenses.gpl3Only;
|
||||||
maintainers = [ lib.maintainers.vyp ];
|
maintainers = [ lib.maintainers.vyp ];
|
||||||
platforms = lib.platforms.linux;
|
platforms = lib.platforms.linux;
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,32 +0,0 @@
|
||||||
From d3a5d661b80f3597368f517ebaeddfdfaafc1bf2 Mon Sep 17 00:00:00 2001
|
|
||||||
From: xd1le <elisp.vim@gmail.com>
|
|
||||||
Date: Mon, 28 Aug 2017 00:19:09 +1000
|
|
||||||
Subject: [PATCH] fix udevmon configuration job path
|
|
||||||
|
|
||||||
For some reason, the udevmon job $PATH seems to be empty (or otherwise
|
|
||||||
seems to point to `/no-such-path`). This commit fixes that by setting
|
|
||||||
its $PATH to the same $PATH that the parent udevmon process has.
|
|
||||||
---
|
|
||||||
udevmon.cpp | 5 ++++-
|
|
||||||
1 file changed, 4 insertions(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/udevmon.cpp b/udevmon.cpp
|
|
||||||
index ebdd909..b523efd 100644
|
|
||||||
--- a/udevmon.cpp
|
|
||||||
+++ b/udevmon.cpp
|
|
||||||
@@ -237,8 +237,11 @@ private:
|
|
||||||
case 0: {
|
|
||||||
char *command[] = {(char *)"sh", (char *)"-c",
|
|
||||||
(char *)job.c_str(), nullptr};
|
|
||||||
+ std::string path = getenv("PATH");
|
|
||||||
std::string variables = "DEVNODE=" + devnode;
|
|
||||||
- char *environment[] = {(char *)variables.c_str(), nullptr};
|
|
||||||
+ std::string pathenv = "PATH=" + path;
|
|
||||||
+ char *environment[] = {(char *)variables.c_str(),
|
|
||||||
+ (char *)pathenv.c_str(), nullptr};
|
|
||||||
execvpe(command[0], command, environment);
|
|
||||||
std::fprintf(stderr,
|
|
||||||
R"(exec failed for devnode %s, job "%s" )"
|
|
||||||
--
|
|
||||||
2.14.1
|
|
||||||
|
|
Loading…
Reference in New Issue