From 3e20c805c35864a2c33f48e384558f10f18d6bf1 Mon Sep 17 00:00:00 2001 From: Sergii Bogomolov Date: Sat, 19 Jun 2021 00:27:48 +0200 Subject: [PATCH 1/2] New package: interception-tools-0.6.6 --- srcpkgs/interception-tools/files/udevmon/run | 10 +++++ .../patches/find_libevdev.patch | 29 +++++++++++++ .../patches/fix_pid_t.patch | 43 +++++++++++++++++++ srcpkgs/interception-tools/template | 18 ++++++++ 4 files changed, 100 insertions(+) create mode 100755 srcpkgs/interception-tools/files/udevmon/run create mode 100644 srcpkgs/interception-tools/patches/find_libevdev.patch create mode 100644 srcpkgs/interception-tools/patches/fix_pid_t.patch create mode 100644 srcpkgs/interception-tools/template diff --git a/srcpkgs/interception-tools/files/udevmon/run b/srcpkgs/interception-tools/files/udevmon/run new file mode 100755 index 000000000000..f041851365ae --- /dev/null +++ b/srcpkgs/interception-tools/files/udevmon/run @@ -0,0 +1,10 @@ +#!/bin/sh +if [ -r ./conf ]; then + . ./conf + if [ ! -z "${CONF_FILE}" ]; then + OPTS="${OPTS} -c '${CONF_FILE}'" + fi +fi + +exec 2>&1 +exec udevmon ${OPTS} diff --git a/srcpkgs/interception-tools/patches/find_libevdev.patch b/srcpkgs/interception-tools/patches/find_libevdev.patch new file mode 100644 index 000000000000..6510f1c6330a --- /dev/null +++ b/srcpkgs/interception-tools/patches/find_libevdev.patch @@ -0,0 +1,29 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index bda9e62..af5fd82 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -5,18 +5,21 @@ project(interception-tools) + find_package(Boost REQUIRED) + find_package(Threads REQUIRED) + ++find_package(PkgConfig) ++pkg_check_modules(LIBEVDEV REQUIRED libevdev) ++ + add_executable(udevmon udevmon.cpp) +-target_include_directories(udevmon PRIVATE "/usr/include/libevdev-1.0") ++target_include_directories(udevmon PRIVATE ${LIBEVDEV_INCLUDE_DIRS}) + target_compile_options(udevmon PRIVATE -Wall -Wextra -pedantic -std=c++11) + target_link_libraries(udevmon evdev udev yaml-cpp) + + add_executable(intercept intercept.c) +-target_include_directories(intercept PRIVATE "/usr/include/libevdev-1.0") ++target_include_directories(intercept PRIVATE ${LIBEVDEV_INCLUDE_DIRS}) + target_compile_options(intercept PRIVATE -Wall -Wextra) + target_link_libraries(intercept evdev) + + add_executable(uinput uinput.cpp) +-target_include_directories(uinput PRIVATE "/usr/include/libevdev-1.0") ++target_include_directories(uinput PRIVATE ${LIBEVDEV_INCLUDE_DIRS}) + target_compile_options(uinput PRIVATE -Wall -Wextra -pedantic -std=c++11) + target_link_libraries(uinput evdev udev yaml-cpp) + diff --git a/srcpkgs/interception-tools/patches/fix_pid_t.patch b/srcpkgs/interception-tools/patches/fix_pid_t.patch new file mode 100644 index 000000000000..48a6de5d8f24 --- /dev/null +++ b/srcpkgs/interception-tools/patches/fix_pid_t.patch @@ -0,0 +1,43 @@ +diff --git a/udevmon.cpp b/udevmon.cpp +index dec988d..a4112ff 100644 +--- a/udevmon.cpp ++++ b/udevmon.cpp +@@ -79,10 +79,10 @@ struct cmd { + } + } + +- std::vector<__pid_t> launch() const { +- std::vector<__pid_t> pids; ++ std::vector launch() const { ++ std::vector pids; + for (size_t i = 0; i < cmds.size(); ++i) { +- __pid_t pid = fork(); ++ pid_t pid = fork(); + switch (pid) { + case -1: { + for (auto pid : pids) +@@ -327,10 +327,10 @@ struct job { + }); + } + +- std::vector<__pid_t> launch_for(const std::string &devnode) const { +- std::vector<__pid_t> pids; ++ std::vector launch_for(const std::string &devnode) const { ++ std::vector pids; + for (size_t i = 0; i < cmds.size(); ++i) { +- __pid_t pid = fork(); ++ pid_t pid = fork(); + switch (pid) { + case -1: + std::fprintf(stderr, +@@ -559,8 +559,8 @@ struct jobs_manager { + + std::vector cmds; + std::vector jobs; +- std::vector<__pid_t> running_cmds; +- std::map> running_jobs; ++ std::vector running_cmds; ++ std::map> running_jobs; + }; + + std::vector scan_config(const std::string &directory) { diff --git a/srcpkgs/interception-tools/template b/srcpkgs/interception-tools/template new file mode 100644 index 000000000000..540277a7fb24 --- /dev/null +++ b/srcpkgs/interception-tools/template @@ -0,0 +1,18 @@ +# Template file for 'interception-tools' +pkgname=interception-tools +version=0.6.6 +revision=1 +wrksrc="tools-v${version}" +build_style=cmake +hostmakedepends="pkg-config" +makedepends="boost-devel eudev-libudev-devel libevdev-devel yaml-cpp-devel" +short_desc="Small set of utilities for operating on input events of evdev devices" +maintainer="Sergii Bogomolov " +license="GPL-3.0-only" +homepage="https://gitlab.com/interception/linux/tools" +distfiles="https://gitlab.com/interception/linux/tools/-/archive/v${version}/tools-v${version}.tar.gz" +checksum="6917eb7109c7514ef620f7ea184f95e7be522b8f5b226b121675c0a7f628afee" +post_install() { + vdoc README.md + vsv udevmon +} From c9623eccd21ebab69de6cf2c8ab3188d74ac174c Mon Sep 17 00:00:00 2001 From: Sergii Bogomolov Date: Sat, 19 Jun 2021 00:29:26 +0200 Subject: [PATCH 2/2] New package: caps2esc-0.3.2 --- srcpkgs/caps2esc/template | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 srcpkgs/caps2esc/template diff --git a/srcpkgs/caps2esc/template b/srcpkgs/caps2esc/template new file mode 100644 index 000000000000..36b4096f17b7 --- /dev/null +++ b/srcpkgs/caps2esc/template @@ -0,0 +1,17 @@ +# Template file for 'caps2esc' +pkgname=caps2esc +version=0.3.2 +revision=1 +wrksrc="caps2esc-v${version}" +build_style=cmake +depends="interception-tools" +short_desc="Transforming the most useless key ever in the most useful one" +maintainer="Sergii Bogomolov " +license="MIT" +homepage="https://gitlab.com/interception/linux/plugins/caps2esc" +distfiles="https://gitlab.com/interception/linux/plugins/caps2esc/-/archive/v${version}/caps2esc-v${version}.tar.gz" +checksum="d8a5c7a23cb7368fde2b91a0b5481d8ce906af146dd9a49f609052f2cf1d212c" +post_install() { + vdoc README.md + vlicense LICENSE.md +}