about summary refs log tree commit diff
path: root/nixpkgs/pkgs/servers/varnish/modules.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/servers/varnish/modules.nix')
-rw-r--r--nixpkgs/pkgs/servers/varnish/modules.nix36
1 files changed, 36 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/servers/varnish/modules.nix b/nixpkgs/pkgs/servers/varnish/modules.nix
new file mode 100644
index 000000000000..69ee7028de87
--- /dev/null
+++ b/nixpkgs/pkgs/servers/varnish/modules.nix
@@ -0,0 +1,36 @@
+{ stdenv, fetchFromGitHub, autoreconfHook, pkgconfig, varnish, docutils, removeReferencesTo }:
+
+stdenv.mkDerivation rec {
+  version = "0.15.0";
+  name = "${varnish.name}-modules-${version}";
+
+  src = fetchFromGitHub {
+    owner = "varnish";
+    repo = "varnish-modules";
+    rev = version;
+    sha256 = "00p9syl765lfg1d2ka7da6h46dfl388f8h36x9cmrjix95rg0yr8";
+  };
+
+  nativeBuildInputs = [
+    autoreconfHook
+    docutils
+    pkgconfig
+    removeReferencesTo
+    varnish.python  # use same python version as varnish server
+  ];
+
+  buildInputs = [ varnish ];
+
+  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; {
+    description = "Collection of Varnish Cache modules (vmods) by Varnish Software";
+    homepage = "https://github.com/varnish/varnish-modules";
+    inherit (varnish.meta) license platforms maintainers;
+  };
+}