1 { lib, stdenv, fetchurl, writeTextDir
3 , withCMake ? true, cmake
5 # sensitive downstream packages
7 , grpc # consumes cmake config
10 # Note: this package is used for bootstrapping fetchurl, and thus
11 # cannot use fetchpatch! All mutable patches (generated by GitHub or
12 # cgit) that are needed here should be included directly in Nixpkgs as
15 stdenv.mkDerivation rec {
18 outputs = [ "out" "dev" ];
21 url = "https://c-ares.haxx.se/download/${pname}-${version}.tar.gz";
22 sha256 = "sha256-Gn1SqKhKn7/7G+kTPA9uFyF9kepab6Yfa0cpzaeOu88=";
25 # c-ares is used for fetchpatch, so avoid using it for c-aresMinimal
26 patches = lib.optionals withCMake [
27 # fix .pc paths created by cmake build
29 url = "https://github.com/jonringer/c-ares/commit/9806a8a2f999a8a3efa3c893f2854dce6919d5bb.patch";
30 sha256 = "sha256-nh/ZKdan2/FTrouApRQA7O8KGZrLEUuWhxGOktiiGwU=";
34 nativeBuildInputs = lib.optionals withCMake [ cmake ];
36 cmakeFlags = [] ++ lib.optionals stdenv.hostPlatform.isStatic [
41 enableParallelBuilding = true;
48 description = "A C library for asynchronous DNS requests";
49 homepage = "https://c-ares.haxx.se";
50 license = licenses.mit;
51 platforms = platforms.all;