summary refs log tree commit diff
path: root/pkgs/servers/varnish/digest.nix
blob: 55d13ffae31f98f646d0990bac52a69fa258e33b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
{ lib, stdenv, fetchFromGitHub, autoreconfHook, pkg-config, varnish, libmhash, docutils }:

stdenv.mkDerivation rec {
  version = "1.0.2";
  name = "${varnish.name}-digest-${version}";

  src = fetchFromGitHub {
    owner = "varnish";
    repo = "libvmod-digest";
    rev = "libvmod-digest-${version}";
    sha256 = "0jwkqqalydn0pwfdhirl5zjhbc3hldvhh09hxrahibr72fgmgpbx";
  };

  nativeBuildInputs = [ autoreconfHook pkg-config docutils ];
  buildInputs = [ varnish libmhash ];

  postPatch = ''
    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" ];

  NIX_CFLAGS_COMPILE = [ "-Wno-error=deprecated-declarations" ];

  doCheck = true;

  meta = with lib; {
    description = "Digest and HMAC vmod";
    homepage = "https://github.com/varnish/libvmod-digest";
    inherit (varnish.meta) license platforms maintainers;
  };
}