# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:filetype=tcl:et:sw=4:ts=4:sts=4

PortSystem          1.0
PortGroup           boost 1.0
PortGroup           cmake 1.1
PortGroup           github 1.0
PortGroup           legacysupport 1.1

boost.version       1.81

github.setup        google libphonenumber 9.0.26 v
revision            0
name                libphonenumber-cpp
categories          devel
license             Apache-2
description         Google's C++ library for parsing, formatting, storing \
                    and validating international phone numbers.
long_description    {*}${description}
maintainers         {devans @dbevans} openmaintainer

checksums           rmd160  4a04b983dc41e7f9caa60beca3b292b7b76a6927 \
                    sha256  f2ac2946d615df52da81f34780ee972fa80af63d1a09becc7b7bbe32ae01547c \
                    size    13027321
github.tarball_from archive

worksrcdir          ${worksrcpath}/cpp

set gtest_srcdir    ${prefix}/src/googletest

depends_build-append \
                    port:gtest \
                    path:bin/pkg-config:pkgconfig

depends_lib-append  port:abseil \
                    path:lib/pkgconfig/icu-uc.pc:icu \
                    port:protobuf

configure.args-append \
                    -DABSL_PROPAGATE_CXX_STD=ON \
                    -DBUILD_TESTING=OFF \
                    -DGTEST_SOURCE_DIR=${gtest_srcdir} \
                    -DGTEST_INCLUDE_DIR=${gtest_srcdir}/include \
                    -DREGENERATE_METADATA=OFF \
                    -DUSE_STD_MAP=ON

compiler.cxx_standard       2017
configure.cxxflags-append   -std=c++17
compiler.thread_local_storage \
                            yes

# phonenumber_offline_geocoder.cc:80:25: error: 'absl::lts_20260107::MutexLock::MutexLock(absl::lts_20260107::Mutex*)'
# is deprecated: Use the constructor that takes a reference instead [-Werror=deprecated-declarations]
configure.cxxflags-append   -Wno-error=deprecated-declarations

test.run            yes
test.cmd            ./libphonenumber_test
test.target
