# -*- 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 502.0.0 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 b614224ee9d01c484a561e5e42f5c147564ec3bd \ sha256 64b69f1948e53cf84333f38b4f8dd6dc41c6ec726380ceb080c4880aac93a009 \ size 52593724 } elseif { ${configure.build_arch} eq "x86_64" } { distname ${name}-${version}-darwin-x86_64 checksums rmd160 472c2ee8983cc8ab7665093ce589787e1df9cce1 \ sha256 9d8543f742cd02b50e3a7553495b9dfcdb6c6b690b4e02c7c73f85780cc3d330 \ size 53943066 } elseif { ${configure.build_arch} eq "arm64" } { distname ${name}-${version}-darwin-arm checksums rmd160 1598fd5451b470f24236802262b68555e9122081 \ sha256 903b01237a2147f0bc550109a1085d6d713e9803374faa8fcd3f7a0ed81581e5 \ size 53889708 } homepage https://cloud.google.com/sdk/ master_sites https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/ worksrcdir ${name} # Most recent supported Python version according to both # https://cloud.google.com/sdk/docs/install#mac and # https://cloud.google.com/storage/docs/gsutil_install#specifications python.default_version 311 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}