Package Details: google-cloud-cli 522.0.0-1

Git Clone URL: https://aur.archlinux.org/google-cloud-cli.git (read-only, click to copy)
Package Base: google-cloud-cli
Description: A set of command-line tools for the Google Cloud Platform. Includes gcloud (with beta and alpha commands), gsutil, and bq.
Upstream URL: https://cloud.google.com/cli/
Keywords: cloud gcloud gcp google sdk
Licenses: Apache-2.0
Conflicts: google-cloud-sdk
Provides: google-cloud-sdk
Replaces: google-cloud-sdk
Submitter: PolarianDev
Maintainer: jvybihal
Last Packager: jvybihal
Votes: 190
Popularity: 0.30
First Submitted: 2023-03-08 09:33 (UTC)
Last Updated: 2025-05-14 17:16 (UTC)

Dependencies (2)

Required by (14)

Sources (5)

Pinned Comments

Latest Comments

1 2 3 4 5 6 .. 32 Next › Last »

tobbik commented on 2025-05-08 23:01 (UTC)

No problem @jvybihal. I currently daily driving a Thinkpad x13s with archlinux and using gcloud in my job. I'll let you know if stuff fails.

jvybihal commented on 2025-05-07 08:55 (UTC)

Thanks @tobbik, I have added your changes. I do not have aarch64 myself, so I was not inclined to add that and test it. But if there is a demand I see no reason to avoid it.

tobbik commented on 2025-05-05 16:39 (UTC)

I don't know if there is an appetite for this, but I'm using this on an aarch64 machine and reworked the PKGBUILD so it can support both architectures. The changes are minimal and straight forward and shouldn't be hard to maintain:

# Maintainer: Josef Vybíhal <josef.vybihal@gmail.com>
# Contributor: Polarian <polarian@polarian.dev>
# Contributor: Benjamin Denhartog <ben@sudoforge.com>
# Contributor: Mansour Behabadi <mansour@oxplot.com>
# Contributor: Troy Engel <troyengel+arch@gmail.com>
# Contributor: Geoff Hill <geoff@geoffhill.org>
# Contributor: Sebastien Bariteau <numkem@numkem.org>
# Contributor: Justin Dray <justin@dray.be>

#  shellcheck disable=SC2034

# Release Notes: https://cloud.google.com/sdk/docs/release-notes
# Cloud Storage Bucket: https://console.cloud.google.com/storage/browser/cloud-sdk-release/for_packagers/linux
# deb pool: 
#  - https://packages.cloud.google.com/apt/dists/cloud-sdk/main/binary-amd64/Packages
#  - https://packages.cloud.google.com/apt/pool/cloud-sdk/google-cloud-cli_516.0.0-0_amd64_e19fae4ce840c378a624e2cbdba2aa87.deb

_extractedName="google-cloud-sdk"
pkgname="google-cloud-cli"
pkgver=520.0.0
pkgrel=1
pkgdesc="A set of command-line tools for the Google Cloud Platform. Includes gcloud (with beta and alpha commands), gsutil, and bq."
url="https://cloud.google.com/cli/"
license=('Apache-2.0')
arch=('x86_64' 'aarch64')
depends=('python')

optdepends=(
  "python-crcmod: [gsutil] verify the integrity of GCS object contents"
)
options=('!strip' 'staticlibs' !zipman)

# Python 3.13 is not officialy supported yet, force use of bundled 3.12
export _force_budled_python=true

