Name libphonenumber
Description Google's common library for parsing, formatting, and validating international phone numbers
Version 1:9.0.24-1
Package Base libphonenumber
Homepage https://github.com/googlei18n/libphonenumber
Maintainers ['Jan Alexander Steffens (heftig) <heftig@archlinux.org>']
Contributors []
Distro-repo https://gitlab.archlinux.org/archlinux/packaging/packages/libphonenumber
Sources ['0001-Use-find_package-for-protobuf.patch', '0002-Remove-Werror.patch', '0003-Fix-BUILD_STATIC_LIB-OFF.patch', 'git+https://github.com/googlei18n/libphonenumber#tag=v9.0.24']
Dependencies ['abseil-cpp', 'glibc', 'icu', 'libgcc', 'libicui18n.so', 'libicuuc.so', 'libprotobuf.so', 'libstdc++', 'protobuf']
Optional-Dependencies []
Build-Dependencies ['cmake', 'git', 'gtest', 'jre-openjdk-headless']
Provides ['libgeocoding.so', 'libphonenumber.so']
Builddate 12-02-2026 17:59:11
Architecture x86_64
Distro-Version
Licenses ['Apache-2.0 AND BSD-3-Clause']
Hash 22bb79a7781b8498df8183010850bb07a3180c10be9e04025c73baa80fdeeadb
# Maintainer: Jan Alexander Steffens (heftig) <heftig@archlinux.org>

pkgname=libphonenumber
pkgver=9.0.24
pkgrel=1
epoch=1
pkgdesc="Google's common library for parsing, formatting, and validating international phone numbers"
url="https://github.com/googlei18n/libphonenumber"
arch=(x86_64)
license=('Apache-2.0 AND BSD-3-Clause')
depends=(
  abseil-cpp
  glibc
  icu
  libgcc
  libstdc++
  protobuf
)
makedepends=(
  cmake
  git
  gtest
  jre-openjdk-headless
)
source=(
  "git+$url#tag=v$pkgver"
  0001-Use-find_package-for-protobuf.patch
  0002-Remove-Werror.patch
  0003-Fix-BUILD_STATIC_LIB-OFF.patch
)
b2sums=('4acc9c6e669e74c682ff709eb59cdc3dbea6a82c8304c3b66b99187cb96110818b9b6988d9e12a9adc82bfa56b7e393e82973d3c4994b22cbf866031730d25ef'
        '44be662cd62d87f4f0ceedc7c98cf4dedd1428bc5792288a4a861022e31a03a231b513bde125a95437871e69d3f7aba08db17b601dd6806b502cfe03bfda2f4b'
        '24854002196053b9758705b251a6dc2763fa6db5055c2b8ee0c7bd6a0adcb64eecab7f03ebec4fade42c4f19671e85ee4ca6450c13a9581118705c983f5d3a00'
        'c30bd9cc785319794360b37713f9241e59ef54d3d4742c114342b05d10ed71d062945eba4bb2613903890892dca61020dc36bef8c8adb5a0fb32939718e8669c')

prepare() {
  cd $pkgname

  # Use official protobuf cmake target instead of
  # custom one, fixes build with protobuf 23
  git apply -3 ../0001-Use-find_package-for-protobuf.patch

  # Don't use -Werror; fixes build with GCC 15
  git apply -3 ../0002-Remove-Werror.patch

  # Fix building test with BUILD_STATIC_LIB=OFF
  git apply -3 ../0003-Fix-BUILD_STATIC_LIB-OFF.patch
}

build() {
  local cmake_options=(
    -D BUILD_STATIC_LIB=OFF
    -D CMAKE_BUILD_TYPE=None
    -D CMAKE_CXX_STANDARD=17
    -D CMAKE_INSTALL_PREFIX=/usr
    -D USE_BOOST=OFF
    -D USE_STDMUTEX=ON
  )

  cmake -S $pkgname/cpp -B build "${cmake_options[@]}"
  cmake --build build
}

check() {
  cmake --build build --target tests
}

package() {
  depends+=(
    libicu{uc,i18n}.so
    libprotobuf.so
  )
  provides+=(
    libgeocoding.so
    libphonenumber.so
  )

  DESTDIR="$pkgdir" cmake --install build

  install -Dt "$pkgdir/usr/share/licenses/$pkgname" -m644 $pkgname/LICENSE.Chromium
}

# vim:set sw=2 sts=-1 et: