2022-10-30 15:09:59 +00:00
|
|
|
{ lib, stdenv, fetchurl, writeTextDir
|
|
|
|
, withCMake ? true, cmake
|
|
|
|
|
|
|
|
# sensitive downstream packages
|
|
|
|
, curl
|
|
|
|
, grpc # consumes cmake config
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-08-20 17:08:02 +00:00
|
|
|
# Note: this package is used for bootstrapping fetchurl, and thus
|
|
|
|
# cannot use fetchpatch! All mutable patches (generated by GitHub or
|
|
|
|
# cgit) that are needed here should be included directly in Nixpkgs as
|
|
|
|
# files.
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2020-12-03 08:41:04 +00:00
|
|
|
pname = "c-ares";
|
2024-02-29 20:09:43 +00:00
|
|
|
version = "1.26.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2024-01-02 11:29:13 +00:00
|
|
|
url = "https://c-ares.org/download/${pname}-${version}.tar.gz";
|
2024-02-29 20:09:43 +00:00
|
|
|
hash = "sha256-vtWMTwKwCQgOvabCRnukaXIqxq679El9xEqD2MYZTlA=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
outputs = [ "out" "dev" "man" ];
|
|
|
|
|
2022-10-30 15:09:59 +00:00
|
|
|
nativeBuildInputs = lib.optionals withCMake [ cmake ];
|
|
|
|
|
2022-11-21 17:40:18 +00:00
|
|
|
cmakeFlags = [] ++ lib.optionals stdenv.hostPlatform.isStatic [
|
|
|
|
"-DCARES_SHARED=OFF"
|
|
|
|
"-DCARES_STATIC=ON"
|
|
|
|
];
|
|
|
|
|
2021-09-18 10:52:07 +00:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2022-10-30 15:09:59 +00:00
|
|
|
passthru.tests = {
|
2023-10-09 19:29:22 +00:00
|
|
|
inherit grpc;
|
|
|
|
curl = (curl.override { c-aresSupport = true; }).tests.withCheck;
|
2022-10-30 15:09:59 +00:00
|
|
|
};
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "A C library for asynchronous DNS requests";
|
|
|
|
homepage = "https://c-ares.haxx.se";
|
2023-03-15 16:39:30 +00:00
|
|
|
changelog = "https://c-ares.org/changelog.html#${lib.replaceStrings [ "." ] [ "_" ] version}";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
platforms = platforms.all;
|
|
|
|
};
|
2022-10-30 15:09:59 +00:00
|
|
|
}
|