1 { stdenv, fetchurl, perl, file, nettools, iputils, iproute2, makeWrapper
2 , coreutils, gnused, openldap ? null
6 stdenv.mkDerivation rec {
11 url = "https://ftp.isc.org/isc/dhcp/${version}/${pname}-${version}.tar.gz";
12 sha256 = "08a5003zdxgl41b29zjkxa92h2i40zyjgxg0npvnhpkfl5jcsz0s";
17 # Make sure that the hostname gets set on reboot. Without this
18 # patch, the hostname doesn't get set properly if the old
19 # hostname (i.e. before reboot) is equal to the new hostname.
23 nativeBuildInputs = [ perl makeWrapper ];
25 buildInputs = [ openldap ];
27 depsBuildBuild = [ buildPackages.stdenv.cc ];
33 "--enable-delayed-ack"
36 "--enable-early-chroot"
38 "--localstatedir=/var"
39 ] ++ lib.optional stdenv.isLinux "--with-randomdev=/dev/random"
40 ++ lib.optionals (openldap != null) [ "--with-ldap" "--with-ldapcrypto" ];
42 NIX_CFLAGS_COMPILE = builtins.toString [
43 "-Wno-error=pointer-compare"
44 "-Wno-error=format-truncation"
45 "-Wno-error=stringop-truncation"
46 "-Wno-error=format-overflow"
47 "-Wno-error=stringop-overflow=8"
50 installFlags = [ "DESTDIR=\${out}" ];
56 while rmdir $DIR 2>/dev/null; do
57 DIR="$(dirname "$DIR")"
60 cp client/scripts/linux $out/sbin/dhclient-script
61 substituteInPlace $out/sbin/dhclient-script \
62 --replace /sbin/ip ${iproute2}/sbin/ip
63 wrapProgram "$out/sbin/dhclient-script" --prefix PATH : \
64 "${nettools}/bin:${nettools}/sbin:${iputils}/bin:${coreutils}/bin:${gnused}/bin"
69 substituteInPlace configure --replace "/usr/bin/file" "${file}/bin/file"
70 sed -i "includes/dhcpd.h" \
71 -e "s|^ *#define \+_PATH_DHCLIENT_SCRIPT.*$|#define _PATH_DHCLIENT_SCRIPT \"$out/sbin/dhclient-script\"|g"
73 export AR='${stdenv.cc.bintools.bintools}/bin/${stdenv.cc.targetPrefix}ar'
77 description = "Dynamic Host Configuration Protocol (DHCP) tools";
80 ISC's Dynamic Host Configuration Protocol (DHCP) distribution
81 provides a freely redistributable reference implementation of
82 all aspects of DHCP, through a suite of DHCP tools: server,
83 client, and relay agent.
86 homepage = "https://www.isc.org/dhcp/";
87 license = licenses.isc;
88 platforms = platforms.unix;