nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 autoreconfHook,
6 pkg-config,
7 varnish,
8 libmhash,
9 docutils,
10 coreutils,
11 version,
12 sha256,
13}:
14
15stdenv.mkDerivation rec {
16 pname = "${varnish.name}-digest";
17 inherit version;
18
19 src = fetchFromGitHub {
20 owner = "varnish";
21 repo = "libvmod-digest";
22 rev = version;
23 inherit sha256;
24 };
25
26 nativeBuildInputs = [
27 autoreconfHook
28 pkg-config
29 docutils
30 ];
31 buildInputs = [
32 varnish
33 libmhash
34 ];
35
36 postPatch = ''
37 substituteInPlace autogen.sh --replace "''${dataroot}/aclocal" "${varnish.dev}/share/aclocal"
38 substituteInPlace Makefile.am --replace "''${LIBVARNISHAPI_DATAROOTDIR}/aclocal" "${varnish.dev}/share/aclocal"
39 '';
40
41 configureFlags = [ "VMOD_DIR=$(out)/lib/varnish/vmods" ];
42
43 env.NIX_CFLAGS_COMPILE = toString [ "-Wno-error=deprecated-declarations" ];
44
45 doCheck = true;
46
47 meta = {
48 description = "Digest and HMAC vmod";
49 homepage = "https://github.com/varnish/libvmod-digest";
50 inherit (varnish.meta) license platforms;
51 };
52}