260 lines
5.0 KiB
Plaintext

# Contributor: Holger Jaekel <holger.jaekel@gmx.de>
# Maintainer: Holger Jaekel <holger.jaekel@gmx.de>
pkgname=google-cloud-cpp
pkgver=2.8.0
_googleapis_commit_sha="b6b4ed5d7ebdfc0ff8855311bd63ba258b94ae2b"
pkgrel=2
pkgdesc="C++ Client Libraries for Google Cloud Services"
url="https://cloud.google.com/sdk"
arch="all"
license="Apache-2.0"
makedepends="
abseil-cpp-dev
c-ares-dev
cmake
crc32c-dev
curl-dev
grpc-dev
nlohmann-json
openssl-dev
protobuf-dev
re2-dev
samurai
"
checkdepends="benchmark-dev gtest-dev"
subpackages="$pkgname-dev"
source="google-cloud-cpp-$pkgver.tar.gz::https://github.com/googleapis/google-cloud-cpp/archive/refs/tags/v$pkgver.tar.gz
https://github.com/googleapis/googleapis/archive/$_googleapis_commit_sha.tar.gz
"
_ga_library="
accessapproval
accesscontextmanager
advisorynotifications
alloydb
apigateway
apigeeconnect
appengine
artifactregistry
asset
assuredworkloads
automl
baremetalsolution
beyondcorp
bigquery
bigtable
billing
binaryauthorization
certificatemanager
channel
cloudbuild
composer
connectors
contactcenterinsights
containeranalysis
container
datacatalog
datamigration
dataplex
dataproc
datastream
debugger
deploy
dialogflow_cx
dialogflow_es
dlp
documentai
edgecontainer
eventarc
filestore
functions
gameservices
gkehub
gkemulticloud
iam
iap
ids
iot
kms
language
logging
managedidentities
memcache
monitoring
networkconnectivity
networkmanagement
notebooks
optimization
orgpolicy
osconfig
oslogin
policytroubleshooter
privateca
profiler
pubsub
recommender
redis
resourcemanager
resourcesettings
retail
run
scheduler
secretmanager
securitycenter
servicecontrol
servicedirectory
servicemanagement
serviceusage
shell
spanner
speech
storagetransfer
storage
talent
tasks
texttospeech
tpu
trace
translate
videointelligence
video
vision
vmmigration
vmwareengine
vpcaccess
webrisk
websecurityscanner
workflows
"
_non_ga_library="
apikeys
batch-protos
batch
cloud-bigquery-protos
cloud-common-common-protos
cloud-dialogflow-v2-protos
cloud-speech-protos
cloud-texttospeech-protos
devtools-cloudtrace-v2-trace-protos
devtools-cloudtrace-v2-tracing-protos
devtools-source-v1-source-context-protos
grafeas-protos
grpc-utils
longrunning-operations-protos
rest-internal
rest-protobuf-internal
rpc-code-protos
rpc-error-details-protos
rpc-status-protos
"
_api_protos="
api-annotations
api-auth
api-backend
api-billing
api-client
api-config-change
api-consumer
api-context
api-control
api-distribution
api-documentation
api-endpoint
api-error-reason
api-field-behavior
api-httpbody
api-http
api-label
api-launch-stage
api-logging
api-log
api-metric
api-monitored-resource
api-monitoring
api-quota
api-resource
api-routing
api-service
api-source-info
api-system-parameter
api-usage
api-visibility
"
_type_protos="
type-calendar-period
type-color
type-datetime
type-date
type-dayofweek
type-decimal
type-expr
type-fraction
type-interval
type-latlng
type-localized-text
type-money
type-month
type-phone-number
type-postal-address
type-quaternion
type-timeofday
"
for _lib in $_ga_library $_non_ga_library $_api_protos $_type_protos ; do
subpackages="$subpackages $pkgname-$_lib:library"
done
prepare() {
default_prepare
# google-cloud-cpp needs the proto and gRPC definitions for most
# Google Cloud services. By default these definitions are downloaded
# from GitHub during the build process. Using the same SHA is the
# recommended practice when the googleapis are downloaded outside the
# build process. In this APKBUILD, we download the googleapis as an
# additional source. In that case we have to make sure that the SHA
# match.
local sha256=$(awk '/_GOOGLE_CLOUD_CPP_GOOGLEAPIS_SHA256/ { getline; print $0 }' $builddir/cmake/GoogleapisConfig.cmake | tr -d '") ')
echo "$sha256 *$srcdir/$_googleapis_commit_sha.tar.gz" | sha256sum -c -
}
build() {
if [ "$CBUILD" != "$CHOST" ]; then
CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
fi
cmake -B build -G Ninja \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_INSTALL_LIBDIR=lib \
-DBUILD_SHARED_LIBS=True \
-DCMAKE_BUILD_TYPE=None \
-DBUILD_TESTING="$(want_check && echo ON || echo OFF)" \
-DGOOGLE_CLOUD_CPP_ENABLE_EXAMPLES=OFF \
-DGOOGLE_CLOUD_CPP_ENABLE=__ga_libraries__ \
-DGOOGLE_CLOUD_CPP_OVERRIDE_GOOGLEAPIS_URL=$srcdir/googleapis-$_googleapis_commit_sha \
$CMAKE_CROSSOPTS .
cmake --build build
}
check() {
cd build
CTEST_OUTPUT_ON_FAILURE=TRUE ctest -LE "integration-test"
}
package() {
DESTDIR="$pkgdir" cmake --install build
}
library() {
local name=${subpkgname#"$pkgname"-}
pkgdesc="$pkgdesc ($name)"
amove usr/lib/libgoogle_cloud_cpp_${name//-/_}*
}
sha512sums="
d764793c66e06afc9a91622ec32808088b2a0cfedac7876682caded967a06f9f8b0dbebe9dadd36cf75350027dcd1aeed631072d4b8610f1793caf49c2f50f1c google-cloud-cpp-2.8.0.tar.gz
93705c7d6705b8246bb880ef9f90be4f417cf316e6784cfabdac906386439d249c9d2af665b77618e358a861e3db657e08324b71d17451306ca6cb515cd26972 b6b4ed5d7ebdfc0ff8855311bd63ba258b94ae2b.tar.gz
"