nixpkgs/pkgs/development/libraries/civetweb/default.nix
Cole Helbling af7cb945a6 civetweb: use cmake
prometheus-cpp 1.0.0 depends on civetweb's cmake files being available:
    CMake Error at pull/CMakeLists.txt:11 (find_package):
      Could not find a package configuration file provided by "civetweb" with any
      of the following names:

        civetwebConfig.cmake
        civetweb-config.cmake

      Add the installation prefix of "civetweb" to CMAKE_PREFIX_PATH or set
      "civetweb_DIR" to a directory containing one of the above files.  If
      "civetweb" provides a separate development package or SDK, be sure it has
      been installed.

Cmake also properly handles setting the prefix, libdir, and includedir
paths, so that patch was dropped.
2022-03-14 12:17:26 -07:00

46 lines
888 B
Nix

{ lib
, stdenv
, fetchFromGitHub
, cmake
}:
stdenv.mkDerivation rec {
pname = "civetweb";
version = "1.15";
src = fetchFromGitHub {
owner = pname;
repo = pname;
rev = "v${version}";
sha256 = "sha256-Qh6BGPk7a01YzCeX42+Og9M+fjXRs7kzNUCyT4mYab4=";
};
outputs = [ "out" "dev" ];
strictDeps = true;
nativeBuildInputs = [
cmake
];
# The existence of the "build" script causes `mkdir -p build` to fail:
# mkdir: cannot create directory 'build': File exists
preConfigure = ''
rm build
'';
cmakeFlags = [
"-DCIVETWEB_ENABLE_CXX=ON"
"-DBUILD_SHARED_LIBS=ON"
# The civetweb unit tests rely on downloading their fork of libcheck.
"-DCIVETWEB_BUILD_TESTING=OFF"
];
meta = {
description = "Embedded C/C++ web server";
homepage = "https://github.com/civetweb/civetweb";
license = [ lib.licenses.mit ];
};
}