2020-12-27 22:35:51 +01:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, fetchurl
|
2022-10-13 05:16:41 +02:00
|
|
|
|
|
|
|
# build time
|
2020-12-27 22:35:51 +01:00
|
|
|
, autoreconfHook
|
|
|
|
, pkg-config
|
2023-10-26 08:33:00 +02:00
|
|
|
, python3Packages
|
2022-10-13 05:16:41 +02:00
|
|
|
|
|
|
|
# runtime
|
2023-10-26 08:33:00 +02:00
|
|
|
, withMysql ? stdenv.buildPlatform.system == stdenv.hostPlatform.system
|
|
|
|
, withPostgres ? stdenv.buildPlatform.system == stdenv.hostPlatform.system
|
2020-12-27 22:35:51 +01:00
|
|
|
, boost
|
|
|
|
, libmysqlclient
|
|
|
|
, log4cplus
|
2022-10-13 05:16:41 +02:00
|
|
|
, openssl
|
2020-12-27 22:35:51 +01:00
|
|
|
, postgresql
|
2021-07-14 00:46:08 +02:00
|
|
|
, python3
|
2022-10-13 05:16:41 +02:00
|
|
|
|
|
|
|
# tests
|
2021-07-14 00:46:08 +02:00
|
|
|
, nixosTests
|
|
|
|
}:
|
2020-09-09 21:06:31 +02:00
|
|
|
|
2016-10-24 20:01:42 +02:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "kea";
|
2023-11-29 09:13:44 +01:00
|
|
|
version = "2.4.1"; # only even minor versions are stable
|
2016-10-24 20:01:42 +02:00
|
|
|
|
|
|
|
src = fetchurl {
|
2019-08-15 14:41:18 +02:00
|
|
|
url = "https://ftp.isc.org/isc/${pname}/${version}/${pname}-${version}.tar.gz";
|
2023-11-29 09:13:44 +01:00
|
|
|
hash = "sha256-gVxh9cJxyqSh2zHdZW61Cn9uqXPaNpD3yFgUCOGAExo=";
|
2016-10-24 20:01:42 +02:00
|
|
|
};
|
|
|
|
|
2022-10-13 05:16:41 +02:00
|
|
|
patches = [
|
|
|
|
./dont-create-var.patch
|
|
|
|
];
|
2016-10-24 20:01:42 +02:00
|
|
|
|
|
|
|
postPatch = ''
|
2017-08-02 19:05:20 +02:00
|
|
|
substituteInPlace ./src/bin/keactrl/Makefile.am --replace '@sysconfdir@' "$out/etc"
|
2022-10-29 18:52:53 +02:00
|
|
|
# darwin special-casing just causes trouble
|
|
|
|
substituteInPlace ./m4macros/ax_crypto.m4 --replace 'apple-darwin' 'nope'
|
2016-10-24 20:01:42 +02:00
|
|
|
'';
|
|
|
|
|
2022-10-13 05:17:52 +02:00
|
|
|
outputs = [
|
|
|
|
"out"
|
|
|
|
"doc"
|
|
|
|
"man"
|
|
|
|
];
|
|
|
|
|
2016-10-24 20:01:42 +02:00
|
|
|
configureFlags = [
|
2020-12-27 22:35:51 +01:00
|
|
|
"--enable-perfdhcp"
|
|
|
|
"--enable-shell"
|
2016-10-24 20:01:42 +02:00
|
|
|
"--localstatedir=/var"
|
2022-10-13 05:16:41 +02:00
|
|
|
"--with-openssl=${lib.getDev openssl}"
|
2023-10-26 08:33:00 +02:00
|
|
|
]
|
|
|
|
++ lib.optional withPostgres "--with-pgsql=${postgresql}/bin/pg_config"
|
|
|
|
++ lib.optional withMysql "--with-mysql=${lib.getDev libmysqlclient}/bin/mysql_config";
|
|
|
|
|
2023-09-26 15:28:11 +02: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
|
|
|
|
'';
|
2020-12-27 22:35:51 +01:00
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
autoreconfHook
|
|
|
|
pkg-config
|
2023-10-26 08:33:00 +02:00
|
|
|
] ++ (with python3Packages; [
|
2022-10-13 05:17:52 +02:00
|
|
|
sphinxHook
|
|
|
|
sphinx-rtd-theme
|
|
|
|
]);
|
|
|
|
|
|
|
|
sphinxBuilders = [
|
|
|
|
"html"
|
|
|
|
"man"
|
2016-10-24 20:01:42 +02:00
|
|
|
];
|
2022-10-13 05:17:52 +02:00
|
|
|
sphinxRoot = "doc/sphinx";
|
2016-10-24 20:01:42 +02:00
|
|
|
|
|
|
|
buildInputs = [
|
2020-12-27 22:35:51 +01:00
|
|
|
boost
|
|
|
|
libmysqlclient
|
|
|
|
log4cplus
|
2022-10-13 05:16:41 +02:00
|
|
|
openssl
|
2020-12-27 22:35:51 +01:00
|
|
|
python3
|
2016-10-24 20:01:42 +02:00
|
|
|
];
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2021-07-14 00:46:08 +02:00
|
|
|
passthru.tests = {
|
2022-10-13 05:36:07 +02:00
|
|
|
kea = nixosTests.kea;
|
|
|
|
prefix-delegation = nixosTests.systemd-networkd-ipv6-prefix-delegation;
|
2023-08-04 14:43:24 +02: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-14 00:46:08 +02:00
|
|
|
};
|
|
|
|
|
2021-01-11 08:54:33 +01:00
|
|
|
meta = with lib; {
|
2023-07-06 21:06:39 +02:00
|
|
|
changelog = "https://downloads.isc.org/isc/kea/${version}/Kea-${version}-ReleaseNotes.txt";
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "https://kea.isc.org/";
|
2016-10-24 20:01:42 +02:00
|
|
|
description = "High-performance, extensible DHCP server by ISC";
|
|
|
|
longDescription = ''
|
2021-07-14 00:46:08 +02:00
|
|
|
Kea is a new open source DHCPv4/DHCPv6 server being developed by
|
2016-10-24 20:01:42 +02: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-12 01:37:39 +02:00
|
|
|
maintainers = with maintainers; [ fpletz hexa ];
|
2016-10-24 20:01:42 +02:00
|
|
|
};
|
|
|
|
}
|