2017-02-21 21:52:43 +00:00
|
|
|
{ stdenv, fetchurl, cmake,
|
|
|
|
libxslt, zlib, libxml2, openssl,
|
|
|
|
enableSSL ? true,
|
|
|
|
enableMonitor ? false,
|
|
|
|
enableRproxy ? true,
|
|
|
|
enableTomahawk ? false,
|
|
|
|
enableXSLT ? true,
|
|
|
|
enableToolkit ? true
|
|
|
|
}:
|
|
|
|
|
|
|
|
assert enableSSL -> openssl !=null;
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "hiawatha-${version}";
|
2018-05-07 11:15:08 +01:00
|
|
|
version = "10.8.1";
|
2017-02-21 21:52:43 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://github.com/hsleisink/hiawatha/archive/v${version}.tar.gz";
|
2018-05-07 11:15:08 +01:00
|
|
|
sha256 = "1f2hlw2lp98b4dx87i7pz7h66vsy2g22b5adfrlij3kj0vfv61w8";
|
2017-02-21 21:52:43 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [ cmake libxslt zlib libxml2 ] ++ stdenv.lib.optional enableSSL openssl ;
|
|
|
|
|
2017-06-16 13:34:53 +01:00
|
|
|
prePatch = ''
|
|
|
|
substituteInPlace CMakeLists.txt --replace SETUID ""
|
|
|
|
'';
|
|
|
|
|
2017-02-21 21:52:43 +00:00
|
|
|
cmakeFlags = [
|
|
|
|
( if enableSSL then "-DENABLE_TLS=on" else "-DENABLE_TLS=off" )
|
|
|
|
( if enableMonitor then "-DENABLE_MONITOR=on" else "-DENABLE_MONITOR=off" )
|
|
|
|
( if enableRproxy then "-DENABLE_RPROXY=on" else "-DENABLE_RPROXY=off" )
|
|
|
|
( if enableTomahawk then "-DENABLE_TOMAHAWK=on" else "-DENABLE_TOMAHAWK=off" )
|
|
|
|
( if enableXSLT then "-DENABLE_XSLT=on" else "-DENABLE_XSLT=off" )
|
|
|
|
( if enableToolkit then "-DENABLE_TOOLKIT=on" else "-DENABLE_TOOLKIT=off" )
|
|
|
|
"-DWEBROOT_DIR=/var/www/hiawatha"
|
|
|
|
"-DPID_DIR=/run"
|
|
|
|
"-DWORK_DIR=/var/lib/hiawatha"
|
|
|
|
"-DLOG_DIR=/var/log/hiawatha"
|
|
|
|
];
|
|
|
|
|
|
|
|
# workaround because cmake tries installs stuff outside of nix store
|
|
|
|
makeFlags = [ "DESTDIR=$(out)" "PREFIX=" ];
|
|
|
|
postInstall = ''
|
|
|
|
mv $out/$out/* $out
|
|
|
|
rm -rf $out/{var,run}
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "An advanced and secure webserver";
|
|
|
|
license = licenses.gpl2;
|
2017-08-01 21:03:30 +01:00
|
|
|
homepage = https://www.hiawatha-webserver.org;
|
2017-12-05 22:20:11 +00:00
|
|
|
maintainers = [ maintainers.ndowens ];
|
2017-02-21 21:52:43 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|