3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/development/libraries/drogon/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

64 lines
1.8 KiB
Nix
Raw Normal View History

2021-07-24 16:46:31 +01: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 18:23:35 +01:00
stdenv.mkDerivation rec {
pname = "drogon";
2022-09-26 15:06:33 +01:00
version = "1.8.1";
2021-06-16 18:23:35 +01:00
src = fetchFromGitHub {
2021-07-24 16:46:31 +01:00
owner = "drogonframework";
2021-06-16 18:23:35 +01:00
repo = "drogon";
rev = "v${version}";
2022-09-26 15:06:33 +01:00
sha256 = "sha256-XzSJABYuZaYlNL12bi0ykQ1OyNsvB1AQiSTBPWiTNYU=";
2021-06-16 18:23:35 +01:00
fetchSubmodules = true;
};
nativeBuildInputs = [ cmake ];
cmakeFlags = [
2021-06-19 03:19:53 +01:00
"-DBUILD_TESTING=${if doInstallCheck then "ON" else "OFF"}"
"-DBUILD_EXAMPLES=OFF"
2021-06-16 18:23:35 +01:00
];
propagatedBuildInputs = [
jsoncpp
2021-06-19 03:19:53 +01:00
libossp_uuid
2021-06-16 18:23:35 +01:00
zlib
openssl
brotli
c-ares
] ++ lib.optional sqliteSupport sqlite
++ lib.optional postgresSupport postgresql
++ lib.optional redisSupport hiredis
2021-07-24 16:46:31 +01: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 18:23:35 +01:00
patches = [
2021-06-19 03:19:53 +01: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 18:23:35 +01:00
];
2021-06-19 03:19:53 +01:00
# modifying PATH here makes drogon_ctl visible to the test
2021-06-16 18:23:35 +01:00
installCheckPhase = ''
cd ..
2021-07-24 16:46:31 +01:00
PATH=$PATH:$out/bin bash test.sh
2021-06-16 18:23:35 +01:00
'';
doInstallCheck = true;
meta = with lib; {
2021-07-24 16:46:31 +01:00
homepage = "https://github.com/drogonframework/drogon";
2021-06-16 18:23:35 +01:00
description = "C++14/17 based HTTP web application framework";
license = licenses.mit;
2021-07-24 16:46:31 +01:00
maintainers = with maintainers; [ urlordjames ];
2021-06-16 18:23:35 +01:00
platforms = platforms.all;
};
}