2019-04-27 16:51:43 +01:00
|
|
|
{ config, stdenv, lib, fetchurl, fetchpatch
|
2018-06-10 00:43:13 +01:00
|
|
|
, perl
|
|
|
|
, libcap, libtool, libxml2, openssl
|
2019-02-03 15:33:28 +00:00
|
|
|
, enablePython ? config.bind.enablePython or false, python3 ? null
|
2018-02-27 22:27:48 +00:00
|
|
|
, enableSeccomp ? false, libseccomp ? null, buildPackages
|
|
|
|
}:
|
2017-05-09 17:10:06 +01:00
|
|
|
|
|
|
|
assert enableSeccomp -> libseccomp != null;
|
2017-11-17 13:03:30 +00:00
|
|
|
assert enablePython -> python3 != null;
|
2011-01-07 11:33:04 +00:00
|
|
|
|
2019-04-26 08:02:07 +01:00
|
|
|
let version = "9.12.4-P1"; in
|
2012-10-02 16:48:54 +01:00
|
|
|
|
2011-01-07 11:33:04 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2015-06-01 20:35:41 +01:00
|
|
|
name = "bind-${version}";
|
2011-01-07 11:33:04 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2018-06-28 19:43:35 +01:00
|
|
|
url = "https://ftp.isc.org/isc/bind9/${version}/${name}.tar.gz";
|
2019-04-26 08:02:07 +01:00
|
|
|
sha256 = "1if7zc5gzrfd28csc63v9bjwrc0rgvm1x9yx058946hc5gp5lyp2";
|
2011-01-07 11:33:04 +00:00
|
|
|
};
|
|
|
|
|
2017-01-05 18:58:26 +00:00
|
|
|
outputs = [ "out" "lib" "dev" "man" "dnsutils" "host" ];
|
2015-10-30 21:12:29 +00:00
|
|
|
|
|
|
|
patches = [ ./dont-keep-configure-flags.patch ./remove-mkdir-var.patch ] ++
|
2019-04-27 16:51:43 +01:00
|
|
|
[
|
|
|
|
# Workaround for missing atomic operations on aarch64. Upstream added the
|
|
|
|
# below patch after the release. Can probably be dropped with the next
|
|
|
|
# version.
|
|
|
|
(fetchpatch {
|
|
|
|
name = "client-atomics-as-refcount.patch";
|
|
|
|
url = https://gitlab.isc.org/isc-projects/bind9/commit/d72f436b7d7c697b262968c48c2d7643069ab17f.diff;
|
|
|
|
sha256 = "0sidlab9wcv21751fbq3h9m4wy6hk7frag9ar2jndw8rn3axr2qy";
|
|
|
|
})
|
|
|
|
] ++
|
2016-05-12 23:29:30 +01:00
|
|
|
stdenv.lib.optional stdenv.isDarwin ./darwin-openssl-linking-fix.patch;
|
2015-11-28 18:26:59 +00:00
|
|
|
|
2018-01-09 22:54:08 +00:00
|
|
|
nativeBuildInputs = [ perl ];
|
2018-06-11 01:04:29 +01:00
|
|
|
buildInputs = [ libtool libxml2 openssl ]
|
|
|
|
++ lib.optional stdenv.isLinux libcap
|
2017-11-15 14:33:30 +00:00
|
|
|
++ lib.optional enableSeccomp libseccomp
|
2019-02-03 15:33:28 +00:00
|
|
|
++ lib.optional enablePython (python3.withPackages (ps: with ps; [ ply ]));
|
2011-01-07 11:33:04 +00:00
|
|
|
|
2017-02-19 11:11:52 +00:00
|
|
|
STD_CDEFINES = [ "-DDIG_SIGCHASE=1" ]; # support +sigchase
|
|
|
|
|
2018-02-27 22:27:48 +00:00
|
|
|
depsBuildBuild = [ buildPackages.stdenv.cc ];
|
|
|
|
|
2013-06-09 18:25:46 +01:00
|
|
|
configureFlags = [
|
2015-06-01 20:35:51 +01:00
|
|
|
"--localstatedir=/var"
|
|
|
|
"--with-libtool"
|
2016-08-30 00:57:21 +01:00
|
|
|
"--with-libxml2=${libxml2.dev}"
|
2016-04-16 18:44:32 +01:00
|
|
|
"--with-openssl=${openssl.dev}"
|
2017-11-15 14:33:30 +00:00
|
|
|
(if enablePython then "--with-python" else "--without-python")
|
2015-06-01 20:35:51 +01:00
|
|
|
"--without-atf"
|
|
|
|
"--without-dlopen"
|
|
|
|
"--without-docbook-xsl"
|
|
|
|
"--without-gssapi"
|
|
|
|
"--without-idn"
|
|
|
|
"--without-idnlib"
|
2017-12-21 20:07:22 +00:00
|
|
|
"--without-lmdb"
|
2018-06-10 00:43:13 +01:00
|
|
|
"--without-libjson"
|
2015-06-01 20:35:51 +01:00
|
|
|
"--without-pkcs11"
|
|
|
|
"--without-purify"
|
2018-02-27 22:27:48 +00:00
|
|
|
"--with-randomdev=/dev/random"
|
|
|
|
"--with-ecdsa"
|
|
|
|
"--with-gost"
|
|
|
|
"--without-eddsa"
|
|
|
|
"--with-aes"
|
2018-06-11 01:04:29 +01:00
|
|
|
] ++ lib.optional stdenv.isLinux "--with-libcap=${libcap.dev}"
|
|
|
|
++ lib.optional enableSeccomp "--enable-seccomp";
|
2012-10-02 16:48:54 +01:00
|
|
|
|
2015-10-30 21:12:29 +00:00
|
|
|
postInstall = ''
|
|
|
|
moveToOutput bin/bind9-config $dev
|
|
|
|
moveToOutput bin/isc-config.sh $dev
|
2016-05-18 21:05:51 +01:00
|
|
|
|
2016-10-08 15:01:15 +01:00
|
|
|
moveToOutput bin/host $host
|
|
|
|
|
|
|
|
moveToOutput bin/dig $dnsutils
|
|
|
|
moveToOutput bin/nslookup $dnsutils
|
|
|
|
moveToOutput bin/nsupdate $dnsutils
|
|
|
|
|
2016-12-08 17:50:07 +00: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 21:05:51 +01:00
|
|
|
done
|
2015-10-30 21:12:29 +00:00
|
|
|
'';
|
|
|
|
|
2018-04-25 04:20:18 +01:00
|
|
|
doCheck = false; # requires root and the net
|
|
|
|
|
2011-01-07 11:33:04 +00:00
|
|
|
meta = {
|
2019-04-15 00:25:45 +01:00
|
|
|
homepage = https://www.isc.org/downloads/bind/;
|
2014-08-24 15:21:08 +01:00
|
|
|
description = "Domain name server";
|
2018-01-17 01:39:20 +00:00
|
|
|
license = stdenv.lib.licenses.mpl20;
|
2015-06-01 20:35:51 +01:00
|
|
|
|
2018-07-22 20:50:19 +01:00
|
|
|
maintainers = with stdenv.lib.maintainers; [peti];
|
2015-06-01 20:35:51 +01:00
|
|
|
platforms = with stdenv.lib.platforms; unix;
|
2017-01-05 18:58:26 +00:00
|
|
|
|
|
|
|
outputsToInstall = [ "out" "dnsutils" "host" ];
|
2011-01-07 11:33:04 +00:00
|
|
|
};
|
|
|
|
}
|