2019-05-08 00:43:00 -07:00
|
|
|
{ stdenv, buildPackages, fetchurl, pkgconfig, pcre, libxml2, zlib, bzip2, which, file
|
2015-01-12 23:36:34 -08:00
|
|
|
, openssl, enableMagnet ? false, lua5_1 ? null
|
2019-09-22 00:38:09 -07:00
|
|
|
, enableMysql ? false, libmysqlclient ? null
|
2017-12-19 13:00:19 -08:00
|
|
|
, enableLdap ? false, openldap ? null
|
2019-01-06 01:58:27 -08:00
|
|
|
, enableWebDAV ? false, sqlite ? null, libuuid ? null
|
2019-01-06 02:03:49 -08:00
|
|
|
, enableExtendedAttrs ? false, attr ? null
|
2018-08-08 14:29:43 -07:00
|
|
|
, perl
|
2013-09-25 04:18:27 -07:00
|
|
|
}:
|
|
|
|
|
2015-01-12 23:36:34 -08:00
|
|
|
assert enableMagnet -> lua5_1 != null;
|
2019-09-22 00:38:09 -07:00
|
|
|
assert enableMysql -> libmysqlclient != null;
|
2017-12-19 13:00:19 -08:00
|
|
|
assert enableLdap -> openldap != null;
|
2018-05-17 16:35:31 -07:00
|
|
|
assert enableWebDAV -> sqlite != null;
|
|
|
|
assert enableWebDAV -> libuuid != null;
|
2019-01-06 02:03:49 -08:00
|
|
|
assert enableExtendedAttrs -> attr != null;
|
2010-07-28 04:55:54 -07:00
|
|
|
|
2013-11-17 14:06:25 -08:00
|
|
|
stdenv.mkDerivation rec {
|
2020-02-08 07:56:42 -08:00
|
|
|
name = "lighttpd-1.4.55";
|
2008-09-23 17:42:50 -07:00
|
|
|
|
2010-07-28 04:55:54 -07:00
|
|
|
src = fetchurl {
|
2018-06-28 11:43:35 -07:00
|
|
|
url = "https://download.lighttpd.net/lighttpd/releases-1.4.x/${name}.tar.xz";
|
2020-02-08 07:56:42 -08:00
|
|
|
sha256 = "09z947730yjh438wrqb3z1c5hr1dbb11a8sr92g3vk6mr7lm02va";
|
2008-09-23 17:42:50 -07:00
|
|
|
};
|
|
|
|
|
2018-08-08 14:29:43 -07:00
|
|
|
postPatch = ''
|
|
|
|
patchShebangs tests
|
2019-01-11 02:19:59 -08:00
|
|
|
# Linux sandbox has an empty hostname and not /etc/hosts, which fails some tests
|
|
|
|
sed -ire '/[$]self->{HOSTNAME} *=/i if(length($name)==0) { $name = "127.0.0.1" }' tests/LightyTest.pm
|
2018-08-08 14:29:43 -07:00
|
|
|
'';
|
|
|
|
|
2019-05-08 00:43:00 -07:00
|
|
|
depsBuildBuild = [ buildPackages.stdenv.cc ];
|
|
|
|
|
2017-09-05 14:26:13 -07:00
|
|
|
nativeBuildInputs = [ pkgconfig ];
|
2019-05-08 00:43:00 -07:00
|
|
|
buildInputs = [ pcre pcre.dev libxml2 zlib bzip2 which file openssl ]
|
2015-01-12 23:36:34 -08:00
|
|
|
++ stdenv.lib.optional enableMagnet lua5_1
|
2019-09-22 00:38:09 -07:00
|
|
|
++ stdenv.lib.optional enableMysql libmysqlclient
|
2018-05-17 16:35:31 -07:00
|
|
|
++ stdenv.lib.optional enableLdap openldap
|
|
|
|
++ stdenv.lib.optional enableWebDAV sqlite
|
|
|
|
++ stdenv.lib.optional enableWebDAV libuuid;
|
2013-04-23 04:30:57 -07:00
|
|
|
|
2013-09-25 04:18:27 -07:00
|
|
|
configureFlags = [ "--with-openssl" ]
|
2014-03-12 15:02:30 -07:00
|
|
|
++ stdenv.lib.optional enableMagnet "--with-lua"
|
2017-12-19 13:00:19 -08:00
|
|
|
++ stdenv.lib.optional enableMysql "--with-mysql"
|
2018-05-17 16:35:31 -07:00
|
|
|
++ stdenv.lib.optional enableLdap "--with-ldap"
|
|
|
|
++ stdenv.lib.optional enableWebDAV "--with-webdav-props"
|
2019-01-06 02:03:49 -08:00
|
|
|
++ stdenv.lib.optional enableWebDAV "--with-webdav-locks"
|
|
|
|
++ stdenv.lib.optional enableExtendedAttrs "--with-attr";
|
2013-04-01 06:28:05 -07:00
|
|
|
|
|
|
|
preConfigure = ''
|
2019-05-08 00:43:00 -07:00
|
|
|
export PATH=$PATH:${pcre.dev}/bin
|
2013-04-01 06:28:05 -07:00
|
|
|
sed -i "s:/usr/bin/file:${file}/bin/file:g" configure
|
|
|
|
'';
|
2008-09-23 17:42:50 -07:00
|
|
|
|
2018-08-08 14:29:43 -07:00
|
|
|
checkInputs = [ perl ];
|
2019-01-06 02:05:30 -08:00
|
|
|
doCheck = true;
|
2018-08-08 14:29:43 -07:00
|
|
|
|
2017-04-23 10:20:43 -07: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 10:33:18 -07:00
|
|
|
meta = with stdenv.lib; {
|
2010-07-28 04:55:54 -07:00
|
|
|
description = "Lightweight high-performance web server";
|
2020-03-31 18:11:51 -07:00
|
|
|
homepage = "http://www.lighttpd.net/";
|
2014-12-20 15:00:35 -08:00
|
|
|
license = stdenv.lib.licenses.bsd3;
|
2019-01-06 02:03:49 -08:00
|
|
|
platforms = platforms.linux ++ platforms.darwin;
|
2013-11-17 14:06:25 -08:00
|
|
|
maintainers = [ maintainers.bjornfor ];
|
2008-09-23 17:42:50 -07:00
|
|
|
};
|
|
|
|
}
|