From da2aef368559a6991f1a455fd1cb383409505006 Mon Sep 17 00:00:00 2001 From: Stephen Weinberg Date: Tue, 5 May 2015 17:09:40 -0400 Subject: [PATCH] Add the google-cloud-sdk package --- lib/maintainers.nix | 1 + pkgs/tools/admin/google-cloud-sdk/default.nix | 51 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 3 files changed, 54 insertions(+) create mode 100644 pkgs/tools/admin/google-cloud-sdk/default.nix diff --git a/lib/maintainers.nix b/lib/maintainers.nix index d4fda831d594..efb0363c5bd2 100644 --- a/lib/maintainers.nix +++ b/lib/maintainers.nix @@ -195,6 +195,7 @@ smironov = "Sergey Mironov "; sprock = "Roger Mason "; spwhitt = "Spencer Whitt "; + stephenmw = "Stephen Weinberg "; sztupi = "Attila Sztupak "; tailhook = "Paul Colomiets "; taktoa = "Remy Goldschmidt "; diff --git a/pkgs/tools/admin/google-cloud-sdk/default.nix b/pkgs/tools/admin/google-cloud-sdk/default.nix new file mode 100644 index 000000000000..d2c22b055be6 --- /dev/null +++ b/pkgs/tools/admin/google-cloud-sdk/default.nix @@ -0,0 +1,51 @@ +{stdenv, fetchurl, python27, python27Packages, makeWrapper}: + +stdenv.mkDerivation rec { + version = "0.9.58"; + name = "google-cloud-sdk-${version}"; + + src = fetchurl { + url = "https://dl.google.com/dl/cloudsdk/release/packages/google-cloud-sdk-coretools-linux-static-20150429151447.tar.gz"; + sha256 = "0sak1fmm7z7ry1k2r67a13mpgi55rbnx81s0y0xhd86dm5aw4f48"; + }; + + buildInputs = [python27 makeWrapper]; + + phases = [ "installPhase" "fixupPhase" ]; + + installPhase = '' + mkdir -p "$out" + tar -xzf "$src" -C "$out" google-cloud-sdk + + # create wrappers with correct env + for program in gcloud bq gsutil git-credential-gcloud.sh; do + programPath="$out/google-cloud-sdk/bin/$program" + wrapper="$out/bin/$program" + makeWrapper "$programPath" "$wrapper" \ + --set CLOUDSDK_PYTHON "${python27}/bin/python" \ + --prefix PYTHONPATH : "$(toPythonPath ${python27Packages.crcmod})" + done + + # install man pages + mv "$out/google-cloud-sdk/help/man" "$out" + + # setup bash completion + mkdir -p "$out/etc/bash_completion.d/" + mv "$out/google-cloud-sdk/completion.bash.inc" "$out/etc/bash_completion.d/gcloud.inc" + + # This directory contains compiled mac binaries. We used crcmod from + # nixpkgs instead. + rm -r $out/google-cloud-sdk/platform/gsutil/third_party/crcmod + ''; + + meta = { + description = "Tools for the google cloud platform"; + longDescription = "The Google Cloud SDK. This package has the programs: gcloud, gsutil, and bq"; + version = version; + # This package contains vendored dependencies. All have free licenses. + license = stdenv.lib.licenses.free; + homepage = "https://cloud.google.com/sdk/"; + maintainers = with stdenv.lib.maintainers; [stephenmw]; + platforms = stdenv.lib.platforms.all; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 0c15f9ce0a41..cbcc13616604 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -1553,6 +1553,8 @@ let googleAuthenticator = callPackage ../os-specific/linux/google-authenticator { }; + google-cloud-sdk = callPackage ../tools/admin/google-cloud-sdk { }; + gource = callPackage ../applications/version-management/gource { }; gparted = callPackage ../tools/misc/gparted { };