2013-09-25 13:18:27 +02:00
|
|
|
{ stdenv, fetchurl, pkgconfig, pcre, libxml2, zlib, attr, bzip2, which, file
|
2015-01-13 08:36:34 +01:00
|
|
|
, openssl, enableMagnet ? false, lua5_1 ? null
|
2014-03-12 23:02:30 +01:00
|
|
|
, enableMysql ? false, mysql ? null
|
2017-12-19 22:00:19 +01:00
|
|
|
, enableLdap ? false, openldap ? null
|
2018-05-18 01:35:31 +02:00
|
|
|
, enableWebDAV ? true, sqlite ? null, libuuid ? null
|
2018-08-08 23:29:43 +02:00
|
|
|
, perl
|
2013-09-25 13:18:27 +02:00
|
|
|
}:
|
|
|
|
|
2015-01-13 08:36:34 +01:00
|
|
|
assert enableMagnet -> lua5_1 != null;
|
2014-03-12 23:02:30 +01:00
|
|
|
assert enableMysql -> mysql != null;
|
2017-12-19 22:00:19 +01:00
|
|
|
assert enableLdap -> openldap != null;
|
2018-05-18 01:35:31 +02:00
|
|
|
assert enableWebDAV -> sqlite != null;
|
|
|
|
assert enableWebDAV -> libuuid != null;
|
2010-07-28 13:55:54 +02:00
|
|
|
|
2013-11-17 23:06:25 +01:00
|
|
|
stdenv.mkDerivation rec {
|
2018-10-27 13:21:11 +02:00
|
|
|
name = "lighttpd-1.4.51";
|
2008-09-24 02:42:50 +02:00
|
|
|
|
2010-07-28 13:55:54 +02:00
|
|
|
src = fetchurl {
|
2018-06-28 20:43:35 +02:00
|
|
|
url = "https://download.lighttpd.net/lighttpd/releases-1.4.x/${name}.tar.xz";
|
2018-10-27 13:21:11 +02:00
|
|
|
sha256 = "10lw9vvivpvf4aw7ajayb2yyq4lp4dq3gq9llszjbw6icnrgvy9a";
|
2008-09-24 02:42:50 +02:00
|
|
|
};
|
|
|
|
|
2018-08-08 23:29:43 +02:00
|
|
|
postPatch = ''
|
|
|
|
patchShebangs tests
|
|
|
|
'';
|
|
|
|
|
2017-09-05 23:26:13 +02:00
|
|
|
nativeBuildInputs = [ pkgconfig ];
|
|
|
|
buildInputs = [ pcre libxml2 zlib attr bzip2 which file openssl ]
|
2015-01-13 08:36:34 +01:00
|
|
|
++ stdenv.lib.optional enableMagnet lua5_1
|
2017-07-09 17:43:03 +02:00
|
|
|
++ stdenv.lib.optional enableMysql mysql.connector-c
|
2018-05-18 01:35:31 +02:00
|
|
|
++ stdenv.lib.optional enableLdap openldap
|
|
|
|
++ stdenv.lib.optional enableWebDAV sqlite
|
|
|
|
++ stdenv.lib.optional enableWebDAV libuuid;
|
2013-04-23 13:30:57 +02:00
|
|
|
|
2013-09-25 13:18:27 +02:00
|
|
|
configureFlags = [ "--with-openssl" ]
|
2014-03-12 23:02:30 +01:00
|
|
|
++ stdenv.lib.optional enableMagnet "--with-lua"
|
2017-12-19 22:00:19 +01:00
|
|
|
++ stdenv.lib.optional enableMysql "--with-mysql"
|
2018-05-18 01:35:31 +02:00
|
|
|
++ stdenv.lib.optional enableLdap "--with-ldap"
|
|
|
|
++ stdenv.lib.optional enableWebDAV "--with-webdav-props"
|
|
|
|
++ stdenv.lib.optional enableWebDAV "--with-webdav-locks";
|
2013-04-01 15:28:05 +02:00
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
sed -i "s:/usr/bin/file:${file}/bin/file:g" configure
|
|
|
|
'';
|
2008-09-24 02:42:50 +02:00
|
|
|
|
2018-08-08 23:29:43 +02:00
|
|
|
checkInputs = [ perl ];
|
|
|
|
doCheck = false; # fails 2 tests
|
|
|
|
|
2017-04-23 19:20:43 +02:00
|
|
|
postInstall = ''
|
|
|
|
mkdir -p "$out/share/lighttpd/doc/config"
|
|
|
|
cp -vr doc/config "$out/share/lighttpd/doc/"
|
|
|
|
# Remove files that references needless store paths (dependency bloat)
|
|
|
|
rm "$out/share/lighttpd/doc/config/Makefile"*
|
|
|
|
rm "$out/share/lighttpd/doc/config/conf.d/Makefile"*
|
|
|
|
rm "$out/share/lighttpd/doc/config/vhosts.d/Makefile"*
|
|
|
|
'';
|
|
|
|
|
2013-05-20 19:33:18 +02:00
|
|
|
meta = with stdenv.lib; {
|
2010-07-28 13:55:54 +02:00
|
|
|
description = "Lightweight high-performance web server";
|
|
|
|
homepage = http://www.lighttpd.net/;
|
2014-12-21 00:00:35 +01:00
|
|
|
license = stdenv.lib.licenses.bsd3;
|
2013-05-20 19:33:18 +02:00
|
|
|
platforms = platforms.linux;
|
2013-11-17 23:06:25 +01:00
|
|
|
maintainers = [ maintainers.bjornfor ];
|
2008-09-24 02:42:50 +02:00
|
|
|
};
|
|
|
|
}
|