1{ lib
2, stdenv
3, fetchFromGitHub
4, cmake
5}:
6
7stdenv.mkDerivation rec {
8 pname = "civetweb";
9 version = "1.15";
10
11 src = fetchFromGitHub {
12 owner = pname;
13 repo = pname;
14 rev = "v${version}";
15 sha256 = "sha256-Qh6BGPk7a01YzCeX42+Og9M+fjXRs7kzNUCyT4mYab4=";
16 };
17
18 outputs = [ "out" "dev" ];
19
20 strictDeps = true;
21
22 nativeBuildInputs = [
23 cmake
24 ];
25
26 # The existence of the "build" script causes `mkdir -p build` to fail:
27 # mkdir: cannot create directory 'build': File exists
28 preConfigure = ''
29 rm build
30 '';
31
32 cmakeFlags = [
33 "-DBUILD_SHARED_LIBS=ON"
34 "-DCIVETWEB_ENABLE_CXX=ON"
35 "-DCIVETWEB_ENABLE_IPV6=ON"
36
37 # The civetweb unit tests rely on downloading their fork of libcheck.
38 "-DCIVETWEB_BUILD_TESTING=OFF"
39 ];
40
41 meta = {
42 description = "Embedded C/C++ web server";
43 homepage = "https://github.com/civetweb/civetweb";
44 license = [ lib.licenses.mit ];
45 };
46}