2023-10-09 19:29:22 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
2024-06-20 14:57:18 +00:00
|
|
|
, buildPackages
|
2023-10-09 19:29:22 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, autoreconfHook
|
|
|
|
, pkg-config
|
|
|
|
, indent
|
|
|
|
, perl
|
|
|
|
, argp-standalone
|
|
|
|
, fmt_9
|
|
|
|
, libev
|
|
|
|
, withSystemd ? lib.meta.availableOn stdenv.hostPlatform systemd, systemd
|
|
|
|
, withUsb ? stdenv.isLinux, libusb1
|
|
|
|
}:
|
|
|
|
|
2024-06-20 14:57:18 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2023-10-09 19:29:22 +00:00
|
|
|
pname = "knxd";
|
2024-05-15 15:35:15 +00:00
|
|
|
version = "0.14.61";
|
2023-10-09 19:29:22 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "knxd";
|
|
|
|
repo = "knxd";
|
2024-06-20 14:57:18 +00:00
|
|
|
rev = finalAttrs.version;
|
2024-05-15 15:35:15 +00:00
|
|
|
hash = "sha256-b8svjGaxW8YqonhXewebDUitezKoMcZxcUFGd2EKZQ4=";
|
2023-10-09 19:29:22 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = ''
|
2024-06-20 14:57:18 +00:00
|
|
|
sed -i '2i echo ${finalAttrs.version}; exit' tools/version.sh
|
2023-10-09 19:29:22 +00:00
|
|
|
sed -i '2i exit' tools/get_libfmt
|
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = [ autoreconfHook pkg-config indent perl ];
|
|
|
|
|
|
|
|
buildInputs = [ fmt_9 libev ]
|
|
|
|
++ lib.optional withSystemd systemd
|
|
|
|
++ lib.optional withUsb libusb1
|
|
|
|
++ lib.optional stdenv.isDarwin argp-standalone;
|
|
|
|
|
2024-06-20 14:57:18 +00:00
|
|
|
configureFlags = [
|
|
|
|
(lib.enableFeature withSystemd "systemd")
|
|
|
|
(lib.enableFeature withUsb "usb")
|
|
|
|
];
|
|
|
|
|
|
|
|
depsBuildBuild = [ buildPackages.stdenv.cc ];
|
2023-10-09 19:29:22 +00:00
|
|
|
|
|
|
|
installFlags = lib.optionals withSystemd [
|
|
|
|
"systemdsystemunitdir=$(out)/lib/systemd/system"
|
|
|
|
"systemdsysusersdir=$(out)/lib/sysusers.d"
|
|
|
|
];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Advanced router/gateway for KNX";
|
|
|
|
homepage = "https://github.com/knxd/knxd";
|
|
|
|
license = licenses.gpl2Plus;
|
|
|
|
maintainers = with maintainers; [ sikmir ];
|
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
2024-06-20 14:57:18 +00:00
|
|
|
})
|