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