2016-10-16 22:37:48 +02:00
|
|
|
{ stdenv, lib, fetchurl, openssl, libtool, perl, libxml2
|
2018-04-21 21:48:30 +02:00
|
|
|
, enablePython ? false, python3 ? null
|
2018-02-27 23:27:48 +01:00
|
|
|
, enableSeccomp ? false, libseccomp ? null, buildPackages
|
|
|
|
}:
|
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
|
|
|
|
2018-03-17 20:32:55 +01:00
|
|
|
let version = "9.12.1"; in
|
2012-10-02 17:48:54 +02:00
|
|
|
|
2011-01-07 12:33:04 +01:00
|
|
|
stdenv.mkDerivation rec {
|
2015-06-01 21:35:41 +02:00
|
|
|
name = "bind-${version}";
|
2011-01-07 12:33:04 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
2015-06-01 21:35:41 +02:00
|
|
|
url = "http://ftp.isc.org/isc/bind9/${version}/${name}.tar.gz";
|
2018-03-17 20:32:55 +01:00
|
|
|
sha256 = "043mjcw405qa0ghm5dkhfsq35gsy279724fz3mjqpr1mbi14dr0n";
|
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
|
|
|
|
|
|
|
patches = [ ./dont-keep-configure-flags.patch ./remove-mkdir-var.patch ] ++
|
2016-05-13 00:29:30 +02:00
|
|
|
stdenv.lib.optional stdenv.isDarwin ./darwin-openssl-linking-fix.patch;
|
2015-11-28 19:26:59 +01:00
|
|
|
|
2018-01-09 23:54:08 +01:00
|
|
|
nativeBuildInputs = [ perl ];
|
2018-04-21 21:48:30 +02:00
|
|
|
buildInputs = [ openssl libtool libxml2 ]
|
2017-11-15 15:33:30 +01:00
|
|
|
++ lib.optional enableSeccomp libseccomp
|
2017-11-17 14:03:30 +01:00
|
|
|
++ lib.optional enablePython python3;
|
2011-01-07 12:33:04 +01:00
|
|
|
|
2017-02-19 12:11:52 +01:00
|
|
|
STD_CDEFINES = [ "-DDIG_SIGCHASE=1" ]; # support +sigchase
|
|
|
|
|
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"
|
2016-08-30 01:57:21 +02:00
|
|
|
"--with-libxml2=${libxml2.dev}"
|
2016-04-16 19:44:32 +02:00
|
|
|
"--with-openssl=${openssl.dev}"
|
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"
|
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"
|
2017-05-09 18:10:06 +02:00
|
|
|
] ++ lib.optional enableSeccomp "--enable-seccomp";
|
2012-10-02 17:48:54 +02:00
|
|
|
|
2015-10-30 22:12:29 +01:00
|
|
|
postInstall = ''
|
|
|
|
moveToOutput bin/bind9-config $dev
|
|
|
|
moveToOutput bin/isc-config.sh $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
|
|
|
|
moveToOutput bin/nslookup $dnsutils
|
|
|
|
moveToOutput bin/nsupdate $dnsutils
|
|
|
|
|
2016-12-08 18:50:07 +01: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 22:05:51 +02:00
|
|
|
done
|
2015-10-30 22:12:29 +01:00
|
|
|
'';
|
|
|
|
|
2011-01-07 12:33:04 +01:00
|
|
|
meta = {
|
2017-08-01 22:03:30 +02:00
|
|
|
homepage = http://www.isc.org/software/bind;
|
2014-08-24 16:21:08 +02:00
|
|
|
description = "Domain name server";
|
2018-01-17 02:39:20 +01:00
|
|
|
license = stdenv.lib.licenses.mpl20;
|
2015-06-01 21:35:51 +02:00
|
|
|
|
2016-05-16 22:30:20 +02:00
|
|
|
maintainers = with stdenv.lib.maintainers; [viric peti];
|
2015-06-01 21:35:51 +02:00
|
|
|
platforms = with stdenv.lib.platforms; unix;
|
2017-01-05 19:58:26 +01:00
|
|
|
|
|
|
|
outputsToInstall = [ "out" "dnsutils" "host" ];
|
2011-01-07 12:33:04 +01:00
|
|
|
};
|
|
|
|
}
|