2021-01-19 07:50:56 +01:00
|
|
|
{ lib, stdenv, fetchFromGitHub, autoreconfHook, pkg-config, varnish, docutils, removeReferencesTo }:
|
2022-01-07 15:53:17 +01:00
|
|
|
let
|
|
|
|
common = { version, sha256, extraNativeBuildInputs ? [] }:
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "${varnish.name}-modules";
|
|
|
|
inherit version;
|
2017-07-16 00:17:53 +02:00
|
|
|
|
2022-01-07 15:53:17 +01:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "varnish";
|
|
|
|
repo = "varnish-modules";
|
|
|
|
rev = version;
|
|
|
|
inherit sha256;
|
|
|
|
};
|
2017-07-16 00:17:53 +02:00
|
|
|
|
2022-01-07 15:53:17 +01:00
|
|
|
nativeBuildInputs = [
|
|
|
|
autoreconfHook
|
|
|
|
docutils
|
|
|
|
pkg-config
|
|
|
|
removeReferencesTo
|
|
|
|
varnish.python # use same python version as varnish server
|
|
|
|
];
|
2019-08-15 17:14:40 +02:00
|
|
|
|
2022-01-07 15:53:17 +01:00
|
|
|
buildInputs = [ varnish ];
|
2017-07-16 00:17:53 +02:00
|
|
|
|
2022-01-07 15:53:17 +01:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace bootstrap --replace "''${dataroot}/aclocal" "${varnish.dev}/share/aclocal"
|
|
|
|
substituteInPlace Makefile.am --replace "''${LIBVARNISHAPI_DATAROOTDIR}/aclocal" "${varnish.dev}/share/aclocal"
|
|
|
|
'';
|
2018-03-20 07:19:32 +01:00
|
|
|
|
2022-01-07 15:53:17 +01:00
|
|
|
postInstall = "find $out -type f -exec remove-references-to -t ${varnish.dev} '{}' +"; # varnish.dev captured only as __FILE__ in assert messages
|
2017-11-26 12:51:29 +01:00
|
|
|
|
2022-01-07 15:53:17 +01:00
|
|
|
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";
|
2017-07-16 00:17:53 +02:00
|
|
|
};
|
|
|
|
}
|