depot/third_party/nixpkgs/pkgs/development/libraries/drogon/default.nix
Default email 472aeafc57 Project import generated by Copybara.
GitOrigin-RevId: c31898adf5a8ed202ce5bea9f347b1c6871f32d1
2024-10-04 18:56:33 +02:00

67 lines
2 KiB
Nix

{ 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 }:
stdenv.mkDerivation (finalAttrs: {
pname = "drogon";
version = "1.9.7";
src = fetchFromGitHub {
owner = "drogonframework";
repo = "drogon";
rev = "v${finalAttrs.version}";
hash = "sha256-YmN02OvCllxADAIicWKaTevrbAsP/ZbnhBd/hjqqz7A=";
fetchSubmodules = true;
};
nativeBuildInputs = [ cmake ];
cmakeFlags = [
(lib.cmakeBool "BUILD_TESTING" finalAttrs.finalPackage.doInstallCheck)
(lib.cmakeBool "BUILD_EXAMPLES" false)
];
propagatedBuildInputs = [
jsoncpp
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/drogonframework/drogon/wiki/ENG-02-Installation#Library-Dependencies)
++ lib.optionals 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
# this patch makes drogon and trantor visible to the test
./fix_find_package.patch
];
# modifying PATH here makes drogon_ctl visible to the test
installCheckPhase = ''
(
cd ..
PATH=$PATH:$out/bin $SHELL test.sh
)
'';
# this excludes you, pkgsStatic (cmake wants to run built binaries
# in the buildPhase)
doInstallCheck = stdenv.buildPlatform == stdenv.hostPlatform;
meta = with lib; {
homepage = "https://github.com/drogonframework/drogon";
description = "C++14/17 based HTTP web application framework";
license = licenses.mit;
maintainers = with maintainers; [ urlordjames ];
platforms = platforms.all;
};
})