+# Copyright © 2022 Nick Bowler
+# License GPLv3+: GNU General Public License version 3 or any later version.
+# This is free software: you are free to change and redistribute it.
+# There is NO WARRANTY, to the extent permitted by law.
+
+EAPI=8
+
+PYTHON_COMPAT=(python3_10)
+
+inherit python-r1
+
+DESCRIPTION="Software for accessing Google cloud services"
+HOMEPAGE="https://cloud.google.com/"
+SRC_URI="amd64? ( https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/$P-linux-x86_64.tar.gz )"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64"
+REQUIRED_USE=$PYTHON_REQUIRED_USE
+
+S=$WORKDIR/$PN
+
+DEPEND="$PYTHON_DEPS
+ !dev-python/oauth2client:0
+ !dev-python/google-apitools:0"
+
+RDEPEND="$DEPEND
+ <dev-python/prompt_toolkit-2[$PYTHON_USEDEP]
+ dev-python/argcomplete[$PYTHON_USEDEP]
+ dev-python/dnspython[$PYTHON_USEDEP]
+ dev-python/google-auth-httplib2[$PYTHON_USEDEP]
+ dev-python/google-auth-oauthlib[$PYTHON_USEDEP]
+ dev-python/ipaddr[$PYTHON_USEDEP]
+ dev-python/jsonschema[$PYTHON_USEDEP]
+ dev-python/portpicker[$PYTHON_USEDEP]
+ dev-python/proto-plus[$PYTHON_USEDEP]
+ dev-python/pyu2f[$PYTHON_USEDEP]
+ dev-python/ruamel-yaml[$PYTHON_USEDEP]
+ dev-python/six[$PYTHON_USEDEP]
+ dev-python/uritemplate[$PYTHON_USEDEP]
+ dev-python/websocket-client[$PYTHON_USEDEP]"
+
+PDEPEND="dev-python/oauth2client:proxy
+ dev-python/google-apitools:proxy"
+
+PDEPEND="dev-python/oauth2client:proxy
+ dev-python/google-apitools:proxy"
+
+python_install () {
+ gcs_modules=(core calliope api_lib command_lib generated_clients *.py)
+
+ python_domodule lib/third_party/apitools lib/third_party/oauth2client
+ python_domodule lib/surface
+
+ python_moduleinto googlecloudsdk
+ python_domodule ${gcs_modules[@]/#/"lib/googlecloudsdk/"}
+
+ python_newscript lib/gcloud.py gcloud
+}
+
+src_install () {
+ default
+
+ python_foreach_impl python_install
+}