drogon: add options for optional dependencies

This commit is contained in:
urlordjames 2021-06-20 18:02:56 -04:00
parent 23c5d04f56
commit 6e44a67726

View file

@ -1,4 +1,11 @@
{ stdenv, fetchFromGitHub, cmake, jsoncpp, libossp_uuid, zlib, openssl, lib }:
{ stdenv, fetchFromGitHub, cmake, jsoncpp, libossp_uuid, zlib, openssl, lib
# miscellaneous
, brotli, c-ares
# databases
, sqliteSupport ? true, sqlite
, postgresSupport ? false, postgresql
, redisSupport ? false, hiredis
, mysqlSupport ? false, libmysqlclient, mariadb }:
stdenv.mkDerivation rec {
pname = "drogon";
@ -24,7 +31,13 @@ stdenv.mkDerivation rec {
libossp_uuid
zlib
openssl
];
brotli
c-ares
] ++ lib.optional sqliteSupport sqlite
++ lib.optional postgresSupport postgresql
++ lib.optional redisSupport hiredis
# drogon uses mariadb for mysql (see https://github.com/an-tao/drogon/wiki/ENG-02-Installation#Library-Dependencies)
++ 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