# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4 PortSystem 1.0 PortGroup python 1.0 name google-cloud-sdk version 504.0.1 revision 0 categories devel python license Apache-2 maintainers {breun.nl:nils @breun} openmaintainer description Command-line interface for Google Cloud Platform products and services long_description Google Cloud SDK is a set of tools for Google Cloud Platform. \ It contains gcloud, gsutil, and bq command-line tools, which you can \ use to access Compute Engine, Cloud Storage, BigQuery, and other \ products and services from the command-line. You can run these tools \ interactively or in your automated scripts. platforms {darwin any} supported_archs i386 x86_64 arm64 if { ${configure.build_arch} eq "i386" } { distname ${name}-${version}-darwin-x86 checksums rmd160 8136d720042f1feac9009d39ecb665aa6d3c638a \ sha256 0c4515a3fc3983f7214e55fcd5b0d6fb0a2933a25f57c773ee94e145d1df8884 \ size 53240119 } elseif { ${configure.build_arch} eq "x86_64" } { distname ${name}-${version}-darwin-x86_64 checksums rmd160 8f322d5389247fe0a3d4fe0ef2968ff6a4c7ee33 \ sha256 87fd436a6fbe556b472d1467130825cf6f0f64448070f5644228219b92771001 \ size 54590053 } elseif { ${configure.build_arch} eq "arm64" } { distname ${name}-${version}-darwin-arm checksums rmd160 70267be0838ea3793d36d9ad910067c78a8ccf3b \ sha256 d73664d78308386aa1a480ccbebaf0d805241ed27cbce8fb2c24677bcb5edac9 \ size 54536494 } homepage https://cloud.google.com/sdk/ master_sites https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/ worksrcdir ${name} # Most recent Python version that supports to both # glcoud (https://cloud.google.com/sdk/docs/install#mac) and # gsutil (https://cloud.google.com/storage/docs/gsutil_install#specifications) python.default_version 312 post-patch { # Default to the MacPorts Python binary reinplace "s|CLOUDSDK_PYTHON=\$(order_python .*|CLOUDSDK_PYTHON=${python.bin}|" \ ${worksrcpath}/bin/bq \ ${worksrcpath}/bin/docker-credential-gcloud \ ${worksrcpath}/bin/git-credential-gcloud.sh \ ${worksrcpath}/bin/gcloud \ ${worksrcpath}/bin/gsutil \ ${worksrcpath}/bin/java_dev_appserver.sh reinplace "s|^#!/usr/bin/env python$|#!${python.bin}|" \ ${worksrcpath}/bin/dev_appserver.py # Disable updater reinplace "s|\"disable_updater\": false|\"disable_updater\": true|" ${worksrcpath}/lib/googlecloudsdk/core/config.json } use_configure no build {} # MacPorts variants are not allowed to contain '-' and gcloud component names use both '-' and '_', # so each variant adds an explicit mapping from variant name to gcloud component name. # See https://cloud.google.com/sdk/docs/components for more info about gcloud components. # Current list of available components is not documented by Google, but can be found via: gcloud components list # 'gcloud', 'gcloud-crc32c', 'bq', 'gsutil' and 'core' components are installed by default, so are not offered as variants. set variant_to_component [dict create] variant alpha description {Add gcloud CLI Alpha Commands} { dict set variant_to_component alpha alpha } variant anthos_auth description {Add Anthos auth} { dict set variant_to_component anthos_auth anthos-auth } variant app_engine_go description {Add App Engine Go Extensions} { dict set variant_to_component app_engine_go app-engine-go } variant app_engine_java description {Add gcloud app Java Extensions} { dict set variant_to_component app_engine_java app-engine-java } variant app_engine_php description {Add gcloud app PHP Extensions} { dict set variant_to_component app_engine_php app-engine-php } variant app_engine_python description {Add gcloud app Python Extensions} { dict set variant_to_component app_engine_python app-engine-python } variant app_engine_python_extras description {Add gcloud app Python Extensions (Extra Libraries)} { dict set variant_to_component app_engine_python_extras app-engine-python-extras } variant appctl description {Add Appctl} { dict set variant_to_component appctl appctl } variant beta description {Add gcloud CLI Beta Commands } { dict set variant_to_component beta beta } variant bigtable description {Add Cloud Bigtable Emulator} { dict set variant_to_component bigtable bigtable } variant cbt description {Add Cloud Bigtable Command Line Tool} { dict set variant_to_component cbt cbt } variant cloud_datastore_emulator description {Add Cloud Datastore Emulator} { dict set variant_to_component cloud_datastore_emulator cloud-datastore-emulator } variant cloud_firestore_emulator description {Add Cloud Firestore Emulator} { dict set variant_to_component cloud_firestore_emulator cloud-firestore-emulator } variant cloud_run_proxy description {Add Cloud Run Proxy} { dict set variant_to_component cloud_run_proxy cloud-run-proxy } variant cloud_sql_proxy description {Add Cloud SQL Proxy} { dict set variant_to_component cloud_sql_proxy cloud_sql_proxy } variant config_connector description {Add config connector} { dict set variant_to_component config_connector config-connector } variant datalab description {Add Cloud Datalab Command Line Tool} { dict set variant_to_component datalab datalab } variant docker_credential_gcr description {Add Google Container Registry's Docker credential helper} { dict set variant_to_component docker_credential_gcr docker-credential-gcr } variant enterprise_certificate_proxy description {Add Enterprise certificate proxy} { dict set variant_to_component enterprise_certificate_proxy enterprise-certificate-proxy } variant gke_gcloud_auth_plugin description {Add GKE Google Cloud auth plugin} { dict set variant_to_component gke_gcloud_auth_plugin gke-gcloud-auth-plugin } variant istioctl description {Add istioctl} { dict set variant_to_component istioctl istioctl } variant kpt description {Add kpt} { dict set variant_to_component kpt kpt } variant kubectl description {Add kubectl} { dict set variant_to_component kubectl kubectl } variant kubectl_oidc description {Add kubectl-oidc} { dict set variant_to_component kubectl_oidc kubectl-oidc } variant kustomize description {Add Kustomize} { dict set variant_to_component kustomize kustomize } variant local_extract description {Add On-Demand Scanning API extraction helper} { dict set variant_to_component local_extract local-extract } variant log_streaming description {Add Log Streaming} { dict set variant_to_component log_streaming log-streaming } variant managed_flink_client description {Add managed Flink client} { dict set variant_to_component managed_flink_client managed-flink-client } variant minikube description {Add Minikube} { dict set variant_to_component minikube minikube } variant nomos description {Add Nomos CLI} { dict set variant_to_component nomos nomos } variant package_go_module description {Add Artifact Registry Go Module Package Helper} { dict set variant_to_component package_go_module package-go-module } variant pkg description {Add pkg} { dict set variant_to_component pkg pkg } variant pubsub_emulator description {Add Cloud Pub/Sub Emulator} { dict set variant_to_component pubsub_emulator pubsub-emulator } variant skaffold description {Add Skaffold} { dict set variant_to_component skaffold skaffold } variant terraform_tools description {Add Terraform Tools} { dict set variant_to_component terraform_tools terraform-tools } patch { set install_command "CLOUDSDK_CONFIG=${worksrcpath}/.config CLOUDSDK_PYTHON=${python.bin} ./install.sh \ --usage-reporting false \ --command-completion false \ --path-update false \ --quiet \ --install-python false" set additional_components {} foreach component_variant [dict keys ${variant_to_component}] { if {[variant_isset ${component_variant}]} { lappend additional_components [dict get ${variant_to_component} ${component_variant}] } } if { [llength ${additional_components}] > 0 } { append install_command " --additional-components" foreach additional_component ${additional_components} { append install_command " " ${additional_component} } } system -W ${worksrcpath} ${install_command} } test.run yes test.cmd bin/gcloud test.target test.args version destroot { set libexecdir ${destroot}${prefix}/libexec/${name} xinstall -d ${libexecdir} copy \ ${worksrcpath}/.install \ ${worksrcpath}/bin \ ${worksrcpath}/lib \ ${worksrcpath}/platform \ ${libexecdir} foreach f { anthoscli bq docker-credential-gcloud gcloud gsutil } { ln -s ../libexec/${name}/bin/${f} ${destroot}${prefix}/bin/${f} } ln -s ../libexec/${name}/bin/git-credential-gcloud.sh ${destroot}${prefix}/bin/git-credential-gcloud # bash completion set bash_completions_path ${prefix}/etc/bash_completion.d xinstall -d ${destroot}${bash_completions_path} xinstall -m 644 ${worksrcpath}/completion.bash.inc ${destroot}${bash_completions_path}/google-cloud-sdk # zsh completion set gcloud_libexec ${destroot}${prefix}/libexec/google-cloud-sdk xinstall -m 644 ${worksrcpath}/completion.zsh.inc ${gcloud_libexec} } notes " google-cloud-sdk zsh completions aren't loaded automatically. You must source them manually in your .zshrc: source '${prefix}/libexec/google-cloud-sdk/completion.zsh.inc'" livecheck.url https://cloud.google.com/sdk/docs/install-sdk livecheck.regex {google-cloud-cli-([\d\.]+)-darwin}