3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/servers/dns/bind/default.nix

71 lines
2 KiB
Nix
Raw Normal View History

{ stdenv, lib, fetchurl, openssl, libtool, perl, libxml2
, enableSeccomp ? false, libseccomp ? null
2017-11-17 13:03:30 +00:00
, enablePython ? false, python3 ? null }:
assert enableSeccomp -> libseccomp != null;
2017-11-17 13:03:30 +00:00
assert enablePython -> python3 != null;
let version = "9.11.2"; in
stdenv.mkDerivation rec {
name = "bind-${version}";
src = fetchurl {
url = "http://ftp.isc.org/isc/bind9/${version}/${name}.tar.gz";
sha256 = "0yn7wgi2y8mpmvbjbkl4va7p0xsnn48m4yjx6ynb1hzp423asikz";
};
outputs = [ "out" "lib" "dev" "man" "dnsutils" "host" ];
patches = [ ./dont-keep-configure-flags.patch ./remove-mkdir-var.patch ] ++
stdenv.lib.optional stdenv.isDarwin ./darwin-openssl-linking-fix.patch;
buildInputs = [ openssl libtool perl libxml2 ]
++ lib.optional enableSeccomp libseccomp
2017-11-17 13:03:30 +00:00
++ lib.optional enablePython python3;
STD_CDEFINES = [ "-DDIG_SIGCHASE=1" ]; # support +sigchase
configureFlags = [
"--localstatedir=/var"
"--with-libtool"
"--with-libxml2=${libxml2.dev}"
"--with-openssl=${openssl.dev}"
(if enablePython then "--with-python" else "--without-python")
"--without-atf"
"--without-dlopen"
"--without-docbook-xsl"
"--without-gssapi"
"--without-idn"
"--without-idnlib"
"--without-pkcs11"
"--without-purify"
] ++ lib.optional enableSeccomp "--enable-seccomp";
postInstall = ''
moveToOutput bin/bind9-config $dev
moveToOutput bin/isc-config.sh $dev
moveToOutput bin/host $host
moveToOutput bin/dig $dnsutils
moveToOutput bin/nslookup $dnsutils
moveToOutput bin/nsupdate $dnsutils
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'
done
'';
meta = {
homepage = http://www.isc.org/software/bind;
description = "Domain name server";
license = stdenv.lib.licenses.isc;
maintainers = with stdenv.lib.maintainers; [viric peti];
platforms = with stdenv.lib.platforms; unix;
outputsToInstall = [ "out" "dnsutils" "host" ];
};
}