tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
libmicrohttpd: Modernize
William A. Kennington III
10 years ago
c5d13d4f
60eda8f6
+48
-21
1 changed file
expand all
collapse all
unified
split
pkgs
development
libraries
libmicrohttpd
default.nix
+48
-21
pkgs/development/libraries/libmicrohttpd/default.nix
···
1
1
-
{stdenv, fetchurl, curl, libgcrypt}:
1
1
+
{ stdenv, fetchurl, pkgconfig
2
2
+
, curl
3
3
+
4
4
+
# Optional Dependencies
5
5
+
, openssl ? null, zlib ? null, libgcrypt ? null, gnutls ? null
6
6
+
}:
7
7
+
8
8
+
let
9
9
+
mkFlag = trueStr: falseStr: cond: name: val:
10
10
+
if cond == null then null else
11
11
+
"--${if cond != false then trueStr else falseStr}${name}${if val != null && cond != false then "=${val}" else ""}";
12
12
+
mkEnable = mkFlag "enable-" "disable-";
13
13
+
mkWith = mkFlag "with-" "without-";
14
14
+
mkOther = mkFlag "" "" true;
15
15
+
16
16
+
shouldUsePkg = pkg: if pkg != null && stdenv.lib.any (x: x == stdenv.system) pkg.meta.platforms then pkg else null;
17
17
+
18
18
+
optOpenssl = shouldUsePkg openssl;
19
19
+
optZlib = shouldUsePkg zlib;
20
20
+
hasSpdy = optOpenssl != null && optZlib != null;
2
21
22
22
+
optLibgcrypt = shouldUsePkg libgcrypt;
23
23
+
optGnutls = shouldUsePkg gnutls;
24
24
+
hasHttps = optLibgcrypt != null && optGnutls != null;
25
25
+
in
26
26
+
with stdenv.lib;
3
27
stdenv.mkDerivation rec {
4
4
-
name = "libmicrohttpd-0.9.38";
28
28
+
name = "libmicrohttpd-0.9.41";
5
29
6
30
src = fetchurl {
7
31
url = "mirror://gnu/libmicrohttpd/${name}.tar.gz";
8
8
-
sha256 = "08g7p4l0p2fsjj8ayl68zq1bqgrn0pck19bm8yd7k61whvfv9wld";
32
32
+
sha256 = "0z3s3aplgxj8cj947i4rxk9wzvg68b8hbn71fyipc7aagmivx64p";
9
33
};
10
34
11
11
-
buildInputs = [ curl libgcrypt ];
35
35
+
nativeBuildInputs = [ pkgconfig ];
36
36
+
buildInputs = optional doCheck curl
37
37
+
++ optionals hasSpdy [ optOpenssl optZlib ]
38
38
+
++ optionals hasHttps [ optLibgcrypt optGnutls ];
12
39
13
13
-
preCheck =
14
14
-
# Since `localhost' can't be resolved in a chroot, work around it.
15
15
-
'' for i in "src/test"*"/"*.[ch]
16
16
-
do
17
17
-
sed -i "$i" -es/localhost/127.0.0.1/g
18
18
-
done
19
19
-
'';
40
40
+
configureFlags = [
41
41
+
(mkWith true "threads" "posix")
42
42
+
(mkEnable true "doc" null)
43
43
+
(mkEnable false "examples" null)
44
44
+
(mkEnable true "epoll" "auto")
45
45
+
(mkEnable doCheck "curl" null)
46
46
+
(mkEnable hasSpdy "spdy" null)
47
47
+
(mkEnable true "messages" null)
48
48
+
(mkEnable true "postprocessor" null)
49
49
+
(mkWith hasHttps "gnutls" null)
50
50
+
(mkEnable hasHttps "https" null)
51
51
+
(mkEnable true "bauth" null)
52
52
+
(mkEnable true "dauth" null)
53
53
+
];
20
54
21
55
# Disabled because the tests can time-out.
22
56
doCheck = false;
23
57
24
58
meta = {
25
59
description = "Embeddable HTTP server library";
26
26
-
27
27
-
longDescription = ''
28
28
-
GNU libmicrohttpd is a small C library that is supposed to make
29
29
-
it easy to run an HTTP server as part of another application.
30
30
-
'';
31
31
-
32
32
-
license = stdenv.lib.licenses.lgpl2Plus;
33
33
-
34
60
homepage = http://www.gnu.org/software/libmicrohttpd/;
35
35
-
36
36
-
maintainers = [ ];
61
61
+
license = licenses.lgpl2Plus;
62
62
+
platforms = platforms.all;
63
63
+
maintainers = with maintainers; [ wkennington ];
37
64
};
38
65
}