2023-02-02 01:50:16 +01:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, cmake
|
|
|
|
, meson
|
|
|
|
, ninja
|
|
|
|
, pkg-config
|
|
|
|
, cli11
|
2023-04-20 02:16:33 +02:00
|
|
|
, eigen
|
2023-02-02 01:50:16 +01:00
|
|
|
, hidrd
|
|
|
|
, inih
|
2023-05-26 12:43:45 +02:00
|
|
|
, microsoft-gsl
|
2023-02-02 01:50:16 +01:00
|
|
|
, spdlog
|
|
|
|
, systemd
|
|
|
|
}:
|
2021-05-27 17:48:59 +02:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "iptsd";
|
2024-09-15 03:02:58 +02:00
|
|
|
version = "3";
|
2021-05-27 17:48:59 +02:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "linux-surface";
|
2024-09-15 03:02:58 +02:00
|
|
|
repo = "iptsd";
|
|
|
|
rev = "refs/tags/v${version}";
|
|
|
|
hash = "sha256-3z3A9qywmsSW1tlJ6LePC5wudM/FITTAFyuPkbHlid0=";
|
2021-05-27 17:48:59 +02:00
|
|
|
};
|
|
|
|
|
2023-02-02 01:50:16 +01:00
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
meson
|
|
|
|
ninja
|
|
|
|
pkg-config
|
|
|
|
];
|
|
|
|
|
|
|
|
dontUseCmakeConfigure = true;
|
2021-05-27 17:48:59 +02:00
|
|
|
|
2023-02-02 01:50:16 +01:00
|
|
|
buildInputs = [
|
|
|
|
cli11
|
2023-04-20 02:16:33 +02:00
|
|
|
eigen
|
2023-02-02 01:50:16 +01:00
|
|
|
hidrd
|
|
|
|
inih
|
2023-05-26 12:43:45 +02:00
|
|
|
microsoft-gsl
|
2023-02-02 01:50:16 +01:00
|
|
|
spdlog
|
|
|
|
systemd
|
|
|
|
];
|
2021-05-27 17:48:59 +02:00
|
|
|
|
|
|
|
# Original installs udev rules and service config into global paths
|
|
|
|
postPatch = ''
|
2023-02-02 01:50:16 +01:00
|
|
|
substituteInPlace etc/meson.build \
|
2024-09-15 03:02:58 +02:00
|
|
|
--replace-fail "install_dir: unitdir" "install_dir: '$out/etc/systemd/system'" \
|
|
|
|
--replace-fail "install_dir: rulesdir" "install_dir: '$out/etc/udev/rules.d'"
|
|
|
|
substituteInPlace etc/scripts/iptsd-find-service \
|
|
|
|
--replace-fail "systemd-escape" "${lib.getExe' systemd "systemd-escape"}"
|
2023-04-20 02:16:33 +02:00
|
|
|
substituteInPlace etc/udev/50-iptsd.rules.in \
|
2024-09-15 03:02:58 +02:00
|
|
|
--replace-fail "/bin/systemd-escape" "${lib.getExe' systemd "systemd-escape"}"
|
2021-05-27 17:48:59 +02:00
|
|
|
'';
|
2023-02-02 01:50:16 +01:00
|
|
|
|
2021-05-27 17:48:59 +02:00
|
|
|
mesonFlags = [
|
2022-01-22 18:16:52 +01:00
|
|
|
"-Dservice_manager=systemd"
|
2021-05-27 17:48:59 +02:00
|
|
|
"-Dsample_config=false"
|
2023-02-02 01:50:16 +01:00
|
|
|
"-Ddebug_tools="
|
|
|
|
"-Db_lto=false" # plugin needed to handle lto object -> undefined reference to ...
|
2021-05-27 17:48:59 +02:00
|
|
|
];
|
|
|
|
|
|
|
|
meta = with lib; {
|
2023-02-02 01:50:16 +01:00
|
|
|
changelog = "https://github.com/linux-surface/iptsd/releases/tag/${src.rev}";
|
2021-05-27 17:48:59 +02:00
|
|
|
description = "Userspace daemon for Intel Precise Touch & Stylus";
|
|
|
|
homepage = "https://github.com/linux-surface/iptsd";
|
2023-02-02 01:50:16 +01:00
|
|
|
license = licenses.gpl2Plus;
|
2024-01-24 05:17:17 +01:00
|
|
|
mainProgram = "iptsd";
|
2023-02-02 01:50:16 +01:00
|
|
|
maintainers = with maintainers; [ tomberek dotlambda ];
|
2021-05-27 17:48:59 +02:00
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|