nixpkgs/pkgs/development/libraries/civetweb/default.nix
stuebinm ff1a94e523 treewide: add meta.mainProgram to packages with a single binary
The nixpkgs-unstable channel's programs.sqlite was used to identify
packages producing exactly one binary, and these automatically added
to their package definitions wherever possible.
2024-03-19 03:14:51 +01:00

48 lines
950 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 = [
"-DBUILD_SHARED_LIBS=ON"
"-DCIVETWEB_ENABLE_CXX=ON"
"-DCIVETWEB_ENABLE_IPV6=ON"
# The civetweb unit tests rely on downloading their fork of libcheck.
"-DCIVETWEB_BUILD_TESTING=OFF"
];
meta = {
description = "Embedded C/C++ web server";
mainProgram = "civetweb";
homepage = "https://github.com/civetweb/civetweb";
license = [ lib.licenses.mit ];
};
}