nixpkgs/pkgs/development/libraries/drogon/default.nix

64 lines
1.8 KiB
Nix
Raw Normal View History

2021-07-24 17:46:31 +02:00
{ stdenv, fetchFromGitHub, cmake, jsoncpp, libossp_uuid, zlib, lib
# optional but of negligible size
, openssl, brotli, c-ares
# optional databases
, sqliteSupport ? true, sqlite
, postgresSupport ? false, postgresql
, redisSupport ? false, hiredis
, mysqlSupport ? false, libmysqlclient, mariadb }:
2021-06-16 19:23:35 +02:00
stdenv.mkDerivation rec {
pname = "drogon";
2021-06-25 16:31:39 +02:00
version = "1.7.1";
2021-06-16 19:23:35 +02:00
src = fetchFromGitHub {
2021-07-24 17:46:31 +02:00
owner = "drogonframework";
2021-06-16 19:23:35 +02:00
repo = "drogon";
rev = "v${version}";
2021-06-25 16:31:39 +02:00
sha256 = "0rhwbz3m5x3vy5zllfs8r347wqprg29pff5q7i53f25bh8y0n49i";
2021-06-16 19:23:35 +02:00
fetchSubmodules = true;
};
nativeBuildInputs = [ cmake ];
cmakeFlags = [
2021-06-19 04:19:53 +02:00
"-DBUILD_TESTING=${if doInstallCheck then "ON" else "OFF"}"
"-DBUILD_EXAMPLES=OFF"
2021-06-16 19:23:35 +02:00
];
propagatedBuildInputs = [
jsoncpp
2021-06-19 04:19:53 +02:00
libossp_uuid
2021-06-16 19:23:35 +02:00
zlib
openssl
brotli
c-ares
] ++ lib.optional sqliteSupport sqlite
++ lib.optional postgresSupport postgresql
++ lib.optional redisSupport hiredis
2021-07-24 17:46:31 +02:00
# drogon uses mariadb for mysql (see https://github.com/drogonframework/drogon/wiki/ENG-02-Installation#Library-Dependencies)
++ lib.optional mysqlSupport [ libmysqlclient mariadb ];
2021-06-16 19:23:35 +02:00
patches = [
2021-06-19 04:19:53 +02:00
# 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
2021-06-16 19:23:35 +02:00
];
2021-06-19 04:19:53 +02:00
# modifying PATH here makes drogon_ctl visible to the test
2021-06-16 19:23:35 +02:00
installCheckPhase = ''
cd ..
2021-07-24 17:46:31 +02:00
PATH=$PATH:$out/bin bash test.sh
2021-06-16 19:23:35 +02:00
'';
doInstallCheck = true;
meta = with lib; {
2021-07-24 17:46:31 +02:00
homepage = "https://github.com/drogonframework/drogon";
2021-06-16 19:23:35 +02:00
description = "C++14/17 based HTTP web application framework";
license = licenses.mit;
2021-07-24 17:46:31 +02:00
maintainers = with maintainers; [ urlordjames ];
2021-06-16 19:23:35 +02:00
platforms = platforms.all;
};
}