2023-02-09 11:40:11 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, cmake
|
|
|
|
, meson
|
|
|
|
, ninja
|
|
|
|
, pkg-config
|
|
|
|
, cli11
|
2023-04-29 16:46:19 +00:00
|
|
|
, eigen
|
2023-02-09 11:40:11 +00:00
|
|
|
, hidrd
|
|
|
|
, inih
|
2023-07-15 17:15:38 +00:00
|
|
|
, microsoft-gsl
|
2023-02-09 11:40:11 +00:00
|
|
|
, spdlog
|
|
|
|
, systemd
|
|
|
|
}:
|
2021-06-04 09:07:49 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "iptsd";
|
2023-08-04 22:07:22 +00:00
|
|
|
version = "1.3.1";
|
2021-06-04 09:07:49 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "linux-surface";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2023-08-04 22:07:22 +00:00
|
|
|
hash = "sha256-06KGMXkp5lR05iNQOll1h0q+Z+XWMberqG1C9Cs7VfA=";
|
2021-06-04 09:07:49 +00:00
|
|
|
};
|
|
|
|
|
2023-02-09 11:40:11 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
meson
|
|
|
|
ninja
|
|
|
|
pkg-config
|
|
|
|
];
|
|
|
|
|
|
|
|
dontUseCmakeConfigure = true;
|
2021-06-04 09:07:49 +00:00
|
|
|
|
2023-02-09 11:40:11 +00:00
|
|
|
buildInputs = [
|
|
|
|
cli11
|
2023-04-29 16:46:19 +00:00
|
|
|
eigen
|
2023-02-09 11:40:11 +00:00
|
|
|
hidrd
|
|
|
|
inih
|
2023-07-15 17:15:38 +00:00
|
|
|
microsoft-gsl
|
2023-02-09 11:40:11 +00:00
|
|
|
spdlog
|
|
|
|
systemd
|
|
|
|
];
|
2021-06-04 09:07:49 +00:00
|
|
|
|
|
|
|
# Original installs udev rules and service config into global paths
|
|
|
|
postPatch = ''
|
2023-02-09 11:40:11 +00:00
|
|
|
substituteInPlace etc/meson.build \
|
|
|
|
--replace "install_dir: unitdir" "install_dir: '$out/etc/systemd/system'" \
|
|
|
|
--replace "install_dir: rulesdir" "install_dir: '$out/etc/udev/rules.d'"
|
2023-04-29 16:46:19 +00:00
|
|
|
substituteInPlace etc/udev/50-iptsd.rules.in \
|
2023-02-09 11:40:11 +00:00
|
|
|
--replace "/bin/systemd-escape" "${systemd}/bin/systemd-escape"
|
2021-06-04 09:07:49 +00:00
|
|
|
'';
|
2023-02-09 11:40:11 +00:00
|
|
|
|
2021-06-04 09:07:49 +00:00
|
|
|
mesonFlags = [
|
2022-01-26 04:04:25 +00:00
|
|
|
"-Dservice_manager=systemd"
|
2021-06-04 09:07:49 +00:00
|
|
|
"-Dsample_config=false"
|
2023-02-09 11:40:11 +00:00
|
|
|
"-Ddebug_tools="
|
|
|
|
"-Db_lto=false" # plugin needed to handle lto object -> undefined reference to ...
|
2021-06-04 09:07:49 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
meta = with lib; {
|
2023-02-09 11:40:11 +00:00
|
|
|
changelog = "https://github.com/linux-surface/iptsd/releases/tag/${src.rev}";
|
2021-06-04 09:07:49 +00:00
|
|
|
description = "Userspace daemon for Intel Precise Touch & Stylus";
|
|
|
|
homepage = "https://github.com/linux-surface/iptsd";
|
2023-02-09 11:40:11 +00:00
|
|
|
license = licenses.gpl2Plus;
|
|
|
|
maintainers = with maintainers; [ tomberek dotlambda ];
|
2021-06-04 09:07:49 +00:00
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|