From c74db7340d6df67ba3b5d847b384d65cc7dea621 Mon Sep 17 00:00:00 2001 From: Jonathan Ringer Date: Tue, 13 Aug 2019 05:46:15 -0700 Subject: [PATCH 1/2] varnish5: fix build --- pkgs/servers/varnish/default.nix | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/pkgs/servers/varnish/default.nix b/pkgs/servers/varnish/default.nix index 4ee23e68265f..16386d5b65de 100644 --- a/pkgs/servers/varnish/default.nix +++ b/pkgs/servers/varnish/default.nix @@ -1,8 +1,8 @@ { stdenv, fetchurl, pcre, libxslt, groff, ncurses, pkgconfig, readline, libedit -, python3, makeWrapper }: +, python2, python3, makeWrapper }: let - common = { version, sha256, extraBuildInputs ? [] }: + common = { version, sha256, python, extraNativeBuildInputs ? [] }: stdenv.mkDerivation rec { name = "varnish-${version}"; @@ -11,11 +11,10 @@ let inherit sha256; }; - nativeBuildInputs = [ pkgconfig ]; + nativeBuildInputs = with python.pkgs; [ pkgconfig docutils ] ++ extraNativeBuildInputs; buildInputs = [ - pcre libxslt groff ncurses readline python3 libedit - python3.pkgs.docutils makeWrapper - ] ++ extraBuildInputs; + pcre libxslt groff ncurses readline libedit makeWrapper python + ]; buildFlags = "localstatedir=/var/spool"; @@ -41,14 +40,17 @@ in varnish4 = common { version = "4.1.10"; sha256 = "08kwx0il6cqxsx3897042plh1yxjaanbaqjbspfl0xgvyvxk6j1n"; + python = python2; }; varnish5 = common { version = "5.2.1"; sha256 = "1cqlj12m426c1lak1hr1fx5zcfsjjvka3hfirz47hvy1g2fjqidq"; + python = python2; }; varnish6 = common { version = "6.2.0"; sha256 = "0lwfk2gq99c653h5f51fs3j37r0gh2pf0p4w5z986nm2mi9z6yn3"; - extraBuildInputs = [ python3.pkgs.sphinx ]; + python = python3; + extraNativeBuildInputs = [ python3.pkgs.sphinx ]; }; } From 9fe0ee55a798411e22c1837476d5f71b7e1e4d0e Mon Sep 17 00:00:00 2001 From: Jonathan Ringer Date: Thu, 15 Aug 2019 08:14:40 -0700 Subject: [PATCH 2/2] varnishPackages: pin python to varnish python version --- pkgs/servers/varnish/default.nix | 2 ++ pkgs/servers/varnish/dynamic.nix | 6 +++--- pkgs/servers/varnish/modules.nix | 13 ++++++++++--- pkgs/servers/varnish/rtstatus.nix | 6 +++--- 4 files changed, 18 insertions(+), 9 deletions(-) diff --git a/pkgs/servers/varnish/default.nix b/pkgs/servers/varnish/default.nix index 16386d5b65de..c9f0f2b84bbe 100644 --- a/pkgs/servers/varnish/default.nix +++ b/pkgs/servers/varnish/default.nix @@ -11,6 +11,8 @@ let inherit sha256; }; + passthru.python = python; + nativeBuildInputs = with python.pkgs; [ pkgconfig docutils ] ++ extraNativeBuildInputs; buildInputs = [ pcre libxslt groff ncurses readline libedit makeWrapper python diff --git a/pkgs/servers/varnish/dynamic.nix b/pkgs/servers/varnish/dynamic.nix index 711bc1cf78f5..b3e86387ee32 100644 --- a/pkgs/servers/varnish/dynamic.nix +++ b/pkgs/servers/varnish/dynamic.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchFromGitHub, autoreconfHook, pkgconfig, varnish, python, docutils }: +{ stdenv, fetchFromGitHub, autoreconfHook, pkgconfig, varnish, docutils }: stdenv.mkDerivation rec { version = "0.3"; @@ -11,8 +11,8 @@ stdenv.mkDerivation rec { sha256 = "12a42lbv0vf6fn3qnvngw893kmbd006f8pgab4ir7irc8855xjgf"; }; - nativeBuildInputs = [ pkgconfig docutils autoreconfHook ]; - buildInputs = [ varnish python ]; + nativeBuildInputs = [ pkgconfig docutils autoreconfHook varnish.python ]; + buildInputs = [ varnish ]; postPatch = '' substituteInPlace Makefile.am --replace "''${LIBVARNISHAPI_DATAROOTDIR}/aclocal" "${varnish.dev}/share/aclocal" ''; diff --git a/pkgs/servers/varnish/modules.nix b/pkgs/servers/varnish/modules.nix index 7775221d1638..16c74956db7e 100644 --- a/pkgs/servers/varnish/modules.nix +++ b/pkgs/servers/varnish/modules.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchFromGitHub, autoreconfHook, pkgconfig, varnish, python, docutils, removeReferencesTo }: +{ stdenv, fetchFromGitHub, autoreconfHook, pkgconfig, varnish, docutils, removeReferencesTo }: stdenv.mkDerivation rec { version = "0.14.0"; @@ -11,8 +11,15 @@ stdenv.mkDerivation rec { sha256 = "17fkbr4i70qgdqsrx1x28ag20xkfyz1v3q3d3ywmv409aczqhm40"; }; - nativeBuildInputs = [ pkgconfig autoreconfHook docutils removeReferencesTo ]; - buildInputs = [ varnish python ]; + nativeBuildInputs = [ + autoreconfHook + docutils + pkgconfig + removeReferencesTo + varnish.python # use same python version as varnish server + ]; + + buildInputs = [ varnish ]; postPatch = '' substituteInPlace bootstrap --replace "''${dataroot}/aclocal" "${varnish.dev}/share/aclocal" diff --git a/pkgs/servers/varnish/rtstatus.nix b/pkgs/servers/varnish/rtstatus.nix index 99c0bb176597..c27633a2d333 100644 --- a/pkgs/servers/varnish/rtstatus.nix +++ b/pkgs/servers/varnish/rtstatus.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, pkgconfig, varnish, python, docutils }: +{ stdenv, fetchurl, pkgconfig, varnish, docutils }: stdenv.mkDerivation rec { version = "1.2.0"; @@ -9,8 +9,8 @@ stdenv.mkDerivation rec { sha256 = "0hll1aspgpv1daw5sdbn5w1d6birchxgapzb6zi1nhahjlimy4ly"; }; - nativeBuildInputs = [ pkgconfig docutils ]; - buildInputs = [ varnish python ]; + nativeBuildInputs = [ pkgconfig docutils varnish.python ]; + buildInputs = [ varnish ]; configureFlags = [ "VMOD_DIR=$(out)/lib/varnish/vmods" ]; meta = with stdenv.lib; {