2025-11-14 16:04:52 +01:00

408 lines
8.9 KiB
Plaintext

# Contributor: Holger Jaekel <holger.jaekel@gmx.de>
maintainer="Holger Jaekel <holger.jaekel@gmx.de>"
pkgname=google-cloud-cpp
pkgver=2.43.0
_googleapis_commit_sha=2193a2bfcecb92b92aad7a4d81baa428cafd7dfd
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
clang
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
fix-interval-negation-overflow.patch
"
_ga_library="
accessapproval
accesscontextmanager
advisorynotifications
aiplatform
alloydb
apigateway
apigeeconnect
apikeys
appengine
apphub
artifactregistry
asset
assuredworkloads
automl
backupdr
baremetalsolution
batch
beyondcorp
bigquery
bigquerycontrol
bigtable
billing
binaryauthorization
certificatemanager
channel
chronicle
cloudbuild
cloudcontrolspartner
cloudquotas
cloudsecuritycompliance
commerce
composer
compute_accelerator_types
compute_addresses
compute_autoscalers
compute_backend_buckets
compute_backend_services
compute_disk_types
compute_disks
compute_external_vpn_gateways
compute_firewall_policies
compute_firewalls
compute_forwarding_rules
compute_global_addresses
compute_global_forwarding_rules
compute_global_network_endpoint_groups
compute_global_operations
compute_global_organization_operations
compute_global_public_delegated_prefixes
compute_health_checks
compute_http_health_checks
compute_https_health_checks
compute_image_family_views
compute_images
compute_instance_group_managers
compute_instance_groups
compute_instance_templates
compute_instances
compute_interconnect_attachments
compute_interconnect_locations
compute_interconnects
compute_license_codes
compute_licenses
compute_machine_images
compute_machine_types
compute_network_attachments
compute_network_edge_security_services
compute_network_endpoint_groups
compute_network_firewall_policies
compute_networks
compute_node_groups
compute_node_templates
compute_node_types
compute_packet_mirrorings
compute_projects
compute_public_advertised_prefixes
compute_public_delegated_prefixes
compute_region_autoscalers
compute_region_backend_services
compute_region_commitments
compute_region_disk_types
compute_region_disks
compute_region_health_check_services
compute_region_health_checks
compute_region_instance_group_managers
compute_region_instance_groups
compute_region_instance_templates
compute_region_instances
compute_region_network_endpoint_groups
compute_region_network_firewall_policies
compute_region_notification_endpoints
compute_region_operations
compute_region_security_policies
compute_region_ssl_certificates
compute_ssl_policies
compute_subnetworks
compute_target_grpc_proxies
compute_target_http_proxies
compute_target_https_proxies
compute_target_instances
compute_target_pools
compute_target_ssl_proxies
compute_target_tcp_proxies
compute_target_vpn_gateways
compute_url_maps
compute_vpn_gateways
compute_vpn_tunnels
compute_zone_operations
compute_zones
confidentialcomputing
config
configdelivery
connectors
contactcenterinsights
containeranalysis
container
contentwarehouse
datacatalog
dataform
datafusion
datamigration
dataplex
dataproc
datastore
datastream
deploy
developerconnect
devicestreaming
dialogflow_cx
dialogflow_es
discoveryengine
dlp
documentai
domains
edgecontainer
edgenetwork
essentialcontacts
eventarc
filestore
financialservices
functions
gkebackup
gkeconnect
gkehub
gkemulticloud
iam
iap
ids
kms
language
licensemanager
logging
lustre
managedidentities
managedkafka
memcache
memorystore
metastore
migrationcenter
monitoring
netapp
networkconnectivity
networkmanagement
networksecurity
networkservices
notebooks
oauth2
optimization
oracledatabase
orgpolicy
osconfig
oslogin
parallelstore
parametermanager
policysimulator
policytroubleshooter
privateca
privilegedaccessmanager
profiler
publicca
pubsub
rapidmigrationassessment
recaptchaenterprise
recommender
redis
resourcemanager
retail
run
scheduler
secretmanager
securesourcemanager
securitycenter
securitycentermanagement
servicecontrol
servicedirectory
servicehealth
servicemanagement
serviceusage
shell
spanner
speech
sql
storagebatchoperations
storagecontrol
storageinsights
storagetransfer
storage
support
talent
tasks
telcoautomation
texttospeech
timeseriesinsights
tpu
trace
translate
videointelligence
video
vision
vmmigration
vmwareengine
vpcaccess
webrisk
websecurityscanner
workflows
workstations
"
_non_ga_library="
cloud_location_locations-protos
cloud-common-common-protos
cloud-extended-operations-protos
cloud-orgpolicy-v1-orgpolicy-protos
grafeas-protos
grpc-utils
longrunning-operations-protos
rest-internal
rest-protobuf-internal
rpc-code-protos
rpc-context-attribute-context-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-field-info
api-httpbody
api-http
api-label
api-launch-stage
api-logging
api-log
api-metric
api-monitored-resource
api-monitoring
api-policy
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 }' cmake/GoogleapisConfig.cmake | tr -d '") ')
echo "expected sha: $sha256"
echo "$sha256 *$srcdir/$_googleapis_commit_sha.tar.gz" | sha256sum -c -
}
build() {
if [ "$CBUILD" != "$CHOST" ]; then
local crossopts="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
fi
LDFLAGS="$LDFLAGS -Wl,--copy-dt-needed-entries" \
cmake -B build -G Ninja -Wno-dev \
-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 \
$crossopts
cmake --build build
}
check() {
cd build
timeout 1500 \
ctest -LE "integration-test"
}
package() {
DESTDIR="$pkgdir" cmake --install build
}
library() {
local name=${subpkgname#"$pkgname"-}
pkgdesc="$pkgdesc ($name)"
local libname=${name//-/_}
case "$name" in
api-*|type-*)
# API/type proto libraries: subpackage name like "api-annotations"
# maps to library file "libgoogle_cloud_cpp_api_annotations_protos.so"
amove usr/lib/libgoogle_cloud_cpp_${libname}_protos.so*
;;
*-protos)
# Non-GA proto libraries: subpackage name like "rpc-status-protos"
# maps directly to library file "libgoogle_cloud_cpp_rpc_status_protos.so"
amove usr/lib/libgoogle_cloud_cpp_${libname}.so*
;;
*)
# GA libraries: move main library and optional proto variant
# e.g., "bigquery" -> libgoogle_cloud_cpp_bigquery.so + libgoogle_cloud_cpp_bigquery_protos.so
# Some libraries (like compute_*) have no proto variant, so second pattern may not match
amove usr/lib/libgoogle_cloud_cpp_${libname}.so*
amove usr/lib/libgoogle_cloud_cpp_${libname}_*.so* 2>/dev/null || true
;;
esac
}
sha512sums="
50f3b303538ef3c825638569c87b42de2df5b2ba6cec4700afd6aaf3e3cae1e59a807343e79e27bb4230a085a31d5fd7ef426576981520e7103ed2ee1eead4bc google-cloud-cpp-2.43.0.tar.gz
b31eef14f4e12c1dedbde6e4724ff3a5d2fa04853851f89a5935286e2eb45169d1b68c2ef7dbf83022367875b1d18cf26a4e80deb326689803065f36e08e3819 2193a2bfcecb92b92aad7a4d81baa428cafd7dfd.tar.gz
bc6289e3a036bfcdd84ed92daef428c6167eba842af379b8e11ed9d51ee0995b6e09ab0e918d8fdbe2965ac66c45cd23f46dd8ef96ec5d455d83fb019a495ddc fix-interval-negation-overflow.patch
"