2021-08-05 21:33:18 +00:00
|
|
|
{ stdenv, fetchFromGitHub, cmake, jsoncpp, libossp_uuid, zlib, lib
|
|
|
|
# optional but of negligible size
|
|
|
|
, openssl, brotli, c-ares
|
|
|
|
# optional databases
|
2021-06-28 23:13:55 +00:00
|
|
|
, sqliteSupport ? true, sqlite
|
|
|
|
, postgresSupport ? false, postgresql
|
|
|
|
, redisSupport ? false, hiredis
|
|
|
|
, mysqlSupport ? false, libmysqlclient, mariadb }:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "drogon";
|
2021-12-06 16:07:01 +00:00
|
|
|
version = "1.7.3";
|
2021-06-28 23:13:55 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2021-08-05 21:33:18 +00:00
|
|
|
owner = "drogonframework";
|
2021-06-28 23:13:55 +00:00
|
|
|
repo = "drogon";
|
|
|
|
rev = "v${version}";
|
2021-12-06 16:07:01 +00:00
|
|
|
sha256 = "0j7bnc6l5hbcf0l7pjzw82i9z1rbh57ni60wpa50q10gwbm4waxn";
|
2021-06-28 23:13:55 +00:00
|
|
|
fetchSubmodules = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ cmake ];
|
|
|
|
|
|
|
|
cmakeFlags = [
|
|
|
|
"-DBUILD_TESTING=${if doInstallCheck then "ON" else "OFF"}"
|
|
|
|
"-DBUILD_EXAMPLES=OFF"
|
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
jsoncpp
|
|
|
|
libossp_uuid
|
|
|
|
zlib
|
|
|
|
openssl
|
|
|
|
brotli
|
|
|
|
c-ares
|
|
|
|
] ++ lib.optional sqliteSupport sqlite
|
|
|
|
++ lib.optional postgresSupport postgresql
|
|
|
|
++ lib.optional redisSupport hiredis
|
2021-08-05 21:33:18 +00:00
|
|
|
# drogon uses mariadb for mysql (see https://github.com/drogonframework/drogon/wiki/ENG-02-Installation#Library-Dependencies)
|
2021-06-28 23:13:55 +00:00
|
|
|
++ lib.optional mysqlSupport [ libmysqlclient mariadb ];
|
|
|
|
|
|
|
|
patches = [
|
|
|
|
# this part of the test would normally fail because it attempts to configure a CMake project that uses find_package on itself
|
|
|
|
# this patch makes drogon and trantor visible to the test
|
|
|
|
./fix_find_package.patch
|
|
|
|
];
|
|
|
|
|
|
|
|
# modifying PATH here makes drogon_ctl visible to the test
|
|
|
|
installCheckPhase = ''
|
|
|
|
cd ..
|
2021-08-05 21:33:18 +00:00
|
|
|
PATH=$PATH:$out/bin bash test.sh
|
2021-06-28 23:13:55 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
doInstallCheck = true;
|
|
|
|
|
|
|
|
meta = with lib; {
|
2021-08-05 21:33:18 +00:00
|
|
|
homepage = "https://github.com/drogonframework/drogon";
|
2021-06-28 23:13:55 +00:00
|
|
|
description = "C++14/17 based HTTP web application framework";
|
|
|
|
license = licenses.mit;
|
2021-08-05 21:33:18 +00:00
|
|
|
maintainers = with maintainers; [ urlordjames ];
|
2021-06-28 23:13:55 +00:00
|
|
|
platforms = platforms.all;
|
|
|
|
};
|
|
|
|
}
|