From af7cb945a67bb255ca3cc4f0e1f658b1386cd4f0 Mon Sep 17 00:00:00 2001 From: Cole Helbling Date: Fri, 11 Mar 2022 09:54:14 -0800 Subject: [PATCH] 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. --- ...0001-allow-setting-paths-in-makefile.patch | 33 ---------------- .../libraries/civetweb/default.nix | 39 +++++++++---------- 2 files changed, 18 insertions(+), 54 deletions(-) delete mode 100644 pkgs/development/libraries/civetweb/0001-allow-setting-paths-in-makefile.patch diff --git a/pkgs/development/libraries/civetweb/0001-allow-setting-paths-in-makefile.patch b/pkgs/development/libraries/civetweb/0001-allow-setting-paths-in-makefile.patch deleted file mode 100644 index 8a14fb3a5fa..00000000000 --- a/pkgs/development/libraries/civetweb/0001-allow-setting-paths-in-makefile.patch +++ /dev/null @@ -1,33 +0,0 @@ -diff -u a/Makefile b/Makefile ---- a/Makefile 2020-12-27 18:48:53.934098765 +0100 -+++ b/Makefile 2020-12-27 18:50:44.022674117 +0100 -@@ -19,13 +19,13 @@ - # http://www.gnu.org/prep/standards/html_node/Directory-Variables.html - PREFIX ?= /usr/local - EXEC_PREFIX = $(PREFIX) --BINDIR = $(EXEC_PREFIX)/bin -+BINDIR ?= $(EXEC_PREFIX)/bin - DATAROOTDIR = $(PREFIX)/share - DOCDIR = $(DATAROOTDIR)/doc/$(CPROG) - SYSCONFDIR ?= $(PREFIX)/etc - HTMLDIR = $(DOCDIR) --INCLUDEDIR = $(DESTDIR)$(PREFIX)/include --LIBDIR = $(DESTDIR)$(EXEC_PREFIX)/lib -+INCLUDEDIR ?= $(DESTDIR)$(PREFIX)/include -+LIBDIR ?= $(DESTDIR)$(EXEC_PREFIX)/lib - PID_FILE ?= /var/run/$(CPROG).pid - - # build tools -@@ -337,10 +337,10 @@ - install -m 755 $(CPROG) "$(BINDIR)/" - - install-headers: -- install -m 644 $(HEADERS) "$(INCLUDEDIR)" -+ install -m 644 $(HEADERS) "$(INCLUDEDIR)/" - - install-lib: lib$(CPROG).a -- install -m 644 $< "$(LIBDIR)" -+ install -m 644 $< "$(LIBDIR)/" - - install-slib: lib$(CPROG).so - $(eval version=$(shell grep -w "define CIVETWEB_VERSION" include/civetweb.h | sed 's|.*VERSION "\(.*\)"|\1|g')) diff --git a/pkgs/development/libraries/civetweb/default.nix b/pkgs/development/libraries/civetweb/default.nix index 93ac618bcac..bf737972612 100644 --- a/pkgs/development/libraries/civetweb/default.nix +++ b/pkgs/development/libraries/civetweb/default.nix @@ -1,5 +1,7 @@ -{ lib, stdenv +{ lib +, stdenv , fetchFromGitHub +, cmake }: stdenv.mkDerivation rec { @@ -13,33 +15,28 @@ stdenv.mkDerivation rec { sha256 = "sha256-Qh6BGPk7a01YzCeX42+Og9M+fjXRs7kzNUCyT4mYab4="; }; - makeFlags = [ - "WITH_CPP=1" - "PREFIX=${placeholder "out"}" - "LIBDIR=${placeholder "out"}/lib" - "INCLUDEDIR=${placeholder "dev"}/include" - ]; - - patches = [ - ./0001-allow-setting-paths-in-makefile.patch - ]; + outputs = [ "out" "dev" ]; strictDeps = true; - outputs = [ "out" "dev" ]; - - installTargets = [ - "install-headers" - "install-lib" - "install-slib" - "install" + nativeBuildInputs = [ + cmake ]; - preInstall = '' - mkdir -p $dev/include - mkdir -p $out/lib + # 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";