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