# TODO:
#  - packages for components
source=(
  "$pkgname.sh"
  "$pkgname.install"
  "0003-add-compdef-to-zsh-completion.patch"
)
source_x86_64=($pkgname-$pkgver.orig_x86_64.tar.gz::https://dl.google.com/dl/cloudsdk/release/downloads/for_packagers/linux/${pkgname}_${pkgver}.orig_amd64.tar.gz)
source_aarch64=($pkgname-$pkgver.orig_aarch64.tar.gz::https://dl.google.com/dl/cloudsdk/release/downloads/for_packagers/linux/${pkgname}_${pkgver}.orig_aarch64.tar.gz)

install=$pkgname.install

# Conflict the old package name to force migration
conflicts=('google-cloud-sdk')
provides=('google-cloud-sdk')
replaces=('google-cloud-sdk')

sha256sums=('6e88b535c020b0f28c986fdb66918f8c07e4d337e813b77ec2068068f03457f8'
            'fdba342aecce102b85fd96f21205d7ee2f8043b4bb56cabf363375785e3d423c'
            'c19dbe916e6fd18d9b17b3309ee60c5d389035c5520822d2c14c045d8b853924')
sha256sums_x86_64=('8e467fe2a022e7ca2a54ce00368a6a7e7ad96f48b0a2724b48a869162a0ce400')
sha256sums_aarch64=('c6e9fb262dcb8ec032f63d20f690fd0e42b936f195865a8ce88ad7fb32438f06')

backup=(etc/profile.d/google-cloud-cli.sh)

prepare() {
  cd "${_extractedName}"
  for f in "${source[@]}"; do
    [[ "$f" =~ \.patch$ ]] && \
    ( \
      patch -p1 -i "${srcdir}/${f}" > /dev/null 2>&1 ||\
      ( \
        echo "failed to apply patch: $(basename ${f})" && \
        exit 1 \
      ) \
    )
  done
}

package() {
  _install_path="${pkgdir}/opt/${pkgname}"
  _bundled_py_bin="${_install_path:${#pkgdir}}/platform/bundledpythonunix/bin/python3"

  mkdir "${pkgdir}/opt"
  cp -r "${_extractedName}" "${_install_path}"

  # The Google code uses a _TraceAction() method which spams the screen even
  # in "quiet" mode, we're throwing away output on purpose to keep it clean
  #  ref: lib/googlecloudsdk/core/platforms_install.py
  "${_install_path}/install.sh" \
    --quiet \
    --usage-reporting false \
    --path-update false \
    --bash-completion false \
    > /dev/null 2>&1

  find $pkgdir -name '__pycache__' -type d -exec rm -rf {} +

  install -D -m 0755 "${srcdir}/${source[1]}" \
    "${pkgdir}/etc/profile.d/google-cloud-cli.sh"

  if [ "$_force_budled_python" = true ]; then
    { echo "export CLOUDSDK_PYTHON=${_bundled_py_bin}"
      echo "export CLOUDSDK_GSUTIL_PYTHON=${_bundled_py_bin}"
      echo "export CLOUDSDK_BQ_PYTHON=${_bundled_py_bin}"
    } >> "${pkgdir}/etc/profile.d/google-cloud-cli.sh"
  fi

  install -d -m 0755 \
    "${pkgdir}/etc/bash_completion.d" \
    "${pkgdir}/usr/share/zsh/site-functions" \

  ln -rsT "${_install_path}/completion.bash.inc" \
    "${pkgdir}/etc/bash_completion.d/google-cloud-cli"

  for cmd in gcloud gsutil bq; do
    ln -rsT "${_install_path}/completion.zsh.inc" \
      "${pkgdir}/usr/share/zsh/site-functions/_${cmd}"
  done

  mkdir -p "${pkgdir}/usr/bin"
  for bin in gcloud \
             gcloud-crc32c \
             gsutil \
             docker-credential-gcloud \
             git-credential-gcloud.sh \
             bq; do
    ln -rsT "${_install_path}/bin/${bin}" \
      "${pkgdir}/usr/bin/${bin}"
  done

  mkdir -p "${pkgdir}/usr/share"
  mv -f "${pkgdir}/opt/${pkgname}/help/man" "${pkgdir}/usr/share/"
}

lexlapax commented on 2025-05-03 05:15 (UTC)

yes. it does take several minutes for me as well,

Traneptora commented on 2025-04-30 20:34 (UTC)

For some reason this package takes an exceptionally long time to build and install for me. On "Copying source files needed for debug symbols..." it takes several minutes. Is this true for anyone else?

jvybihal commented on 2025-03-27 11:11 (UTC) (edited on 2025-03-27 11:11 (UTC) by jvybihal)

In the last commit I have addressed last commments here. Hopefuly without breaking anyones workflow. You should not need to adjust PATH anymore, and bundled python is used by default now (adjustable).

tetamusha commented on 2025-03-24 22:04 (UTC)

For those struggling with the error Error: gsutil requires Python version 3.8-3.12, but a different version is installed. even though you are using a compatible Python version, one solution is to edit or comment out the declaration of CLOUDSDK_PYTHON on /etc/profile.d/google-cloud-cli.sh to use whatever Python executable you point to or is active on your environment.

sirianni commented on 2025-03-20 15:05 (UTC) (edited on 2025-03-20 15:06 (UTC) by sirianni)

Why is this package explicitly setting these profile variables?

export CLOUDSDK_PYTHON=/usr/bin/python
export CLOUDSDK_PYTHON_ARGS='-S -W ignore'

This breaks usage of tools like gsutil that require an older python. Since the gcloud CLI packages its own python, we should just let the tools use that instead of forcing the system version.

jvybihal commented on 2025-03-19 11:28 (UTC)

@Segaja i don't know the reason, if there is any. I adopted the package like this and never bothered thinking about it. I get your point and I agree, seems logical to add symlink to bin. Debian package does that. When I get a chance (more time) i will inspect the PKGBUILD for improvements. Patches are always welcome.

Segaja commented on 2025-03-18 07:55 (UTC)

Is there a specific reason why this package is not putting the actual binary into /bin which is in the PATH?

Right now I need to have a line like this in my .zshrc to have easy access to the binary:

export PATH="/opt/google-cloud-cli/bin:${PATH}"