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