1 { stdenv, lib, fetchurl, gnum4 }:
3 stdenv.mkDerivation rec {
9 "https://www.chiark.greenend.org.uk/~ian/adns/ftp/adns-${version}.tar.gz"
10 "ftp://ftp.chiark.greenend.org.uk/users/ian/adns/adns-${version}.tar.gz"
11 "mirror://gnu/adns/adns-${version}.tar.gz"
13 sha256 = "1pi0xl07pav4zm2jrbrfpv43s1r1q1y12awgak8k7q41m5jp4hpv";
16 nativeBuildInputs = [ gnum4 ];
18 configureFlags = lib.optional stdenv.hostPlatform.isStatic "--disable-dynamic";
21 lib.optionalString stdenv.isDarwin "sed -i -e 's|-Wl,-soname=$(SHLIBSONAME)||' configure";
23 # Autogenerated headers miss interdependencies in Makefile, fail parallel build:
24 # https://debbugs.gnu.org/cgi/bugreport.cgi?bug=51329
25 enableParallelBuilding = false;
27 # https://www.mail-archive.com/nix-dev@cs.uu.nl/msg01347.html for details.
30 postInstall = let suffix = lib.versions.majorMinor version;
31 in lib.optionalString stdenv.isDarwin ''
32 install_name_tool -id $out/lib/libadns.so.${suffix} $out/lib/libadns.so.${suffix}
35 # darwin executables fail, but I don't want to fail the 100-500 packages depending on this lib
36 doInstallCheck = !stdenv.isDarwin;
37 installCheckPhase = ''
40 for prog in $out/bin/*; do
41 $prog --help > /dev/null && echo $(basename $prog) shows usage
46 homepage = "http://www.chiark.greenend.org.uk/~ian/adns/";
47 description = "Asynchronous DNS Resolver Library";
48 license = licenses.lgpl2;
50 platforms = platforms.unix;