2013-09-25 12:18:27 +01:00
|
|
|
{ stdenv, fetchurl, pkgconfig, pcre, libxml2, zlib, attr, bzip2, which, file
|
2015-01-13 07:36:34 +00:00
|
|
|
, openssl, enableMagnet ? false, lua5_1 ? null
|
2014-03-12 22:02:30 +00:00
|
|
|
, enableMysql ? false, mysql ? null
|
2013-09-25 12:18:27 +01:00
|
|
|
}:
|
|
|
|
|
2015-01-13 07:36:34 +00:00
|
|
|
assert enableMagnet -> lua5_1 != null;
|
2014-03-12 22:02:30 +00:00
|
|
|
assert enableMysql -> mysql != null;
|
2010-07-28 12:55:54 +01:00
|
|
|
|
2013-11-17 22:06:25 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2017-01-16 19:36:46 +00:00
|
|
|
name = "lighttpd-1.4.45";
|
2008-09-24 01:42:50 +01:00
|
|
|
|
2010-07-28 12:55:54 +01:00
|
|
|
src = fetchurl {
|
2013-11-17 22:06:25 +00:00
|
|
|
url = "http://download.lighttpd.net/lighttpd/releases-1.4.x/${name}.tar.xz";
|
2017-01-16 19:36:46 +00:00
|
|
|
sha256 = "0grsqh7pdqnjx6xicd96adsx84vryb7c4n21dnxfygm3xrfj55qw";
|
2008-09-24 01:42:50 +01:00
|
|
|
};
|
|
|
|
|
2013-09-25 12:18:27 +01:00
|
|
|
buildInputs = [ pkgconfig pcre libxml2 zlib attr bzip2 which file openssl ]
|
2015-01-13 07:36:34 +00:00
|
|
|
++ stdenv.lib.optional enableMagnet lua5_1
|
2015-04-02 00:39:50 +01:00
|
|
|
++ stdenv.lib.optional enableMysql mysql.lib;
|
2013-04-23 12:30:57 +01:00
|
|
|
|
2013-09-25 12:18:27 +01:00
|
|
|
configureFlags = [ "--with-openssl" ]
|
2014-03-12 22:02:30 +00:00
|
|
|
++ stdenv.lib.optional enableMagnet "--with-lua"
|
|
|
|
++ stdenv.lib.optional enableMysql "--with-mysql";
|
2013-04-01 14:28:05 +01:00
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
sed -i "s:/usr/bin/file:${file}/bin/file:g" configure
|
|
|
|
'';
|
2008-09-24 01:42:50 +01:00
|
|
|
|
2017-04-23 18:20:43 +01: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 18:33:18 +01:00
|
|
|
meta = with stdenv.lib; {
|
2010-07-28 12:55:54 +01:00
|
|
|
description = "Lightweight high-performance web server";
|
|
|
|
homepage = http://www.lighttpd.net/;
|
2014-12-20 23:00:35 +00:00
|
|
|
license = stdenv.lib.licenses.bsd3;
|
2013-05-20 18:33:18 +01:00
|
|
|
platforms = platforms.linux;
|
2013-11-17 22:06:25 +00:00
|
|
|
maintainers = [ maintainers.bjornfor ];
|
2008-09-24 01:42:50 +01:00
|
|
|
};
|
|
|
|
}
|