diff options
author | urlordjames <urlordjames@gmail.com> | 2021-06-16 13:23:35 -0400 |
---|---|---|
committer | urlordjames <urlordjames@gmail.com> | 2021-06-17 21:24:16 -0400 |
commit | fae72ae3df612a27bc2d8e1539cf95174a1e86a7 (patch) | |
tree | b502bc15eac4600178b645801c01e004da29c89b /pkgs/development/libraries/drogon | |
parent | 9965d9ce43d6585213fe960051d60f2431142e03 (diff) |
drogon: init at 1.6.0
Diffstat (limited to 'pkgs/development/libraries/drogon')
-rw-r--r-- | pkgs/development/libraries/drogon/default.nix | 50 | ||||
-rw-r--r-- | pkgs/development/libraries/drogon/no_cmake_test.patch | 42 |
2 files changed, 92 insertions, 0 deletions
diff --git a/pkgs/development/libraries/drogon/default.nix b/pkgs/development/libraries/drogon/default.nix new file mode 100644 index 0000000000000..8234891046da1 --- /dev/null +++ b/pkgs/development/libraries/drogon/default.nix @@ -0,0 +1,50 @@ +{ stdenv, fetchFromGitHub, cmake, jsoncpp, libuuid, zlib, openssl, lib }: + +stdenv.mkDerivation rec { + pname = "drogon"; + version = "1.6.0"; + + src = fetchFromGitHub { + owner = "an-tao"; + repo = "drogon"; + rev = "v${version}"; + sha256 = "0ncdlsi3zhmpdwh83d52npb1b2q982y858yl88zl2nfq4zhcm3wa"; + fetchSubmodules = true; + }; + + nativeBuildInputs = [ cmake ]; + + cmakeFlags = [ + # examples are used in the test during installCheckPhase, otherwise they are unnecessary + "-DBUILD_EXAMPLES=${if doInstallCheck then "ON" else "OFF"}" + ]; + + propagatedBuildInputs = [ + jsoncpp + libuuid + zlib + openssl + ]; + + patches = [ + # this part of the test fails because it attempts to configure a CMake project that uses find_package on itself + # the rest of the test runs fine because it uses executables that are built in buildPhase when BUILD_EXAMPLES is enabled + ./no_cmake_test.patch + ]; + + installCheckPhase = '' + cd .. + patchShebangs test.sh + ./test.sh + ''; + + doInstallCheck = true; + + meta = with lib; { + homepage = "https://github.com/an-tao/drogon"; + description = "C++14/17 based HTTP web application framework"; + license = licenses.mit; + maintainers = [ maintainers.urlordjames ]; + platforms = platforms.all; + }; +} diff --git a/pkgs/development/libraries/drogon/no_cmake_test.patch b/pkgs/development/libraries/drogon/no_cmake_test.patch new file mode 100644 index 0000000000000..8d38fbf44b70f --- /dev/null +++ b/pkgs/development/libraries/drogon/no_cmake_test.patch @@ -0,0 +1,42 @@ +diff --git a/test.sh b/test.sh +index e5da08e..ba620cc 100755 +--- a/test.sh ++++ b/test.sh +@@ -157,37 +157,6 @@ cd ../views + + echo "Hello, world!" >>hello.csp + +-cd ../build +-if [ $os = "windows" ]; then +- conan install $src_dir -s compiler="Visual Studio" -s compiler.version=16 -sbuild_type=Debug -g cmake_paths +- cmake_gen="$cmake_gen -DCMAKE_TOOLCHAIN_FILE=conan_paths.cmake -DCMAKE_INSTALL_PREFIX=$src_dir/install" +-fi +-cmake .. $cmake_gen +- +-if [ $? -ne 0 ]; then +- echo "Error in testing" +- exit -1 +-fi +- +-cmake --build . -- $make_flags +- +-if [ $? -ne 0 ]; then +- echo "Error in testing" +- exit -1 +-fi +- +-if [ $os = "linux" ]; then +- if [ ! -f "drogon_test" ]; then +- echo "Failed to build drogon_test" +- exit -1 +- fi +-else +- if [ ! -f "Debug\drogon_test.exe" ]; then +- echo "Failed to build drogon_test" +- exit -1 +- fi +-fi +- + cd ../../ + rm -rf drogon_test + |