1{ lib, stdenv, fetchurl }:
2
3stdenv.mkDerivation rec {
4 pname = "libasyncns";
5 version = "0.8";
6
7 src = fetchurl {
8 url = "http://0pointer.de/lennart/projects/libasyncns/${pname}-${version}.tar.gz";
9 sha256 = "0x5b6lcic4cd7q0bx00x93kvpyzl7n2abbgvqbrlzrfb8vknc6jg";
10 };
11
12 postPatch = lib.optionalString stdenv.isDarwin ''
13 substituteInPlace libasyncns/asyncns.c \
14 --replace '<arpa/nameser.h>' '<arpa/nameser_compat.h>'
15 '';
16
17 configureFlags = lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
18 "ac_cv_func_malloc_0_nonnull=yes"
19 "ac_cv_func_realloc_0_nonnull=yes"
20 ];
21
22 meta = with lib; {
23 homepage = "http://0pointer.de/lennart/projects/libasyncns/";
24 description = "A C library for Linux/Unix for executing name service queries asynchronously";
25 license = licenses.lgpl21;
26 platforms = platforms.unix;
27 };
28}