2021-01-15 22:18:51 +00:00
|
|
|
{ lib, stdenv
|
2020-04-24 23:36:52 +00:00
|
|
|
, fetchFromGitLab
|
2024-06-20 14:57:18 +00:00
|
|
|
, callPackage
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
, cmake
|
|
|
|
, ninja
|
2024-06-20 14:57:18 +00:00
|
|
|
, mbedtls
|
2022-10-30 15:09:59 +00:00
|
|
|
, libxcrypt
|
2024-09-19 14:19:46 +00:00
|
|
|
, zlib
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
, enableCache ? true # Internal cache support.
|
|
|
|
, enableIpV6 ? true
|
|
|
|
, enableTls ? true
|
|
|
|
, enableMonitor ? false # Support for the Hiawatha Monitor.
|
|
|
|
, enableRproxy ? true # Reverse proxy support.
|
|
|
|
, enableTomahawk ? false # Tomahawk, the Hiawatha command shell.
|
|
|
|
, enableXslt ? true, libxml2 ? null, libxslt ? null
|
|
|
|
, enableToolkit ? true # The URL Toolkit.
|
|
|
|
}:
|
|
|
|
|
2024-06-20 14:57:18 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "hiawatha";
|
2024-07-27 06:49:29 +00:00
|
|
|
version = "11.6";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitLab {
|
|
|
|
owner = "hsleisink";
|
|
|
|
repo = "hiawatha";
|
2024-06-20 14:57:18 +00:00
|
|
|
rev = "v${finalAttrs.version}";
|
2024-07-27 06:49:29 +00:00
|
|
|
hash = "sha256-YsZdVqanVNibA4KnAknLh61hVo7x5uu67lb+RX2N7c8=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ cmake ninja ];
|
2024-09-19 14:19:46 +00:00
|
|
|
buildInputs = [ mbedtls libxcrypt zlib ] ++ lib.optionals enableXslt [ libxslt libxml2 ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
prePatch = ''
|
|
|
|
substituteInPlace CMakeLists.txt --replace SETUID ""
|
|
|
|
'';
|
|
|
|
|
|
|
|
cmakeFlags = [
|
|
|
|
"-DUSE_SYSTEM_MBEDTLS=on" # Policy to use Nix deps, and Nix uses up to date deps
|
|
|
|
( if enableCache then "-DENABLE_CACHE=on" else "-DENABLE_CACHE=off" )
|
|
|
|
( if enableIpV6 then "-DENABLE_IPV6=on" else "-DENABLE_IPV6=off" )
|
|
|
|
( if enableTls 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" )
|
|
|
|
];
|
|
|
|
|
2024-06-20 14:57:18 +00:00
|
|
|
passthru.tests.serve-static-files = callPackage ./test.nix {
|
|
|
|
hiawatha = finalAttrs.finalPackage;
|
|
|
|
inherit enableTls;
|
|
|
|
};
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2024-06-20 14:57:18 +00:00
|
|
|
homepage = "https://hiawatha.leisink.net/";
|
|
|
|
description = "Advanced and secure webserver";
|
2024-06-05 15:53:02 +00:00
|
|
|
license = licenses.gpl2Only;
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = platforms.unix; # "Hiawatha runs perfectly on Linux, BSD and MacOS X"
|
2024-06-20 14:57:18 +00:00
|
|
|
mainProgram = "hiawatha";
|
2024-07-31 10:19:44 +00:00
|
|
|
maintainers = [ ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-06-20 14:57:18 +00:00
|
|
|
})
|