nixpkgs/pkgs/by-name/ip/iptsd/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

75 lines
1.7 KiB
Nix

{ lib
, stdenv
, fetchFromGitHub
, cmake
, meson
, ninja
, pkg-config
, cli11
, eigen
, hidrd
, inih
, microsoft-gsl
, spdlog
, systemd
}:
stdenv.mkDerivation rec {
pname = "iptsd";
version = "3";
src = fetchFromGitHub {
owner = "linux-surface";
repo = "iptsd";
rev = "refs/tags/v${version}";
hash = "sha256-3z3A9qywmsSW1tlJ6LePC5wudM/FITTAFyuPkbHlid0=";
};
nativeBuildInputs = [
cmake
meson
ninja
pkg-config
];
dontUseCmakeConfigure = true;
buildInputs = [
cli11
eigen
hidrd
inih
microsoft-gsl
spdlog
systemd
];
# Original installs udev rules and service config into global paths
postPatch = ''
substituteInPlace etc/meson.build \
--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"}"
substituteInPlace etc/udev/50-iptsd.rules.in \
--replace-fail "/bin/systemd-escape" "${lib.getExe' systemd "systemd-escape"}"
'';
mesonFlags = [
"-Dservice_manager=systemd"
"-Dsample_config=false"
"-Ddebug_tools="
"-Db_lto=false" # plugin needed to handle lto object -> undefined reference to ...
];
meta = with lib; {
changelog = "https://github.com/linux-surface/iptsd/releases/tag/${lib.removePrefix "refs/tags/" src.rev}";
description = "Userspace daemon for Intel Precise Touch & Stylus";
homepage = "https://github.com/linux-surface/iptsd";
license = licenses.gpl2Plus;
mainProgram = "iptsd";
maintainers = with maintainers; [ tomberek dotlambda ];
platforms = platforms.linux;
};
}