SUMMARY = "C/C++ Configuration File Library"
DESCRIPTION = "Library for manipulating structured configuration files"
HOMEPAGE = "https://hyperrealm.github.io/libconfig/"
BUGTRACKER = "https://github.com/hyperrealm/libconfig/issues"
SECTION = "libs"

LICENSE = "LGPL-2.1-only"
LIC_FILES_CHKSUM = "file://COPYING.LIB;md5=17c8e32f0f72580cc2906b409d46b5ac"

SRC_URI = " \
    git://github.com/hyperrealm/libconfig.git;protocol=https;branch=master;tag=v${PV} \
"
SRCREV = "a42cb47c1526a4f2ed025fcbb2289863375bc898"

# needed when we modify grammar.y with patches
DEPENDS += "bison-native flex-native"

UPSTREAM_CHECK_GITTAGREGEX = "^v(?P<pver>\d+(\.\d+)+)$"

inherit autotools pkgconfig

PACKAGE_BEFORE_PN = "${PN}++"
FILES:${PN}++ = "${libdir}/${BPN}++*${SOLIBS}"

# remove autogenerated files which seem to trigger reproducibility issues
do_compile:prepend() {
    rm -f ${S}/lib/grammar.[ch]
    rm -f ${S}/lib/scanner.[ch]
}
