Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{
2 lib,
3 stdenv,
4 fetchurl,
5 libxml2,
6 pkg-config,
7 compressionSupport ? true,
8 zlib ? null,
9 sslSupport ? true,
10 openssl ? null,
11 static ? stdenv.hostPlatform.isStatic,
12 shared ? !stdenv.hostPlatform.isStatic,
13 bash,
14}:
15
16assert compressionSupport -> zlib != null;
17assert sslSupport -> openssl != null;
18assert static || shared;
19
20let
21 inherit (lib) optionals;
22in
23
24stdenv.mkDerivation rec {
25 version = "0.34.2";
26 pname = "neon";
27
28 src = fetchurl {
29 url = "https://notroj.github.io/${pname}/${pname}-${version}.tar.gz";
30 sha256 = "sha256-+Yzjx0MAvgXt3wXcy9ykmLFNQMKJ93MZXdGlWc/6WFY=";
31 };
32
33 patches = optionals stdenv.hostPlatform.isDarwin [ ./darwin-fix-configure.patch ];
34
35 nativeBuildInputs = [ pkg-config ];
36 buildInputs = [
37 libxml2
38 openssl
39 bash
40 ]
41 ++ lib.optional compressionSupport zlib;
42
43 strictDeps = true;
44
45 configureFlags = [
46 (lib.enableFeature shared "shared")
47 (lib.enableFeature static "static")
48 (lib.withFeature compressionSupport "zlib")
49 (lib.withFeature sslSupport "ssl")
50 ];
51
52 preConfigure = ''
53 export PKG_CONFIG="$(command -v "$PKG_CONFIG")"
54 '';
55
56 passthru = { inherit compressionSupport sslSupport; };
57
58 meta = {
59 description = "HTTP and WebDAV client library";
60 mainProgram = "neon-config";
61 homepage = "https://notroj.github.io/neon/";
62 changelog = "https://github.com/notroj/${pname}/blob/${version}/NEWS";
63 platforms = lib.platforms.unix;
64 license = lib.licenses.lgpl2;
65 };
66}