1 { stdenv, fetchFromGitHub, cmake, jsoncpp, libossp_uuid, zlib, lib, fetchpatch
2 # optional but of negligible size
3 , openssl, brotli, c-ares
5 , sqliteSupport ? true, sqlite
6 , postgresSupport ? false, postgresql
7 , redisSupport ? false, hiredis
8 , mysqlSupport ? false, libmysqlclient, mariadb }:
10 stdenv.mkDerivation (finalAttrs: {
14 src = fetchFromGitHub {
15 owner = "drogonframework";
17 rev = "v${finalAttrs.version}";
18 sha256 = "sha256-KZRW/ra84RegCCT6J0k+N7XqZF+xW+Ecq2TVdPZnM7M=";
19 fetchSubmodules = true;
22 nativeBuildInputs = [ cmake ];
25 "-DBUILD_TESTING=${if finalAttrs.finalPackage.doInstallCheck then "ON" else "OFF"}"
26 "-DBUILD_EXAMPLES=OFF"
29 propagatedBuildInputs = [
36 ] ++ lib.optional sqliteSupport sqlite
37 ++ lib.optional postgresSupport postgresql
38 ++ lib.optional redisSupport hiredis
39 # drogon uses mariadb for mysql (see https://github.com/drogonframework/drogon/wiki/ENG-02-Installation#Library-Dependencies)
40 ++ lib.optionals mysqlSupport [ libmysqlclient mariadb ];
43 # this part of the test would normally fail because it attempts to configure a CMake project that uses find_package on itself
44 # this patch makes drogon and trantor visible to the test
45 ./fix_find_package.patch
48 # modifying PATH here makes drogon_ctl visible to the test
49 installCheckPhase = ''
52 PATH=$PATH:$out/bin $SHELL test.sh
56 # this excludes you, pkgsStatic (cmake wants to run built binaries
58 doInstallCheck = stdenv.buildPlatform == stdenv.hostPlatform;
61 homepage = "https://github.com/drogonframework/drogon";
62 description = "C++14/17 based HTTP web application framework";
63 license = licenses.mit;
64 maintainers = with maintainers; [ urlordjames ];
65 platforms = platforms.all;