rio: 0.0.36 -> 0.0.37
[NixPkgs.git] / pkgs / servers / http / bozohttpd / default.nix
blob0aad8168ffa8f43d1a4634669857ced6a65a5820
1 { lib
2 , stdenv
3 , fetchurl
4 , bmake
5 , groff
6 , inetutils
7 , wget
8 , openssl
9 , libxcrypt
10 , minimal ? false
11 , userSupport ? !minimal
12 , cgiSupport ? !minimal
13 , dirIndexSupport ? !minimal
14 , dynamicContentSupport ? !minimal
15 , sslSupport ? !minimal
16 , luaSupport ? !minimal
17 , lua
18 , htpasswdSupport ? !minimal
21 let inherit (lib) optional optionals;
23 stdenv.mkDerivation rec {
24   pname = "bozohttpd";
25   version = "20240126";
27   # bozohttpd is developed in-tree in pkgsrc, canonical hashes can be found at:
28   # http://cvsweb.netbsd.org/bsdweb.cgi/pkgsrc/www/bozohttpd/distinfo
29   src = fetchurl {
30     url = "http://eterna23.net/${pname}/${pname}-${version}.tar.bz2";
31     hash = "sha512-fr1PnyYAS3wkpmj/npRC3A87UL9LIXw4thlM4GfrtlJbuX5EkWGVJnHJW/EmYp7z+N91dcdRJgdO79l6WJsKpg==";
32   };
34   buildInputs = [ openssl libxcrypt ] ++ optional (luaSupport) lua;
35   nativeBuildInputs = [ bmake groff ];
37   COPTS = [
38     "-D_DEFAULT_SOURCE"
39     "-D_GNU_SOURCE"
41     # ensure that we can serve >2GB files even on 32-bit systems.
42     "-D_LARGEFILE_SOURCE"
43     "-D_FILE_OFFSET_BITS=64"
45     # unpackaged dependency: https://man.netbsd.org/blocklist.3
46     "-DNO_BLOCKLIST_SUPPORT"
47   ]
48   ++ optional (!userSupport) "-DNO_USER_SUPPORT"
49   ++ optional (!dirIndexSupport) "-DNO_DIRINDEX_SUPPORT"
50   ++ optional (!dynamicContentSupport) "-DNO_DYNAMIC_CONTENT"
51   ++ optional (!luaSupport) "-DNO_LUA_SUPPORT"
52   ++ optional (!sslSupport) "-DNO_SSL_SUPPORT"
53   ++ optional (!cgiSupport) "-DNO_CGIBIN_SUPPORT"
54   ++ optional (htpasswdSupport) "-DDO_HTPASSWD";
56   _LDADD = [ "-lm" ]
57     ++ optional (stdenv.hostPlatform.libc != "libSystem") "-lcrypt"
58     ++ optional (luaSupport) "-llua"
59     ++ optionals (sslSupport) [ "-lssl" "-lcrypto" ];
60   makeFlags = [ "LDADD=$(_LDADD)" ];
62   doCheck = true;
63   nativeCheckInputs = [ inetutils wget ];
64   checkFlags = optional (!cgiSupport) "CGITESTS=";
66   meta = with lib; {
67     description = "Bozotic HTTP server; small and secure";
68     longDescription = ''
69       bozohttpd is a small and secure HTTP version 1.1 server. Its main
70       feature is the lack of features, reducing the code size and improving
71       verifiability.
73       It supports CGI/1.1, HTTP/1.1, HTTP/1.0, HTTP/0.9, ~user translations,
74       virtual hosting support, as well as multiple IP-based servers on a
75       single machine. It is capable of servicing pages via the IPv6 protocol.
76       It has SSL support. It has no configuration file by design.
77     '';
78     homepage = "http://www.eterna.com.au/bozohttpd/";
79     changelog = "http://www.eterna.com.au/bozohttpd/CHANGES";
80     license = licenses.bsd2;
81     maintainers = [ maintainers.embr ];
82     platforms = platforms.all;
83   };