summary refs log tree commit diff
path: root/pkgs/servers/varnish
diff options
context:
space:
mode:
authorvolth <volth@volth.com>2018-03-20 06:19:32 +0000
committervolth <volth@volth.com>2018-03-20 07:10:36 +0000
commit002b46082276693574dc7d13f1d4950106b963f3 (patch)
tree065d901aff3e4ffdd17d18ffef96d55207dd862c /pkgs/servers/varnish
parentc79cc60e643ecace48ca207d39fc61b04126e572 (diff)
downloadnixpkgs-002b46082276693574dc7d13f1d4950106b963f3.tar
nixpkgs-002b46082276693574dc7d13f1d4950106b963f3.tar.gz
nixpkgs-002b46082276693574dc7d13f1d4950106b963f3.tar.bz2
nixpkgs-002b46082276693574dc7d13f1d4950106b963f3.tar.lz
nixpkgs-002b46082276693574dc7d13f1d4950106b963f3.tar.xz
nixpkgs-002b46082276693574dc7d13f1d4950106b963f3.tar.zst
nixpkgs-002b46082276693574dc7d13f1d4950106b963f3.zip
varnish4: init at 4.1.9; varnish6: init at 6.0.0
Diffstat (limited to 'pkgs/servers/varnish')
-rw-r--r--pkgs/servers/varnish/default.nix76
-rw-r--r--pkgs/servers/varnish/digest.nix10
-rw-r--r--pkgs/servers/varnish/dynamic.nix26
-rw-r--r--pkgs/servers/varnish/geoip.nix2
-rw-r--r--pkgs/servers/varnish/modules.nix21
-rw-r--r--pkgs/servers/varnish/packages.nix22
-rw-r--r--pkgs/servers/varnish/rtstatus.nix3
7 files changed, 115 insertions, 45 deletions
diff --git a/pkgs/servers/varnish/default.nix b/pkgs/servers/varnish/default.nix
index 9efb4e4dfe5..85192b11c30 100644
--- a/pkgs/servers/varnish/default.nix
+++ b/pkgs/servers/varnish/default.nix
@@ -1,37 +1,53 @@
 { stdenv, fetchurl, pcre, libxslt, groff, ncurses, pkgconfig, readline, libedit
 , python, pythonPackages, makeWrapper }:
 
