2022-10-30 15:09:59 +00:00
|
|
|
{ lib, stdenv, fetchurl, writeTextDir
|
|
|
|
, fetchpatch
|
|
|
|
, 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";
|
2022-01-13 20:06:32 +00:00
|
|
|
version = "1.18.1";
|
2022-10-30 15:09:59 +00:00
|
|
|
outputs = [ "out" "dev" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2020-12-03 08:41:04 +00:00
|
|
|
url = "https://c-ares.haxx.se/download/${pname}-${version}.tar.gz";
|
2022-01-13 20:06:32 +00:00
|
|
|
sha256 = "sha256-Gn1SqKhKn7/7G+kTPA9uFyF9kepab6Yfa0cpzaeOu88=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-10-30 15:09:59 +00:00
|
|
|
# c-ares is used for fetchpatch, so avoid using it for c-aresMinimal
|
|
|
|
patches = lib.optionals withCMake [
|
|
|
|
# fix .pc paths created by cmake build
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/jonringer/c-ares/commit/9806a8a2f999a8a3efa3c893f2854dce6919d5bb.patch";
|
|
|
|
sha256 = "sha256-nh/ZKdan2/FTrouApRQA7O8KGZrLEUuWhxGOktiiGwU=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
|
|
|
nativeBuildInputs = lib.optionals withCMake [ cmake ];
|
|
|
|
|
2021-09-18 10:52:07 +00:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2022-10-30 15:09:59 +00:00
|
|
|
passthru.tests = {
|
|
|
|
inherit curl grpc;
|
|
|
|
};
|
|
|
|
|
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";
|
|
|
|
license = licenses.mit;
|
|
|
|
platforms = platforms.all;
|
|
|
|
};
|
2022-10-30 15:09:59 +00:00
|
|
|
}
|