about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/civetweb
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2019-03-16 17:16:21 +0000
committerAlyssa Ross <hi@alyssa.is>2019-03-16 22:36:36 +0000
commitcb6d0ec12187e0c2c11b203f3d8fa62790628141 (patch)
tree0ca0fedc67d5676e89438cffa3e0865eee0962e4 /nixpkgs/pkgs/development/libraries/civetweb
parent4d83b8e578d3a0b78d2694921c944172b009036a (diff)
parentda1a2b1eeafa66b4419b4f275396d8a731eccb61 (diff)
downloadnixlib-cb6d0ec12187e0c2c11b203f3d8fa62790628141.tar
nixlib-cb6d0ec12187e0c2c11b203f3d8fa62790628141.tar.gz
nixlib-cb6d0ec12187e0c2c11b203f3d8fa62790628141.tar.bz2
nixlib-cb6d0ec12187e0c2c11b203f3d8fa62790628141.tar.lz
nixlib-cb6d0ec12187e0c2c11b203f3d8fa62790628141.tar.xz
nixlib-cb6d0ec12187e0c2c11b203f3d8fa62790628141.tar.zst
nixlib-cb6d0ec12187e0c2c11b203f3d8fa62790628141.zip
Merge commit 'da1a2b1eeafa66b4419b4f275396d8a731eccb61'
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/civetweb')
-rw-r--r--nixpkgs/pkgs/development/libraries/civetweb/0001-allow-setting-paths-in-makefile.patch55
-rw-r--r--nixpkgs/pkgs/development/libraries/civetweb/default.nix41
2 files changed, 96 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/civetweb/0001-allow-setting-paths-in-makefile.patch b/nixpkgs/pkgs/development/libraries/civetweb/0001-allow-setting-paths-in-makefile.patch
new file mode 100644
index 000000000000..47f419727459
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/civetweb/0001-allow-setting-paths-in-makefile.patch
@@ -0,0 +1,55 @@
+From 06b2c6dd6439c01bfb5a4c7b0ec6909c349a66b1 Mon Sep 17 00:00:00 2001
+From: Frederik Rietdijk <freddyrietdijk@fridh.nl>
+Date: Thu, 28 Feb 2019 16:25:49 +0100
+Subject: [PATCH] allow setting paths in makefile
+
+and install headers and libs
+---
+ Makefile | 12 ++++++------
+ 1 file changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index b507e2b0..d21e5c56 100644
+--- a/Makefile
++++ b/Makefile
+@@ -19,13 +19,13 @@ BUILD_DIR = out
+ # 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
+ 
+ # build tools
+ MKDIR = mkdir -p
+@@ -270,17 +270,17 @@ build: $(CPROG) $(CXXPROG)
+ unit_test: $(UNIT_TEST_PROG)
+ 
+ ifeq ($(CAN_INSTALL),1)
+-install: $(HTMLDIR)/index.html $(SYSCONFDIR)/civetweb.conf
++install: install-headers install-slib $(HTMLDIR)/index.html $(SYSCONFDIR)/civetweb.conf
+ 	install -d -m 755  "$(DOCDIR)"
+ 	install -m 644 *.md "$(DOCDIR)"
+ 	install -d -m 755 "$(BINDIR)"
+ 	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'))
+-- 
+2.19.2
+
diff --git a/nixpkgs/pkgs/development/libraries/civetweb/default.nix b/nixpkgs/pkgs/development/libraries/civetweb/default.nix
new file mode 100644
index 000000000000..3f8de005ff81
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/civetweb/default.nix
@@ -0,0 +1,41 @@
+{ stdenv
+, fetchFromGitHub
+}:
+
+stdenv.mkDerivation rec {
+  pname = "civetweb";
+  version = "1.11";
+
+  src = fetchFromGitHub {
+    owner = pname;
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "sha256:1drnid6gs97cp9zpvsxz42yfj8djmgx98fg9p2993x9mpi547vzv";
+  };
+
+  makeFlags = [
+    "WITH_CPP=1"
+    "PREFIX=${placeholder "out"}"
+    "LIBDIR=${placeholder "out"}/lib"
+    "INCLUDEDIR=${placeholder "dev"}/include"
+  ];
+
+  patches = [
+    ./0001-allow-setting-paths-in-makefile.patch
+  ];
+
+  strictDeps = true;
+
+  outputs = [ "out" "dev" ];
+
+  preInstall = ''
+    mkdir -p $dev/include
+    mkdir -p $out/lib
+  '';
+
+  meta = {
+    description = "Embedded C/C++ web server";
+    homepage = https://github.com/civetweb/civetweb;
+    license = [ stdenv.lib.licenses.mit ];
+  };
+}