github-backup: 0.48.0 -> 0.49.0 (#379003)
[NixPkgs.git] / pkgs / by-name / dr / drogon / package.nix
blobc1aedb0449640ad3edab9f47a6a5c157aeeea5a9
2   stdenv,
3   fetchFromGitHub,
4   cmake,
5   jsoncpp,
6   libossp_uuid,
7   zlib,
8   lib,
9   # optional but of negligible size
10   openssl,
11   brotli,
12   c-ares,
13   # optional databases
14   sqliteSupport ? true,
15   sqlite,
16   postgresSupport ? false,
17   postgresql,
18   redisSupport ? false,
19   hiredis,
20   mysqlSupport ? false,
21   libmysqlclient,
22   mariadb,
25 stdenv.mkDerivation (finalAttrs: {
26   pname = "drogon";
27   version = "1.9.9";
29   src = fetchFromGitHub {
30     owner = "drogonframework";
31     repo = "drogon";
32     rev = "v${finalAttrs.version}";
33     hash = "sha256-5nJwWlXy0e0ThnTGV9MamdAJ+FqB597gsDz28p8DrQA=";
34     fetchSubmodules = true;
35   };
37   nativeBuildInputs = [ cmake ];
39   cmakeFlags = [
40     (lib.cmakeBool "BUILD_TESTING" finalAttrs.finalPackage.doInstallCheck)
41     (lib.cmakeBool "BUILD_EXAMPLES" false)
42   ];
44   propagatedBuildInputs =
45     [
46       jsoncpp
47       libossp_uuid
48       zlib
49       openssl
50       brotli
51       c-ares
52     ]
53     ++ lib.optional sqliteSupport sqlite
54     ++ lib.optional postgresSupport postgresql
55     ++ lib.optional redisSupport hiredis
56     # drogon uses mariadb for mysql (see https://github.com/drogonframework/drogon/wiki/ENG-02-Installation#Library-Dependencies)
57     ++ lib.optionals mysqlSupport [
58       libmysqlclient
59       mariadb
60     ];
62   patches = [
63     # this part of the test would normally fail because it attempts to configure a CMake project that uses find_package on itself
64     # this patch makes drogon and trantor visible to the test
65     ./fix_find_package.patch
66   ];
68   # modifying PATH here makes drogon_ctl visible to the test
69   installCheckPhase = ''
70     (
71       cd ..
72       PATH=$PATH:$out/bin $SHELL test.sh
73     )
74   '';
76   # this excludes you, pkgsStatic (cmake wants to run built binaries
77   # in the buildPhase)
78   doInstallCheck = stdenv.buildPlatform == stdenv.hostPlatform;
80   meta = with lib; {
81     homepage = "https://github.com/drogonframework/drogon";
82     description = "C++14/17 based HTTP web application framework";
83     license = licenses.mit;
84     maintainers = with maintainers; [ urlordjames ];
85     platforms = platforms.all;
86   };