forgejo-lts: 7.0.10 -> 7.0.11
[NixPkgs.git] / pkgs / servers / varnish / modules.nix
blob8e6db1b7a28e7eee6e7cc7081da1df3d7fa588be
1 { lib, stdenv, fetchFromGitHub, autoreconfHook, pkg-config, varnish, docutils, removeReferencesTo }:
2 let
3   common = { version, hash, extraNativeBuildInputs ? [] }:
4     stdenv.mkDerivation rec {
5       pname = "${varnish.name}-modules";
6       inherit version;
8       src = fetchFromGitHub {
9         owner = "varnish";
10         repo = "varnish-modules";
11         rev = version;
12         inherit hash;
13       };
15       nativeBuildInputs = [
16         autoreconfHook
17         docutils
18         pkg-config
19         removeReferencesTo
20         varnish.python  # use same python version as varnish server
21       ];
23       buildInputs = [ varnish ];
25       postPatch = ''
26         substituteInPlace bootstrap   --replace "''${dataroot}/aclocal"                  "${varnish.dev}/share/aclocal"
27         substituteInPlace Makefile.am --replace "''${LIBVARNISHAPI_DATAROOTDIR}/aclocal" "${varnish.dev}/share/aclocal"
28       '';
30       postInstall = "find $out -type f -exec remove-references-to -t ${varnish.dev} '{}' +"; # varnish.dev captured only as __FILE__ in assert messages
32       meta = with lib; {
33         description = "Collection of Varnish Cache modules (vmods) by Varnish Software";
34         homepage = "https://github.com/varnish/varnish-modules";
35         inherit (varnish.meta) license platforms maintainers;
36       };
37     };
40   modules15 = common {
41     version = "0.15.1";
42     hash = "sha256-Et/iWOk2FWJBDOpKjNXm4Nh5i1SU4zVPaID7kh+Uj9M=";
43   };
44   modules24 = common {
45     version = "0.24.0";
46     hash = "sha256-2MfcrhhkBz9GyQxEWzjipdn1CBEqnCvC3t1G2YSauak=";
47   };