Skip to the text
KDOS
Menu
kdos.dev KDOS from Scratch KDOS 0.2 · 4dd4a10 · 2026-11-30 Contents Index

127.13. libphonenumber-9.0.42

Google's library for parsing, formatting and validating international phone numbers (C++)

9.0.42-1 · Apache-2.0 AND BSD-3-Clause · 0.3 SBU · 1.3 MiB, 41 files · 41_system, 683 of 1047 · ports/core/i18n/libphonenumber

Homepage: https://github.com/google/libphonenumber

libphonenumber is Google’s library for parsing, formatting and validating international phone numbers, with the per-country metadata compiled in. This port builds the C++ library alone, from the cpp/ directory of a source tree that also holds the Java and JavaScript versions. Its consumer is kitinerary, which finds it through the CMake package libphonenumber and links libphonenumber::phonenumber-shared to read phone numbers out of booking confirmations.

Depends on: cmake, ninja, protobuf, abseil-cpp, icu.

Required by (1): kitinerary.

Sources: libphonenumber-9.0.42.tar.gz (12.4 MiB). Every step kpkg takes applies to this port.

Install: script/chroot/exec.sh bash -c 'source script/phases/41_system/phase.env && kpkg install libphonenumber'

build.sh:

cmake -S cpp -B build -G Ninja \
	-D CMAKE_INSTALL_PREFIX=/usr \
	-D CMAKE_INSTALL_LIBDIR=lib \
	-D CMAKE_BUILD_TYPE=Release \
	-D BUILD_TESTING=OFF \
	-D BUILD_GEOCODER=OFF \
	-D REGENERATE_METADATA=OFF \
	-D BUILD_STATIC_LIB=OFF \
	-D USE_BOOST=OFF \
	-D USE_STDMUTEX=ON \
	-D CMAKE_REQUIRE_FIND_PACKAGE_absl=ON \
	-Wno-dev
cmake --build build
DESTDIR=$PKG cmake --install build

Libraries: libphonenumber.so.

Directories: /usr/include/phonenumbers, /usr/lib/cmake/libphonenumber, /usr/share/licenses/libphonenumber.

protoc from protobuf generates phonemetadata.pb.cc and phonenumber.pb.cc during the build, and the installed headers include protobuf’s and Abseil’s, so both stay in depends for every consumer. The installed libphonenumber-config.cmake calls find_dependency(absl) and find_dependency(Protobuf) for the same reason. ICU’s icuuc and icui18n from icu are found with find_library and are required.

LICENSE.Chromium covers the few files under cpp/src/phonenumbers/base/ taken from Chromium (BSD-3-Clause); kpkg copies it with LICENSE.