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