about summary refs log tree commit diff
path: root/pkgs/servers/varnish/modules.nix
diff options
context:
space:
mode:
authorJean-Baptiste Giraudeau <jean-baptiste.giraudeau@iohk.io>2022-01-07 15:53:17 +0100
committerJonathan Ringer <jonringer@users.noreply.github.com>2022-01-10 13:14:54 -0800
commit714a6778503d31ff68c6c8e4d849f455ea193519 (patch)
tree6c22682332c9d5165660c20ee952e8d60f8bcdfd /pkgs/servers/varnish/modules.nix
parentd36d401087a7e347c8b8ec539af1d32e130de564 (diff)
varnish: build modules for varnish 6 & 7.
Diffstat (limited to 'pkgs/servers/varnish/modules.nix')
-rw-r--r--pkgs/servers/varnish/modules.nix66
1 files changed, 39 insertions, 27 deletions
diff --git a/pkgs/servers/varnish/modules.nix b/pkgs/servers/varnish/modules.nix
index 527dd17c03c09..4922907f920f2 100644
--- a/pkgs/servers/varnish/modules.nix
+++ b/pkgs/servers/varnish/modules.nix
@@ -1,36 +1,48 @@
 { lib, stdenv, fetchFromGitHub, autoreconfHook, pkg-config, varnish, docutils, removeReferencesTo }:
+let
+  common = { version, sha256, extraNativeBuildInputs ? [] }:
+    stdenv.mkDerivation rec {
+      pname = "${varnish.name}-modules";
+      inherit version;
 
-stdenv.mkDerivation rec {
-  version = "0.15.0";
-  pname = "${varnish.name}-modules";
+      src = fetchFromGitHub {
+        owner = "varnish";
+        repo = "varnish-modules";
+        rev = version;
+        inherit sha256;
+      };
 
-  src = fetchFromGitHub {
-    owner = "varnish";
-    repo = "varnish-modules";
-    rev = version;
-    sha256 = "00p9syl765lfg1d2ka7da6h46dfl388f8h36x9cmrjix95rg0yr8";
-  };
-
-  nativeBuildInputs = [
-    autoreconfHook
-    docutils
-    pkg-config
-    removeReferencesTo
-    varnish.python  # use same python version as varnish server
-  ];
+      nativeBuildInputs = [
+        autoreconfHook
+        docutils
+        pkg-config
+        removeReferencesTo
+        varnish.python  # use same python version as varnish server
+      ];
 
-  buildInputs = [ varnish ];
+      buildInputs = [ varnish ];
 
-  postPatch = ''
-    substituteInPlace bootstrap   --replace "''${dataroot}/aclocal"                  "${varnish.dev}/share/aclocal"
-    substituteInPlace Makefile.am --replace "''${LIBVARNISHAPI_DATAROOTDIR}/aclocal" "${varnish.dev}/share/aclocal"
-  '';
+      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
+      postInstall = "find $out -type f -exec remove-references-to -t ${varnish.dev} '{}' +"; # varnish.dev captured only as __FILE__ in assert messages
 
-  meta = with lib; {
-    description = "Collection of Varnish Cache modules (vmods) by Varnish Software";
-    homepage = "https://github.com/varnish/varnish-modules";
-    inherit (varnish.meta) license platforms maintainers;
+      meta = with lib; {
+        description = "Collection of Varnish Cache modules (vmods) by Varnish Software";
+        homepage = "https://github.com/varnish/varnish-modules";
+        inherit (varnish.meta) license platforms maintainers;
+      };
+    };
+in
+{
+  modules15 = common {
+    version = "0.15.1";
+    sha256 = "1lwgjhgr5yw0d17kbqwlaj5pkn70wvaqqjpa1i0n459nx5cf5pqj";
+  };
+  modules19 = common {
+    version = "0.19.0";
+    sha256 = "0qq5g6bbd1a1ml1wk8jj9z39a899jzqbf7aizr3pvyz0f4kz8mis";
   };
 }