2021-01-17 00:15:33 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, fetchurl
|
2022-10-21 18:38:19 +00:00
|
|
|
|
|
|
|
# build time
|
2021-01-17 00:15:33 +00:00
|
|
|
, autoreconfHook
|
|
|
|
, pkg-config
|
2023-11-16 04:20:00 +00:00
|
|
|
, python3Packages
|
2022-10-21 18:38:19 +00:00
|
|
|
|
|
|
|
# runtime
|
2023-11-16 04:20:00 +00:00
|
|
|
, withMysql ? stdenv.buildPlatform.system == stdenv.hostPlatform.system
|
|
|
|
, withPostgres ? stdenv.buildPlatform.system == stdenv.hostPlatform.system
|
2021-01-17 00:15:33 +00:00
|
|
|
, boost
|
|
|
|
, libmysqlclient
|
|
|
|
, log4cplus
|
2022-10-21 18:38:19 +00:00
|
|
|
, openssl
|
2021-01-17 00:15:33 +00:00
|
|
|
, postgresql
|
2021-07-18 21:22:44 +00:00
|
|
|
, python3
|
2022-10-21 18:38:19 +00:00
|
|
|
|
|
|
|
# tests
|
2021-07-18 21:22:44 +00:00
|
|
|
, nixosTests
|
|
|
|
}:
|
2020-10-16 20:44:37 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "kea";
|
2024-09-19 14:19:46 +00:00
|
|
|
version = "2.6.1"; # only even minor versions are stable
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://ftp.isc.org/isc/${pname}/${version}/${pname}-${version}.tar.gz";
|
2024-09-19 14:19:46 +00:00
|
|
|
hash = "sha256-0s4UqRwuJIrSh24pFS1ke8xeQzvGja+tDuluwWb8+tE=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-10-21 18:38:19 +00:00
|
|
|
patches = [
|
|
|
|
./dont-create-var.patch
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace ./src/bin/keactrl/Makefile.am --replace '@sysconfdir@' "$out/etc"
|
2022-11-21 17:40:18 +00:00
|
|
|
# darwin special-casing just causes trouble
|
|
|
|
substituteInPlace ./m4macros/ax_crypto.m4 --replace 'apple-darwin' 'nope'
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2022-10-21 18:38:19 +00:00
|
|
|
outputs = [
|
|
|
|
"out"
|
|
|
|
"doc"
|
|
|
|
"man"
|
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
configureFlags = [
|
2021-01-17 00:15:33 +00:00
|
|
|
"--enable-perfdhcp"
|
|
|
|
"--enable-shell"
|
2020-04-24 23:36:52 +00:00
|
|
|
"--localstatedir=/var"
|
2022-10-21 18:38:19 +00:00
|
|
|
"--with-openssl=${lib.getDev openssl}"
|
2023-11-16 04:20:00 +00:00
|
|
|
]
|
2024-09-19 14:19:46 +00:00
|
|
|
++ lib.optional withPostgres "--with-pgsql=${lib.getDev postgresql}/bin/pg_config"
|
2023-11-16 04:20:00 +00:00
|
|
|
++ lib.optional withMysql "--with-mysql=${lib.getDev libmysqlclient}/bin/mysql_config";
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
postConfigure = ''
|
|
|
|
# Mangle embedded paths to dev-only inputs.
|
|
|
|
sed -e "s|$NIX_STORE/[a-z0-9]\{32\}-|$NIX_STORE/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-|g" -i config.report
|
|
|
|
'';
|
2021-01-17 00:15:33 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
autoreconfHook
|
|
|
|
pkg-config
|
2023-11-16 04:20:00 +00:00
|
|
|
] ++ (with python3Packages; [
|
2022-10-21 18:38:19 +00:00
|
|
|
sphinxHook
|
|
|
|
sphinx-rtd-theme
|
|
|
|
]);
|
|
|
|
|
|
|
|
sphinxBuilders = [
|
|
|
|
"html"
|
|
|
|
"man"
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
2022-10-21 18:38:19 +00:00
|
|
|
sphinxRoot = "doc/sphinx";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildInputs = [
|
2021-01-17 00:15:33 +00:00
|
|
|
boost
|
|
|
|
libmysqlclient
|
|
|
|
log4cplus
|
2022-10-21 18:38:19 +00:00
|
|
|
openssl
|
2021-01-17 00:15:33 +00:00
|
|
|
python3
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2021-07-18 21:22:44 +00:00
|
|
|
passthru.tests = {
|
2022-10-21 18:38:19 +00:00
|
|
|
kea = nixosTests.kea;
|
|
|
|
prefix-delegation = nixosTests.systemd-networkd-ipv6-prefix-delegation;
|
2023-08-04 22:07:22 +00:00
|
|
|
networking-scripted = lib.recurseIntoAttrs { inherit (nixosTests.networking.scripted) dhcpDefault dhcpSimple dhcpOneIf; };
|
|
|
|
networking-networkd = lib.recurseIntoAttrs { inherit (nixosTests.networking.networkd) dhcpDefault dhcpSimple dhcpOneIf; };
|
2021-07-18 21:22:44 +00:00
|
|
|
};
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2023-07-15 17:15:38 +00:00
|
|
|
changelog = "https://downloads.isc.org/isc/kea/${version}/Kea-${version}-ReleaseNotes.txt";
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://kea.isc.org/";
|
|
|
|
description = "High-performance, extensible DHCP server by ISC";
|
|
|
|
longDescription = ''
|
2021-07-18 21:22:44 +00:00
|
|
|
Kea is a new open source DHCPv4/DHCPv6 server being developed by
|
2020-04-24 23:36:52 +00:00
|
|
|
Internet Systems Consortium. The objective of this project is to
|
|
|
|
provide a very high-performance, extensible DHCP server engine for
|
|
|
|
use by enterprises and service providers, either as is or with
|
|
|
|
extensions and modifications.
|
|
|
|
'';
|
|
|
|
license = licenses.mpl20;
|
|
|
|
platforms = platforms.unix;
|
2021-07-18 21:22:44 +00:00
|
|
|
maintainers = with maintainers; [ fpletz hexa ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|