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