Merge pull request #146822 from risicle/ris-libasyncns-darwin-fix

libasyncns: fix build for darwin

authored by Dmitry Kalinkin and committed by GitHub 296032dd 67a50ee7

+19 -2
+5
pkgs/development/libraries/libasyncns/default.nix
··· 9 sha256 = "0x5b6lcic4cd7q0bx00x93kvpyzl7n2abbgvqbrlzrfb8vknc6jg"; 10 }; 11 12 configureFlags = lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ 13 "ac_cv_func_malloc_0_nonnull=yes" 14 "ac_cv_func_realloc_0_nonnull=yes"
··· 9 sha256 = "0x5b6lcic4cd7q0bx00x93kvpyzl7n2abbgvqbrlzrfb8vknc6jg"; 10 }; 11 12 + postPatch = lib.optionalString stdenv.isDarwin '' 13 + substituteInPlace libasyncns/asyncns.c \ 14 + --replace '<arpa/nameser.h>' '<arpa/nameser_compat.h>' 15 + ''; 16 + 17 configureFlags = lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ 18 "ac_cv_func_malloc_0_nonnull=yes" 19 "ac_cv_func_realloc_0_nonnull=yes"
+14 -2
pkgs/development/python-modules/libasyncns/default.nix
··· 1 - { lib, buildPythonPackage, fetchurl 2 - , libasyncns, pkg-config }: 3 4 buildPythonPackage rec { 5 pname = "libasyncns-python"; ··· 12 13 patches = [ ./libasyncns-fix-res-consts.patch ]; 14 15 buildInputs = [ libasyncns ]; 16 nativeBuildInputs = [ pkg-config ]; 17 doCheck = false; # requires network access 18 19 meta = with lib; { 20 description = "libasyncns-python is a python binding for the asynchronous name service query library";
··· 1 + { lib 2 + , stdenv 3 + , buildPythonPackage 4 + , fetchurl 5 + , libasyncns 6 + , pkg-config 7 + }: 8 9 buildPythonPackage rec { 10 pname = "libasyncns-python"; ··· 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";