2024-06-05 15:53:02 +00:00
|
|
|
{ stdenv, fetchFromGitHub, cmake, jsoncpp, libossp_uuid, zlib, lib
|
2021-08-05 21:33:18 +00:00
|
|
|
# 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 }:
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2021-06-28 23:13:55 +00:00
|
|
|
pname = "drogon";
|
2024-05-15 15:35:15 +00:00
|
|
|
version = "1.9.4";
|
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";
|
2023-10-09 19:29:22 +00:00
|
|
|
rev = "v${finalAttrs.version}";
|
2024-07-27 06:49:29 +00:00
|
|
|
hash = "sha256-P6blu3EIBzmK1zikFPiV+tvFLfiQhK+cRdClQOhcBSU=";
|
2021-06-28 23:13:55 +00:00
|
|
|
fetchSubmodules = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ cmake ];
|
|
|
|
|
|
|
|
cmakeFlags = [
|
2023-10-09 19:29:22 +00:00
|
|
|
"-DBUILD_TESTING=${if finalAttrs.finalPackage.doInstallCheck then "ON" else "OFF"}"
|
2021-06-28 23:13:55 +00:00
|
|
|
"-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)
|
2022-10-30 15:09:59 +00:00
|
|
|
++ lib.optionals mysqlSupport [ libmysqlclient mariadb ];
|
2021-06-28 23:13:55 +00:00
|
|
|
|
|
|
|
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 = ''
|
2023-10-09 19:29:22 +00:00
|
|
|
(
|
|
|
|
cd ..
|
|
|
|
PATH=$PATH:$out/bin $SHELL test.sh
|
|
|
|
)
|
2021-06-28 23:13:55 +00:00
|
|
|
'';
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
# this excludes you, pkgsStatic (cmake wants to run built binaries
|
|
|
|
# in the buildPhase)
|
|
|
|
doInstallCheck = stdenv.buildPlatform == stdenv.hostPlatform;
|
2021-06-28 23:13:55 +00:00
|
|
|
|
|
|
|
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;
|
|
|
|
};
|
2023-10-09 19:29:22 +00:00
|
|
|
})
|