{"action":"created","issue":{"url":"https://api.github.com/repos/NixOS/nixpkgs/issues/7717","labels_url":"https://api.github.com/repos/NixOS/nixpkgs/issues/7717/labels{/name}","comments_url":"https://api.github.com/repos/NixOS/nixpkgs/issues/7717/comments","events_url":"https://api.github.com/repos/NixOS/nixpkgs/issues/7717/events","html_url":"https://github.com/NixOS/nixpkgs/pull/7717","id":73468758,"number":7717,"title":"Add the google-cloud-sdk package","user":{"login":"stephenmw","id":231788,"avatar_url":"https://avatars.githubusercontent.com/u/231788?v=3","gravatar_id":"","url":"https://api.github.com/users/stephenmw","html_url":"https://github.com/stephenmw","followers_url":"https://api.github.com/users/stephenmw/followers","following_url":"https://api.github.com/users/stephenmw/following{/other_user}","gists_url":"https://api.github.com/users/stephenmw/gists{/gist_id}","starred_url":"https://api.github.com/users/stephenmw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stephenmw/subscriptions","organizations_url":"https://api.github.com/users/stephenmw/orgs","repos_url":"https://api.github.com/users/stephenmw/repos","events_url":"https://api.github.com/users/stephenmw/events{/privacy}","received_events_url":"https://api.github.com/users/stephenmw/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-05-06T00:08:03Z","updated_at":"2015-05-06T01:54:17Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/NixOS/nixpkgs/pulls/7717","html_url":"https://github.com/NixOS/nixpkgs/pull/7717","diff_url":"https://github.com/NixOS/nixpkgs/pull/7717.diff","patch_url":"https://github.com/NixOS/nixpkgs/pull/7717.patch"},"body":""},"comment":{"url":"https://api.github.com/repos/NixOS/nixpkgs/issues/comments/99285758","html_url":"https://github.com/NixOS/nixpkgs/pull/7717#issuecomment-99285758","issue_url":"https://api.github.com/repos/NixOS/nixpkgs/issues/7717","id":99285758,"user":{"login":"cstrahan","id":143982,"avatar_url":"https://avatars.githubusercontent.com/u/143982?v=3","gravatar_id":"","url":"https://api.github.com/users/cstrahan","html_url":"https://github.com/cstrahan","followers_url":"https://api.github.com/users/cstrahan/followers","following_url":"https://api.github.com/users/cstrahan/following{/other_user}","gists_url":"https://api.github.com/users/cstrahan/gists{/gist_id}","starred_url":"https://api.github.com/users/cstrahan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cstrahan/subscriptions","organizations_url":"https://api.github.com/users/cstrahan/orgs","repos_url":"https://api.github.com/users/cstrahan/repos","events_url":"https://api.github.com/users/cstrahan/events{/privacy}","received_events_url":"https://api.github.com/users/cstrahan/received_events","type":"User","site_admin":false},"created_at":"2015-05-06T01:54:17Z","updated_at":"2015-05-06T01:54:17Z","body":"Ok, I think something like this would do (though I haven't tested it yet):\r\n\r\n```nix\r\n{stdenv, lib, fetchurl, python27, makeWrapper, crcmod ? null}:\r\n\r\n# crcmod improves the performance of gsutil\r\n\r\nstdenv.mkDerivation rec {\r\n  version = \"0.9.58\";\r\n  name = \"google-cloud-sdk-${version}\";\r\n\r\n  src = fetchurl {\r\n    url = \"https://dl.google.com/dl/cloudsdk/release/packages/google-cloud-sdk-coretools-linux-static-20150429151447.tar.gz\";\r\n    sha256 = \"0sak1fmm7z7ry1k2r67a13mpgi55rbnx81s0y0xhd86dm5aw4f48\";\r\n  };\r\n\r\n  buildInputs = [python27 makeWrapper];\r\n\r\n  phases = [ \"unpackPhase\" \"buildPhase\" \"fixupPhase\" ];\r\n\r\n  installPhase = ''\r\n    mkdir -p \"$out\"\r\n\r\n    # create wrappers with correct env\r\n    for program in gcloud bq gsutil git-credential-gcloud.sh; do\r\n      programPath=\"$out/google-cloud-sdk/bin/$program\"\r\n      wrapper=\"$out/bin/$program\"\r\n      ${if (crcmod != null) then ''\r\n      extraArgs=\"--prefix PYTHONPATH : ${crcmod}/${python27.sitePackages}\"\r\n      '' else ''\r\n      extraArgs=\"\"\r\n      ''};\r\n      makeWrapper \"$programPath\" \"$wrapper\" \\\r\n          --set CLOUDSDK_PYTHON \"${python27}/bin/python\" \\\r\n          $extraAgs\r\n    done\r\n\r\n    # install man pages\r\n    mv \"$out/google-cloud-sdk/help/man\" \"$out\"\r\n\r\n    # setup bash completion\r\n    mkdir -p \"$out/etc/bash_completion.d/\"\r\n    mv \"$out/google-cloud-sdk/completion.bash.inc\" \"$out/etc/bash_completion.d/gcloud.inc\"\r\n  '';\r\n\r\n  meta = with lib; {\r\n    description = \"Tools for the google cloud platform\";\r\n    longDescription = \"The Google Cloud SDK. This package has the programs: gcloud, gsutil, and bq\";\r\n    homepage = \"https://cloud.google.com/sdk/\";\r\n    maintainers = with maintainers; [stephenmw];\r\n    platforms = platforms.all;\r\n  };\r\n}\r\n```"}}