nixpkgs/pkgs/tools/networking/kea/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

110 lines
2.8 KiB
Nix
Raw Normal View History

{ stdenv
, lib
, fetchurl
# build time
, autoreconfHook
, pkg-config
, python3Packages
# runtime
, withMysql ? stdenv.buildPlatform.system == stdenv.hostPlatform.system
, withPostgres ? stdenv.buildPlatform.system == stdenv.hostPlatform.system
, boost
, libmysqlclient
, log4cplus
, openssl
, postgresql
2021-07-14 00:46:08 +02:00
, python3
# 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";
version = "2.4.1"; # only even minor versions are stable
2016-10-24 20:01:42 +02:00
src = fetchurl {
url = "https://ftp.isc.org/isc/${pname}/${version}/${pname}-${version}.tar.gz";
hash = "sha256-gVxh9cJxyqSh2zHdZW61Cn9uqXPaNpD3yFgUCOGAExo=";
2016-10-24 20:01:42 +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
'';
outputs = [
"out"
"doc"
"man"
];
2016-10-24 20:01:42 +02:00
configureFlags = [
"--enable-perfdhcp"
"--enable-shell"
2016-10-24 20:01:42 +02:00
"--localstatedir=/var"
"--with-openssl=${lib.getDev openssl}"
]
++ lib.optional withPostgres "--with-pgsql=${postgresql}/bin/pg_config"
++ lib.optional withMysql "--with-mysql=${lib.getDev libmysqlclient}/bin/mysql_config";
postConfigure = ''
# Mangle embedded paths to dev-only inputs.
sed -e "s|$NIX_STORE/[a-z0-9]\{32\}-|$NIX_STORE/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-|g" -i config.report
'';
nativeBuildInputs = [
autoreconfHook
pkg-config
] ++ (with python3Packages; [
sphinxHook
sphinx-rtd-theme
]);
sphinxBuilders = [
"html"
"man"
2016-10-24 20:01:42 +02:00
];
sphinxRoot = "doc/sphinx";
2016-10-24 20:01:42 +02:00
buildInputs = [
boost
libmysqlclient
log4cplus
openssl
python3
2016-10-24 20:01:42 +02:00
];
enableParallelBuilding = true;
2021-07-14 00:46:08 +02:00
passthru.tests = {
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
};
meta = with lib; {
changelog = "https://downloads.isc.org/isc/kea/${version}/Kea-${version}-ReleaseNotes.txt";
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
};
}