lol

modsecurity: 2.9.0 -> 2.9.2

* Enable building on macOS
* also fixes an issue where a system Lua install fooled the configure
script into thinking it was enabled.

+44 -19
+17
pkgs/tools/security/modsecurity/Makefile.in.patch
··· 1 + --- a/apache2/Makefile.in 2017-10-10 09:45:51.000000000 -0400 2 + +++ b/apache2/Makefile.in 2017-10-10 09:46:04.000000000 -0400 3 + @@ -1208,14 +1208,12 @@ 4 + @LINUX_TRUE@ for m in $(pkglib_LTLIBRARIES); do \ 5 + @LINUX_TRUE@ base=`echo $$m | sed 's/\..*//'`; \ 6 + @LINUX_TRUE@ rm -f $(DESTDIR)$(pkglibdir)/$$base.*a; \ 7 + -@LINUX_TRUE@ install -D -m444 $(DESTDIR)$(pkglibdir)/$$base.so $(DESTDIR)$(APXS_MODULES)/$$base.so; \ 8 + @LINUX_TRUE@ done 9 + @LINUX_FALSE@install-exec-hook: $(pkglib_LTLIBRARIES) 10 + @LINUX_FALSE@ @echo "Removing unused static libraries..."; \ 11 + @LINUX_FALSE@ for m in $(pkglib_LTLIBRARIES); do \ 12 + @LINUX_FALSE@ base=`echo $$m | sed 's/\..*//'`; \ 13 + @LINUX_FALSE@ rm -f $(DESTDIR)$(pkglibdir)/$$base.*a; \ 14 + -@LINUX_FALSE@ cp -p $(DESTDIR)$(pkglibdir)/$$base.so $(DESTDIR)$(APXS_MODULES); \ 15 + @LINUX_FALSE@ done 16 + 17 + # Tell versions [3.59,3.63) of GNU make to not export all variables.
+27 -19
pkgs/tools/security/modsecurity/default.nix
··· 1 1 { stdenv, lib, fetchurl, pkgconfig 2 - , curl, apacheHttpd, pcre, apr, aprutil, libxml2 }: 2 + , curl, apacheHttpd, pcre, apr, aprutil, libxml2 3 + , luaSupport ? false, lua5 4 + }: 3 5 4 6 with lib; 5 7 8 + let luaValue = if luaSupport then lua5 else "no"; 9 + optional = stdenv.lib.optional; 10 + in 11 + 6 12 stdenv.mkDerivation rec { 7 13 name = "modsecurity-${version}"; 8 - version = "2.9.0"; 14 + version = "2.9.2"; 9 15 10 16 src = fetchurl { 11 17 url = "https://www.modsecurity.org/tarball/${version}/${name}.tar.gz"; 12 - sha256 = "e2bbf789966c1f80094d88d9085a81bde082b2054f8e38e0db571ca49208f434"; 18 + sha256 = "41a8f73476ec891f3a9e8736b98b64ea5c2105f1ce15ea57a1f05b4bf2ffaeb5"; 13 19 }; 14 20 15 21 nativeBuildInputs = [ pkgconfig ]; 16 - buildInputs = [ curl apacheHttpd pcre apr aprutil libxml2 ]; 17 - configureFlags = [ 18 - "--enable-standalone-module" 19 - "--enable-static" 20 - "--with-curl=${curl.dev}" 21 - "--with-apxs=${apacheHttpd.dev}/bin/apxs" 22 - "--with-pcre=${pcre.dev}" 23 - "--with-apr=${apr.dev}" 24 - "--with-apu=${aprutil.dev}/bin/apu-1-config" 25 - "--with-libxml=${libxml2.dev}" 26 - ]; 22 + buildInputs = [ curl apacheHttpd pcre apr aprutil libxml2 ] ++ 23 + optional luaSupport lua5; 24 + 25 + configureFlags = '' 26 + --enable-standalone-module 27 + --enable-static 28 + --with-curl=${curl.dev} 29 + --with-apxs=${apacheHttpd.dev}/bin/apxs 30 + --with-pcre=${pcre.dev} 31 + --with-apr=${apr.dev} 32 + --with-apu=${aprutil.dev}/bin/apu-1-config 33 + --with-libxml=${libxml2.dev} 34 + --with-lua=${luaValue} 35 + ''; 27 36 28 37 outputs = ["out" "nginx"]; 29 - 30 - preBuild = '' 31 - substituteInPlace apache2/Makefile.in --replace "install -D " "# install -D" 32 - ''; 38 + # by default modsecurity's install script copies compiled output to httpd's modules folder 39 + # this patch removes those lines 40 + patches = [ ./Makefile.in.patch ]; 33 41 34 42 postInstall = '' 35 43 mkdir -p $nginx ··· 41 49 license = licenses.asl20; 42 50 homepage = https://www.modsecurity.org/; 43 51 maintainers = with maintainers; [offline]; 44 - platforms = platforms.linux; 52 + platforms = stdenv.lib.platforms.linux ++ stdenv.lib.platforms.darwin; 45 53 }; 46 54 }