1{ lib 2, stdenv 3, buildPythonPackage 4, fetchurl 5, libasyncns 6, pkg-config 7}: 8 9buildPythonPackage rec { 10 pname = "libasyncns-python"; 11 version = "0.7.1"; 12 13 src = fetchurl { 14 url = "https://launchpad.net/libasyncns-python/trunk/${version}/+download/libasyncns-python-${version}.tar.bz2"; 15 sha256 = "1q4l71b2h9q756x4pjynp6kczr2d8c1jvbdp982hf7xzv7w5gxqg"; 16 }; 17 18 patches = [ ./libasyncns-fix-res-consts.patch ]; 19 20 postPatch = lib.optionalString stdenv.isDarwin '' 21 substituteInPlace resquery.c \ 22 --replace '<arpa/nameser.h>' '<arpa/nameser_compat.h>' 23 ''; 24 25 buildInputs = [ libasyncns ]; 26 nativeBuildInputs = [ pkg-config ]; 27 doCheck = false; # requires network access 28 29 pythonImportsCheck = [ "libasyncns" ]; 30 31 meta = with lib; { 32 description = "libasyncns-python is a python binding for the asynchronous name service query library"; 33 license = licenses.lgpl21; 34 maintainers = [ maintainers.mic92 ]; 35 homepage = "https://launchpad.net/libasyncns-python"; 36 }; 37}