From 886770c6f0ea3ed43ac934e459efe3ba5f9879e2 Mon Sep 17 00:00:00 2001 From: Ilya Kolpakov Date: Thu, 16 Nov 2017 13:46:37 +0100 Subject: [PATCH] google-cloud-sdk: no dependence on gce by default (fixes #31369) --- pkgs/tools/admin/google-cloud-sdk/default.nix | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/pkgs/tools/admin/google-cloud-sdk/default.nix b/pkgs/tools/admin/google-cloud-sdk/default.nix index ee62b1b84f19..6dec65892b0f 100644 --- a/pkgs/tools/admin/google-cloud-sdk/default.nix +++ b/pkgs/tools/admin/google-cloud-sdk/default.nix @@ -1,8 +1,18 @@ -{ stdenv, lib, fetchurl, python, cffi, cryptography, pyopenssl, crcmod, google-compute-engine, makeWrapper }: +# Make sure that the "with-gce" flag is set when building `google-cloud-sdk` +# for GCE hosts. This flag prevents "google-compute-engine" from being a +# default dependency which is undesirable because this package is +# +# 1) available only on GNU/Linux (requires `systemd` in particular) +# 2) intended only for GCE guests (and is useless elsewhere) +# 3) used by `google-cloud-sdk` only on GCE guests +# + +{ stdenv, lib, fetchurl, makeWrapper, python, cffi, cryptography, pyopenssl, + crcmod, google-compute-engine, with-gce ? false }: -# other systems not supported yet let - pythonInputs = [ cffi cryptography pyopenssl crcmod google-compute-engine ]; + pythonInputs = [ cffi cryptography pyopenssl crcmod ] + ++ lib.optional (with-gce) google-compute-engine; pythonPath = lib.makeSearchPath python.sitePackages pythonInputs; baseUrl = "https://dl.google.com/dl/cloudsdk/channels/rapid/downloads";