hiawatha: GitHub -> GitLab, clean-up, build with ninja
Developer deleted account on GitHub. As a GitLab proof - official page: https://www.hiawatha-webserver.org/download points to GitLab. * Web server officially created for mbedtls, use bundled * Assert not needed * Build with cmake/ninja * Removed hack, no longer needed
This commit is contained in:
parent
d8bf4d3e09
commit
daef5308ec
@ -1,50 +1,50 @@
|
|||||||
{ stdenv, fetchurl, cmake,
|
{ stdenv
|
||||||
libxslt, zlib, libxml2, openssl,
|
, fetchFromGitLab
|
||||||
enableSSL ? true,
|
|
||||||
enableMonitor ? false,
|
|
||||||
enableRproxy ? true,
|
|
||||||
enableTomahawk ? false,
|
|
||||||
enableXSLT ? true,
|
|
||||||
enableToolkit ? true
|
|
||||||
}:
|
|
||||||
|
|
||||||
assert enableSSL -> openssl !=null;
|
, cmake
|
||||||
|
, ninja
|
||||||
|
|
||||||
|
, libxslt
|
||||||
|
, libxml2
|
||||||
|
|
||||||
|
, enableSSL ? true
|
||||||
|
, enableMonitor ? false
|
||||||
|
, enableRproxy ? true
|
||||||
|
, enableTomahawk ? false
|
||||||
|
, enableXSLT ? true
|
||||||
|
, enableToolkit ? true
|
||||||
|
}:
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
name = "hiawatha-${version}";
|
name = "hiawatha-${version}";
|
||||||
version = "10.8.1";
|
version = "10.8.1";
|
||||||
|
|
||||||
src = fetchurl {
|
src = fetchFromGitLab {
|
||||||
url = "https://github.com/hsleisink/hiawatha/archive/v${version}.tar.gz";
|
owner = "hsleisink";
|
||||||
sha256 = "1f2hlw2lp98b4dx87i7pz7h66vsy2g22b5adfrlij3kj0vfv61w8";
|
repo = "hiawatha";
|
||||||
|
rev = "v${version}";
|
||||||
|
sha256 = "1428byx0xpzzwyc0j157q70sjx18dykvg6fd5vp70kj85ank0xpa";
|
||||||
};
|
};
|
||||||
|
|
||||||
buildInputs = [ cmake libxslt zlib libxml2 ] ++ stdenv.lib.optional enableSSL openssl ;
|
nativeBuildInputs = [ cmake ninja ];
|
||||||
|
buildInputs = [ libxslt libxml2 ];
|
||||||
|
|
||||||
prePatch = ''
|
prePatch = ''
|
||||||
substituteInPlace CMakeLists.txt --replace SETUID ""
|
substituteInPlace CMakeLists.txt --replace SETUID ""
|
||||||
'';
|
'';
|
||||||
|
|
||||||
cmakeFlags = [
|
cmakeFlags = [
|
||||||
( if enableSSL then "-DENABLE_TLS=on" else "-DENABLE_TLS=off" )
|
(
|
||||||
|
# FIXME: 2018-06-08: Uses bundled library, with external ("-DUSE_SYSTEM_MBEDTLS=on") asks:
|
||||||
|
# ../src/tls.c:46:2: error: #error "The mbed TLS library must be compiled with MBEDTLS_THREADING_PTHREAD and MBEDTLS_THREADING_C enabled."
|
||||||
|
if enableSSL then "-DENABLE_TLS=on" else "-DENABLE_TLS=off" )
|
||||||
( if enableMonitor then "-DENABLE_MONITOR=on" else "-DENABLE_MONITOR=off" )
|
( if enableMonitor then "-DENABLE_MONITOR=on" else "-DENABLE_MONITOR=off" )
|
||||||
( if enableRproxy then "-DENABLE_RPROXY=on" else "-DENABLE_RPROXY=off" )
|
( if enableRproxy then "-DENABLE_RPROXY=on" else "-DENABLE_RPROXY=off" )
|
||||||
( if enableTomahawk then "-DENABLE_TOMAHAWK=on" else "-DENABLE_TOMAHAWK=off" )
|
( if enableTomahawk then "-DENABLE_TOMAHAWK=on" else "-DENABLE_TOMAHAWK=off" )
|
||||||
( if enableXSLT then "-DENABLE_XSLT=on" else "-DENABLE_XSLT=off" )
|
( if enableXSLT then "-DENABLE_XSLT=on" else "-DENABLE_XSLT=off" )
|
||||||
( if enableToolkit then "-DENABLE_TOOLKIT=on" else "-DENABLE_TOOLKIT=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; {
|
meta = with stdenv.lib; {
|
||||||
description = "An advanced and secure webserver";
|
description = "An advanced and secure webserver";
|
||||||
license = licenses.gpl2;
|
license = licenses.gpl2;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user