Files
haikuports/dev-libs/libphonenumber/libphonenumber-9.0.25.recipe
2026-03-06 10:58:14 +01:00

99 lines
2.8 KiB
Bash

SUMMARY="Library for parsing, formatting, and validating international phone numbers"
DESCRIPTION="Google's common Java, C++ and JavaScript library for parsing, formatting, and validating \
international phone numbers. The Java version is optimized for running on smartphones, and is used by \
the Android framework since 4.0 (Ice Cream Sandwich)."
HOMEPAGE="https://github.com/google/libphonenumber"
COPYRIGHT="2014 The Chromium Authors"
LICENSE="Apache v2"
REVISION="1"
SOURCE_URI="https://github.com/google/libphonenumber/archive/refs/tags/v$portVersion.tar.gz"
CHECKSUM_SHA256="de4cfebe1e1da4ecfb687c7bdf312d93b37548737f5e52444d2d29d0b36d2512"
PATCHES="libphonenumber-$portVersion.patchset"
ARCHITECTURES="all !x86_gcc2"
SECONDARY_ARCHITECTURES="x86"
libVersion="9.0"
libVersionCompat="$libVersion compat >= ${libVersion%.*}"
PROVIDES="
libphonenumber$secondaryArchSuffix = $portVersion
lib:libgeocoding$secondaryArchSuffix = $libVersionCompat
lib:libphonenumber$secondaryArchSuffix = $libVersionCompat
"
REQUIRES="
haiku$secondaryArchSuffix
lib:libabsl_base$secondaryArchSuffix # don't list all abseil libraries
lib:libboost_date_time$secondaryArchSuffix
lib:libboost_thread$secondaryArchSuffix
lib:libgtest$secondaryArchSuffix
lib:libicuuc$secondaryArchSuffix
lib:libicui18n$secondaryArchSuffix
lib:libprotobuf$secondaryArchSuffix
"
PROVIDES_devel="
libphonenumber${secondaryArchSuffix}_devel = $portVersion
devel:libgeocoding$secondaryArchSuffix = $libVersionCompat
devel:libphonenumber$secondaryArchSuffix = $libVersionCompat
"
REQUIRES_devel="
libphonenumber$secondaryArchSuffix == $portVersion base
devel:libboost_date_time$secondaryArchSuffix
devel:libabsl_base$secondaryArchSuffix
devel:libprotobuf$secondaryArchSuffix
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
devel:libabsl_base$secondaryArchSuffix >= 2301.0.0
devel:libboost_date_time$secondaryArchSuffix >= 1.90.0
devel:libboost_thread$secondaryArchSuffix >= 1.90.0
devel:libgtest$secondaryArchSuffix
devel:libicuuc$secondaryArchSuffix >= 74
devel:libicui18n$secondaryArchSuffix >= 74
devel:libprotobuf$secondaryArchSuffix >= 31
"
BUILD_PREREQUIRES="
cmd:cmake
cmd:gcc$secondaryArchSuffix
cmd:javac
cmd:make
cmd:pkg_config$secondaryArchSuffix
"
defineDebugInfoPackage libphonenumber$secondaryArchSuffix \
"$libDir"/libgeocoding.so.$libVersion \
"$libDir"/libphonenumber.so.$libVersion
BUILD()
{
cmake -B build -S cpp -DCMAKE_BUILD_TYPE=RelWWithDebInfo \
$cmakeDirArgs \
-DBUILD_STATIC_LIB=OFF \
-DUSE_STDMUTEX=ON \
-DBUILD_TESTING=OFF \
-Wno-dev
make -C build $jobArgs
}
INSTALL()
{
make -C build install
prepareInstalledDevelLibs \
libgeocoding \
libphonenumber
fixPkgconfig
packageEntries devel \
$developDir \
$libDir/cmake
}
TEST()
{
cmake --build build --target tests
}