tuicam: init at 0.0.2 (#377825)
[NixPkgs.git] / pkgs / by-name / li / lighttpd / package.nix
blob798a330dda693a48dc38a056b8d01c78a0a56e4b
2   lib,
3   stdenv,
4   buildPackages,
5   fetchurl,
6   pkg-config,
7   pcre2,
8   libxml2,
9   zlib,
10   bzip2,
11   which,
12   file,
13   autoreconfHook,
14   openssl,
15   enableDbi ? false,
16   libdbi,
17   enableMagnet ? false,
18   lua5_1,
19   enableMysql ? false,
20   libmysqlclient,
21   enableLdap ? false,
22   openldap,
23   enablePam ? false,
24   linux-pam,
25   enableSasl ? false,
26   cyrus_sasl,
27   enableWebDAV ? false,
28   sqlite,
29   libuuid,
30   enableExtendedAttrs ? false,
31   perl,
32   nixosTests,
35 stdenv.mkDerivation rec {
36   pname = "lighttpd";
37   version = "1.4.77";
39   src = fetchurl {
40     url = "https://download.lighttpd.net/lighttpd/releases-${lib.versions.majorMinor version}.x/${pname}-${version}.tar.xz";
41     sha256 = "sha256-rK+r2/oiZ9i2RS0D2F/dKmZSXz8Fo2p5tmRcAX8VYs4=";
42   };
44   separateDebugInfo = true;
46   postPatch = ''
47     patchShebangs tests
48   '';
50   depsBuildBuild = [ buildPackages.stdenv.cc ];
52   nativeBuildInputs = [
53     autoreconfHook
54     pkg-config
55   ];
56   buildInputs =
57     [
58       pcre2
59       pcre2.dev
60       libxml2
61       zlib
62       bzip2
63       which
64       file
65       openssl
66     ]
67     ++ lib.optional enableDbi libdbi
68     ++ lib.optional enableMagnet lua5_1
69     ++ lib.optional enableMysql libmysqlclient
70     ++ lib.optional enableLdap openldap
71     ++ lib.optional enablePam linux-pam
72     ++ lib.optional enableSasl cyrus_sasl
73     ++ lib.optional enableWebDAV sqlite
74     ++ lib.optional enableWebDAV libuuid;
76   configureFlags =
77     [ "--with-openssl" ]
78     ++ lib.optional enableDbi "--with-dbi"
79     ++ lib.optional enableMagnet "--with-lua"
80     ++ lib.optional enableMysql "--with-mysql"
81     ++ lib.optional enableLdap "--with-ldap"
82     ++ lib.optional enablePam "--with-pam"
83     ++ lib.optional enableSasl "--with-sasl"
84     ++ lib.optional enableWebDAV "--with-webdav-props"
85     ++ lib.optional enableWebDAV "--with-webdav-locks"
86     ++ lib.optional enableExtendedAttrs "--with-attr";
88   preConfigure = ''
89     export PATH=$PATH:${pcre2.dev}/bin
90     sed -i "s:/usr/bin/file:${file}/bin/file:g" configure
91   '';
93   nativeCheckInputs = [ perl ];
94   doCheck = true;
96   postInstall = ''
97     mkdir -p "$out/share/lighttpd/doc/config"
98     cp -vr doc/config "$out/share/lighttpd/doc/"
99     # Remove files that references needless store paths (dependency bloat)
100     rm "$out/share/lighttpd/doc/config/Makefile"*
101     rm "$out/share/lighttpd/doc/config/conf.d/Makefile"*
102     rm "$out/share/lighttpd/doc/config/vhosts.d/Makefile"*
103   '';
105   passthru.tests = {
106     inherit (nixosTests) lighttpd;
107   };
109   meta = with lib; {
110     description = "Lightweight high-performance web server";
111     homepage = "http://www.lighttpd.net/";
112     license = lib.licenses.bsd3;
113     platforms = platforms.linux ++ platforms.darwin;
114     maintainers = with maintainers; [
115       bjornfor
116       brecht
117     ];
118     mainProgram = "lighttpd";
119   };