@@ -1,37 +1,53 @@
11{ stdenv, fetchurl, pcre, libxslt, groff, ncurses, pkgconfig, readline, libedit
22, python, pythonPackages, makeWrapper }:
33
4−stdenv.mkDerivation rec {
5− version = "5.2.1";
6− name = "varnish-${version}";
7−
8− src = fetchurl {
9− url = "http://varnish-cache.org/_downloads/${name}.tgz";
4+let
5+ common = { version, sha256 }:
6+ stdenv.mkDerivation rec {
7+ name = "varnish-${version}";
8+
9+ src = fetchurl {
10+ url = "http://varnish-cache.org/_downloads/${name}.tgz";
11+ inherit sha256;
12+ };
13+
14+ nativeBuildInputs = [ pkgconfig ];
15+ buildInputs = [
16+ pcre libxslt groff ncurses readline python libedit
17+ pythonPackages.docutils makeWrapper
18+ ];
19+
20+ buildFlags = "localstatedir=/var/spool";
21+
22+ postInstall = ''
23+ wrapProgram "$out/sbin/varnishd" --prefix PATH : "${stdenv.lib.makeBinPath [ stdenv.cc ]}"
24+ '';
25+
26+ # https://github.com/varnishcache/varnish-cache/issues/1875
27+ NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isi686 "-fexcess-precision=standard";
28+
29+ outputs = [ "out" "dev" "man" ];
30+
31+ meta = with stdenv.lib; {
32+ description = "Web application accelerator also known as a caching HTTP reverse proxy";
33+ homepage = https://www.varnish-cache.org;
34+ license = licenses.bsd2;
35+ maintainers = with maintainers; [ garbas fpletz ];
36+ platforms = platforms.unix;
37+ };
38+ };
39+in
40+{
41+ varnish4 = common {
42+ version = "4.1.9";
43+ sha256 = "11zwyasz2fn9qxc87r175wb5ba7388sd79mlygjmqn3yv2m89n12";
44+ };
45+ varnish5 = common {
46+ version = "5.2.1";
1047 sha256 = "1cqlj12m426c1lak1hr1fx5zcfsjjvka3hfirz47hvy1g2fjqidq";
1148 };
12−
13− nativeBuildInputs = [ pkgconfig ];
14− buildInputs = [
15− pcre libxslt groff ncurses readline python libedit
16− pythonPackages.docutils makeWrapper
17− ];
18−
19− buildFlags = "localstatedir=/var/spool";
20−
21− postInstall = ''
22− wrapProgram "$out/sbin/varnishd" --prefix PATH : "${stdenv.lib.makeBinPath [ stdenv.cc ]}"
23− '';
24−
25− # https://github.com/varnishcache/varnish-cache/issues/1875
26− NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isi686 "-fexcess-precision=standard";
27−
28− outputs = [ "out" "dev" "man" ];
29−
30− meta = with stdenv.lib; {
31− description = "Web application accelerator also known as a caching HTTP reverse proxy";
32− homepage = https://www.varnish-cache.org;
33− license = licenses.bsd2;
34− maintainers = with maintainers; [ garbas fpletz ];
35− platforms = platforms.unix;
49+ varnish6 = common {
50+ version = "6.0.0";
51+ sha256 = "1vhbdch33m6ig4ijy57zvrramhs9n7cba85wd8rizgxjjnf87cn7";
3652 };
3753}