diff options
author | Dmitry Kalinkin <dmitry.kalinkin@gmail.com> | 2021-11-20 23:41:44 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-20 23:41:44 -0500 |
commit | 296032dd5ff5e4c266782e73f9c00ee044f19c70 (patch) | |
tree | 18e45b72e8e87dc7eeef9941b363777d6ef92772 | |
parent | 67a50ee79f8be1f07b3846781bc7d25eb9211efc (diff) | |
parent | 34a7ce11562b146b57bf68083f322c370a06c1b1 (diff) |
Merge pull request #146822 from risicle/ris-libasyncns-darwin-fix
libasyncns: fix build for darwin
-rw-r--r-- | pkgs/development/libraries/libasyncns/default.nix | 5 | ||||
-rw-r--r-- | pkgs/development/python-modules/libasyncns/default.nix | 16 |
2 files changed, 19 insertions, 2 deletions
diff --git a/pkgs/development/libraries/libasyncns/default.nix b/pkgs/development/libraries/libasyncns/default.nix index c94e1c04e0ba..423b8cca6915 100644 --- a/pkgs/development/libraries/libasyncns/default.nix +++ b/pkgs/development/libraries/libasyncns/default.nix @@ -9,6 +9,11 @@ stdenv.mkDerivation rec { sha256 = "0x5b6lcic4cd7q0bx00x93kvpyzl7n2abbgvqbrlzrfb8vknc6jg"; }; + postPatch = lib.optionalString stdenv.isDarwin '' + substituteInPlace libasyncns/asyncns.c \ + --replace '<arpa/nameser.h>' '<arpa/nameser_compat.h>' + ''; + configureFlags = lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ "ac_cv_func_malloc_0_nonnull=yes" "ac_cv_func_realloc_0_nonnull=yes" diff --git a/pkgs/development/python-modules/libasyncns/default.nix b/pkgs/development/python-modules/libasyncns/default.nix index 38ca9b26360c..bd28c2207340 100644 --- a/pkgs/development/python-modules/libasyncns/default.nix +++ b/pkgs/development/python-modules/libasyncns/default.nix @@ -1,5 +1,10 @@ -{ lib, buildPythonPackage, fetchurl -, libasyncns, pkg-config }: +{ lib +, stdenv +, buildPythonPackage +, fetchurl +, libasyncns +, pkg-config +}: buildPythonPackage rec { pname = "libasyncns-python"; @@ -12,10 +17,17 @@ 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 + pythonImportsCheck = [ "libasyncns" ]; + meta = with lib; { description = "libasyncns-python is a python binding for the asynchronous name service query library"; license = licenses.lgpl21; |