-stdenv.mkDerivation rec {
-  version = "5.2.1";
-  name = "varnish-${version}";
-
-  src = fetchurl {
-    url = "http://varnish-cache.org/_downloads/${name}.tgz";
+let
+  common = { version, sha256 }:
+    stdenv.mkDerivation rec {
+      name = "varnish-${version}";
+
+      src = fetchurl {
+        url = "http://varnish-cache.org/_downloads/${name}.tgz";
+        inherit sha256;
+      };
+
+      nativeBuildInputs = [ pkgconfig ];
+      buildInputs = [
+        pcre libxslt groff ncurses readline python libedit
+        pythonPackages.docutils makeWrapper
+      ];
+
+      buildFlags = "localstatedir=/var/spool";
+
+      postInstall = ''
+        wrapProgram "$out/sbin/varnishd" --prefix PATH : "${stdenv.lib.makeBinPath [ stdenv.cc ]}"
+      '';
+
+      # https://github.com/varnishcache/varnish-cache/issues/1875
+      NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isi686 "-fexcess-precision=standard";
+
+      outputs = [ "out" "dev" "man" ];
+
+      meta = with stdenv.lib; {
+        description = "Web application accelerator also known as a caching HTTP reverse proxy";
+        homepage = https://www.varnish-cache.org;
+        license = licenses.bsd2;
+        maintainers = with maintainers; [ garbas fpletz ];
+        platforms = platforms.unix;
+      };
+    };
+in
+{
+  varnish4 = common {
+    version = "4.1.9";
+    sha256 = "11zwyasz2fn9qxc87r175wb5ba7388sd79mlygjmqn3yv2m89n12";
+  };
+  varnish5 = common {
+    version = "5.2.1";
     sha256 = "1cqlj12m426c1lak1hr1fx5zcfsjjvka3hfirz47hvy1g2fjqidq";
   };
-
-  nativeBuildInputs = [ pkgconfig ];
-  buildInputs = [
-    pcre libxslt groff ncurses readline python libedit
-    pythonPackages.docutils makeWrapper
-  ];
-
-  buildFlags = "localstatedir=/var/spool";
-
-  postInstall = ''
-    wrapProgram "$out/sbin/varnishd" --prefix PATH : "${stdenv.lib.makeBinPath [ stdenv.cc ]}"
-  '';
-
-  # https://github.com/varnishcache/varnish-cache/issues/1875
-  NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isi686 "-fexcess-precision=standard";
-
-  outputs = [ "out" "dev" "man" ];
-
-  meta = with stdenv.lib; {
-    description = "Web application accelerator also known as a caching HTTP reverse proxy";
-    homepage = https://www.varnish-cache.org;
-    license = licenses.bsd2;
-    maintainers = with maintainers; [ garbas fpletz ];
-    platforms = platforms.unix;
+  varnish6 = common {
+    version = "6.0.0";
+    sha256 = "1vhbdch33m6ig4ijy57zvrramhs9n7cba85wd8rizgxjjnf87cn7";
   };
 }
diff --git a/pkgs/servers/varnish/digest.nix b/pkgs/servers/varnish/digest.nix
index 530ae504771..2ccb0419c04 100644
--- a/pkgs/servers/varnish/digest.nix
+++ b/pkgs/servers/varnish/digest.nix
@@ -1,22 +1,22 @@
 { stdenv, fetchFromGitHub, autoreconfHook, pkgconfig, varnish, libmhash, docutils }:
 
 stdenv.mkDerivation rec {
-  version = "1.0.1";
-  name = "varnish-digest-${version}";
+  version = "1.0.2";
+  name = "${varnish.name}-digest-${version}";
 
   src = fetchFromGitHub {
     owner = "varnish";
     repo = "libvmod-digest";
     rev = "libvmod-digest-${version}";
-    sha256 = "0v18bqbsblhajpx5qvczic3psijhx5l2p2qlw1dkd6zl33hhppy7";
+    sha256 = "0jwkqqalydn0pwfdhirl5zjhbc3hldvhh09hxrahibr72fgmgpbx";
   };
 
   nativeBuildInputs = [ autoreconfHook pkgconfig docutils ];
   buildInputs = [ varnish libmhash ];
 
   postPatch = ''
-    substituteInPlace autogen.sh  --replace "-I \''${dataroot}/aclocal"                  ""
-    substituteInPlace Makefile.am --replace "-I \''${LIBVARNISHAPI_DATAROOTDIR}/aclocal" ""
+    substituteInPlace autogen.sh  --replace "''${dataroot}/aclocal"                  "${varnish.dev}/share/aclocal"
+    substituteInPlace Makefile.am --replace "''${LIBVARNISHAPI_DATAROOTDIR}/aclocal" "${varnish.dev}/share/aclocal"
   '';
 
   configureFlags = [ "VMOD_DIR=$(out)/lib/varnish/vmods" ];
diff --git a/pkgs/servers/varnish/dynamic.nix b/pkgs/servers/varnish/dynamic.nix
new file mode 100644
index 00000000000..711bc1cf78f
--- /dev/null
+++ b/pkgs/servers/varnish/dynamic.nix
@@ -0,0 +1,26 @@
+{ stdenv, fetchFromGitHub, autoreconfHook, pkgconfig, varnish, python, docutils }:
+
+stdenv.mkDerivation rec {
+  version = "0.3";
+  name = "${varnish.name}-dynamic-${version}";
+
+  src = fetchFromGitHub {
+    owner = "nigoroll";
+    repo = "libvmod-dynamic";
+    rev = "475be183fddbd727c3d2523f0518effa9aa881f8"; # 5.2 branch for Varnish-5.2 https://github.com/nigoroll/libvmod-dynamic/commits/5.2
+    sha256 = "12a42lbv0vf6fn3qnvngw893kmbd006f8pgab4ir7irc8855xjgf";
+  };
+
+  nativeBuildInputs = [ pkgconfig docutils autoreconfHook ];
+  buildInputs = [ varnish python ];
+  postPatch = ''
+    substituteInPlace Makefile.am --replace "''${LIBVARNISHAPI_DATAROOTDIR}/aclocal" "${varnish.dev}/share/aclocal"
+  '';
+  configureFlags = [ "VMOD_DIR=$(out)/lib/varnish/vmods" ];
+
+  meta = with stdenv.lib; {
+    description = "Dynamic director similar to the DNS director from Varnish 3";
+    homepage = https://github.com/nigoroll/libvmod-dynamic;
+    inherit (varnish.meta) license platforms maintainers;
+  };
+}
diff --git a/pkgs/servers/varnish/geoip.nix b/pkgs/servers/varnish/geoip.nix
index 7816b27b14f..d1790252065 100644
--- a/pkgs/servers/varnish/geoip.nix
+++ b/pkgs/servers/varnish/geoip.nix
@@ -2,7 +2,7 @@
 
 stdenv.mkDerivation rec {
   version = "1.0.2";
-  name = "varnish-geoip-${version}";
+  name = "${varnish.name}-geoip-${version}";
 
   src = fetchFromGitHub {
     owner = "varnish";
diff --git a/pkgs/servers/varnish/modules.nix b/pkgs/servers/varnish/modules.nix
index 8fdcf63e5b9..7775221d163 100644
--- a/pkgs/servers/varnish/modules.nix
+++ b/pkgs/servers/varnish/modules.nix
@@ -1,17 +1,24 @@
-{ stdenv, fetchurl, pkgconfig, varnish, python, docutils, removeReferencesTo }:
+{ stdenv, fetchFromGitHub, autoreconfHook, pkgconfig, varnish, python, docutils, removeReferencesTo }:
 
 stdenv.mkDerivation rec {
-  version = "0.13.0";
-  name = "varnish-modules-${version}";
+  version = "0.14.0";
+  name = "${varnish.name}-modules-${version}";
 
-  src = fetchurl {
-    url = "https://download.varnish-software.com/varnish-modules/varnish-modules-${version}.tar.gz";
-    sha256 = "1nj52va7cp0swcv87zd3si80knpaa4a7na37cy9wkvgyvhf9k8mh";
+  src = fetchFromGitHub {
+    owner = "varnish";
+    repo = "varnish-modules";
+    rev = version;
+    sha256 = "17fkbr4i70qgdqsrx1x28ag20xkfyz1v3q3d3ywmv409aczqhm40";
   };
 
-  nativeBuildInputs = [ pkgconfig docutils removeReferencesTo ];
+  nativeBuildInputs = [ pkgconfig autoreconfHook docutils removeReferencesTo ];
   buildInputs = [ varnish python ];
 
+  postPatch = ''
+    substituteInPlace bootstrap   --replace "''${dataroot}/aclocal"                  "${varnish.dev}/share/aclocal"
+    substituteInPlace Makefile.am --replace "''${LIBVARNISHAPI_DATAROOTDIR}/aclocal" "${varnish.dev}/share/aclocal"
+  '';
+
   postInstall = "find $out -type f -exec remove-references-to -t ${varnish.dev} '{}' +"; # varnish.dev captured only as __FILE__ in assert messages
 
   meta = with stdenv.lib; {
diff --git a/pkgs/servers/varnish/packages.nix b/pkgs/servers/varnish/packages.nix
new file mode 100644
index 00000000000..f468ac58e6c
--- /dev/null
+++ b/pkgs/servers/varnish/packages.nix
@@ -0,0 +1,22 @@
+{ callPackage, varnish4, varnish5, varnish6 }:
+
+{
+  varnish4Packages = {
+    varnish = varnish4;
+    digest   = callPackage ./digest.nix   { varnish = varnish4; };
+    rtstatus = callPackage ./rtstatus.nix { varnish = varnish4; }; # varnish4 only
+    modules  = callPackage ./modules.nix  { varnish = varnish4; }; # varnish4 and varnish5 only
+    geoip    = callPackage ./geoip.nix    { varnish = varnish4; }; # varnish4 and varnish5 only
+  };
+  varnish5Packages = {
+    varnish = varnish5;
+    digest   = callPackage ./digest.nix   { varnish = varnish5; };
+    dynamic  = callPackage ./dynamic.nix  { varnish = varnish5; }; # varnish5 only (upstream has a separate branch for varnish4)
+    modules  = callPackage ./modules.nix  { varnish = varnish5; }; # varnish4 and varnish5 only
+    geoip    = callPackage ./geoip.nix    { varnish = varnish5; }; # varnish4 and varnish5 only
+  };
+  varnish6Packages = {
+    varnish = varnish6;
+    digest   = callPackage ./digest.nix   { varnish = varnish6; };
+  };
+}
diff --git a/pkgs/servers/varnish/rtstatus.nix b/pkgs/servers/varnish/rtstatus.nix
index e92559f038d..99c0bb17659 100644
--- a/pkgs/servers/varnish/rtstatus.nix
+++ b/pkgs/servers/varnish/rtstatus.nix
@@ -2,7 +2,7 @@
 
 stdenv.mkDerivation rec {
   version = "1.2.0";
-  name = "varnish-rtstatus-${version}";
+  name = "${varnish.name}-rtstatus-${version}";
 
   src = fetchurl {
     url = "https://download.varnish-software.com/libvmod-rtstatus/libvmod-rtstatus-${version}.tar.gz";
@@ -17,6 +17,5 @@ stdenv.mkDerivation rec {
     description = "Varnish realtime status page";
     homepage = https://github.com/varnish/libvmod-rtstatus;
     inherit (varnish.meta) license platforms maintainers;
-    broken = true; # it has not ported to varnish 5.2 yet (5.1 is ok)
   };
 }