summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/libasyncns/default.nix
blob: c22fdca4296c5b7c603e7e3b5bcddf1ec1aa9f0a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
{
  lib,
  stdenv,
  buildPythonPackage,
  fetchurl,
  libasyncns,
  pkg-config,
}:

buildPythonPackage rec {
  pname = "libasyncns-python";
  version = "0.7.1";
  format = "setuptools";

  src = fetchurl {
    url = "https://launchpad.net/libasyncns-python/trunk/${version}/+download/libasyncns-python-${version}.tar.bz2";
    sha256 = "1q4l71b2h9q756x4pjynp6kczr2d8c1jvbdp982hf7xzv7w5gxqg";
  };

  patches = [ ./libasyncns-fix-res-consts.patch ];

  postPatch = lib.optionalString stdenv.hostPlatform.isDarwin ''
    substituteInPlace resquery.c \
      --replace '<arpa/nameser.h>' '<arpa/nameser_compat.h>'
  '';

  buildInputs = [ libasyncns ];
  nativeBuildInputs = [ pkg-config ];
  doCheck = false; # requires network access

  pythonImportsCheck = [ "libasyncns" ];

  meta = {
    description = "Libasyncns-python is a python binding for the asynchronous name service query library";
    license = lib.licenses.lgpl21;
    maintainers = [ lib.maintainers.mic92 ];
    homepage = "https://launchpad.net/libasyncns-python";
  };
}