python3Packages.libasyncns: fix build for darwin

This commit is contained in:
Robert Scott 2021-11-20 23:39:53 +00:00
parent a907da6e63
commit 15f425ae9c

View File

@ -1,5 +1,10 @@
{ lib, buildPythonPackage, fetchurl
, libasyncns, pkg-config }:
{ lib
, stdenv
, buildPythonPackage
, fetchurl
, libasyncns
, pkg-config
}:
buildPythonPackage rec {
pname = "libasyncns-python";
@ -12,6 +17,11 @@ buildPythonPackage rec {
patches = [ ./libasyncns-fix-res-consts.patch ];
postPatch = lib.optionalString stdenv.isDarwin ''
substituteInPlace resquery.c \
--replace '<arpa/nameser.h>' '<arpa/nameser_compat.h>'
'';
buildInputs = [ libasyncns ];
nativeBuildInputs = [ pkg-config ];
doCheck = false; # requires network access