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