2019-04-27 17:51:43 +02:00
|
|
|
{ config, stdenv, lib, fetchurl, fetchpatch
|
2020-09-24 18:10:16 +02:00
|
|
|
, perl, pkg-config
|
|
|
|
, libcap, libtool, libxml2, openssl, libuv
|
2019-02-03 16:33:28 +01:00
|
|
|
, enablePython ? config.bind.enablePython or false, python3 ? null
|
2020-09-24 18:23:30 +02:00
|
|
|
, enableSeccomp ? false, libseccomp ? null, buildPackages, nixosTests
|
2018-02-27 23:27:48 +01:00
|
|
|
}:
|
2017-05-09 18:10:06 +02:00
|
|
|
|
|
|
|
assert enableSeccomp -> libseccomp != null;
|
2017-11-17 14:03:30 +01:00
|
|
|
assert enablePython -> python3 != null;
|
2011-01-07 12:33:04 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-13 23:52:01 +02:00
|
|
|
pname = "bind";
|
2021-04-29 03:39:40 +02:00
|
|
|
version = "9.16.15";
|
2011-01-07 12:33:04 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
2020-09-24 18:10:16 +02:00
|
|
|
url = "https://downloads.isc.org/isc/bind9/${version}/${pname}-${version}.tar.xz";
|
2021-04-29 03:39:40 +02:00
|
|
|
sha256 = "0fbqisrh84f8wszm94cqp7v8q9r7pql3qyzbay7vz9vqv0rg9dlq";
|
2011-01-07 12:33:04 +01:00
|
|
|
};
|
|
|
|
|
2017-01-05 19:58:26 +01:00
|
|
|
outputs = [ "out" "lib" "dev" "man" "dnsutils" "host" ];
|
2015-10-30 22:12:29 +01:00
|
|
|
|
2019-05-17 09:59:53 +02:00
|
|
|
patches = [
|
|
|
|
./dont-keep-configure-flags.patch
|
|
|
|
./remove-mkdir-var.patch
|
2019-06-09 09:36:26 +02:00
|
|
|
];
|
2015-11-28 19:26:59 +01:00
|
|
|
|
2020-09-24 18:10:16 +02:00
|
|
|
nativeBuildInputs = [ perl pkg-config ];
|
|
|
|
buildInputs = [ libtool libxml2 openssl libuv ]
|
2018-06-11 02:04:29 +02:00
|
|
|
++ lib.optional stdenv.isLinux libcap
|
2017-11-15 15:33:30 +01:00
|
|
|
++ lib.optional enableSeccomp libseccomp
|
2019-02-03 16:33:28 +01:00
|
|
|
++ lib.optional enablePython (python3.withPackages (ps: with ps; [ ply ]));
|
2011-01-07 12:33:04 +01:00
|
|
|
|
2018-02-27 23:27:48 +01:00
|
|
|
depsBuildBuild = [ buildPackages.stdenv.cc ];
|
|
|
|
|
2013-06-09 19:25:46 +02:00
|
|
|
configureFlags = [
|
2015-06-01 21:35:51 +02:00
|
|
|
"--localstatedir=/var"
|
|
|
|
"--with-libtool"
|
2017-11-15 15:33:30 +01:00
|
|
|
(if enablePython then "--with-python" else "--without-python")
|
2015-06-01 21:35:51 +02:00
|
|
|
"--without-atf"
|
|
|
|
"--without-dlopen"
|
|
|
|
"--without-docbook-xsl"
|
|
|
|
"--without-gssapi"
|
|
|
|
"--without-idn"
|
|
|
|
"--without-idnlib"
|
2017-12-21 21:07:22 +01:00
|
|
|
"--without-lmdb"
|
2018-06-10 01:43:13 +02:00
|
|
|
"--without-libjson"
|
2015-06-01 21:35:51 +02:00
|
|
|
"--without-pkcs11"
|
|
|
|
"--without-purify"
|
2018-02-27 23:27:48 +01:00
|
|
|
"--with-randomdev=/dev/random"
|
|
|
|
"--with-ecdsa"
|
|
|
|
"--with-gost"
|
|
|
|
"--without-eddsa"
|
|
|
|
"--with-aes"
|
2018-06-11 02:04:29 +02:00
|
|
|
] ++ lib.optional stdenv.isLinux "--with-libcap=${libcap.dev}"
|
2020-06-15 21:03:03 +02:00
|
|
|
++ lib.optional enableSeccomp "--enable-seccomp"
|
|
|
|
++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) "BUILD_CC=$(CC_FOR_BUILD)";
|
2012-10-02 17:48:54 +02:00
|
|
|
|
2015-10-30 22:12:29 +01:00
|
|
|
postInstall = ''
|
|
|
|
moveToOutput bin/bind9-config $dev
|
2016-05-18 22:05:51 +02:00
|
|
|
|
2016-10-08 16:01:15 +02:00
|
|
|
moveToOutput bin/host $host
|
|
|
|
|
|
|
|
moveToOutput bin/dig $dnsutils
|
2019-10-16 14:38:35 +02:00
|
|
|
moveToOutput bin/delv $dnsutils
|
2016-10-08 16:01:15 +02:00
|
|
|
moveToOutput bin/nslookup $dnsutils
|
|
|
|
moveToOutput bin/nsupdate $dnsutils
|
|
|
|
|
2020-09-24 18:10:16 +02:00
|
|
|
for f in "$lib/lib/"*.la "$dev/bin/"bind*-config; do
|
2016-12-08 18:50:07 +01:00
|
|
|
sed -i "$f" -e 's|-L${openssl.dev}|-L${openssl.out}|g'
|
2016-05-18 22:05:51 +02:00
|
|
|
done
|
2015-10-30 22:12:29 +01:00
|
|
|
'';
|
|
|
|
|
2018-04-25 05:20:18 +02:00
|
|
|
doCheck = false; # requires root and the net
|
|
|
|
|
2020-09-24 18:23:30 +02:00
|
|
|
passthru.tests = { inherit (nixosTests) bind; };
|
|
|
|
|
2021-01-11 08:54:33 +01:00
|
|
|
meta = with lib; {
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "https://www.isc.org/downloads/bind/";
|
2014-08-24 16:21:08 +02:00
|
|
|
description = "Domain name server";
|
2019-08-20 19:36:05 +02:00
|
|
|
license = licenses.mpl20;
|
2015-06-01 21:35:51 +02:00
|
|
|
|
2019-08-20 19:36:05 +02:00
|
|
|
maintainers = with maintainers; [ peti globin ];
|
|
|
|
platforms = platforms.unix;
|
2017-01-05 19:58:26 +01:00
|
|
|
|
|
|
|
outputsToInstall = [ "out" "dnsutils" "host" ];
|
2011-01-07 12:33:04 +01:00
|
|
|
};
|
|
|
|
}
|