1*73bd93f1SPatrick WilliamsSUMMARY = "YANG data modeling language library"
2*73bd93f1SPatrick WilliamsDESCRIPTION = "libyang is a YANG data modelling language parser and toolkit written (and providing API) in C."
3*73bd93f1SPatrick WilliamsHOMEPAGE = "https://github.com/CESNET/libyang"
4*73bd93f1SPatrick WilliamsSECTION = "libs"
5*73bd93f1SPatrick WilliamsLICENSE = "BSD-3-Clause"
6*73bd93f1SPatrick Williams
7*73bd93f1SPatrick WilliamsLIC_FILES_CHKSUM = "file://LICENSE;md5=f3916d7d8d42a6508d0ea418cfff10ad"
8*73bd93f1SPatrick Williams
9*73bd93f1SPatrick WilliamsSRCREV = "fc4dbd923e044006c93df020590a1e5a8656c09e"
10*73bd93f1SPatrick Williams
11*73bd93f1SPatrick WilliamsSRC_URI = "git://github.com/CESNET/libyang.git;branch=master;protocol=https \
12*73bd93f1SPatrick Williams           file://0001-test_context-skip-test-case-test_searchdirs.patch \
13*73bd93f1SPatrick Williams           file://run-ptest \
14*73bd93f1SPatrick Williams           "
15*73bd93f1SPatrick Williams
16*73bd93f1SPatrick WilliamsS = "${WORKDIR}/git"
17*73bd93f1SPatrick Williams
18*73bd93f1SPatrick Williams# Main dependencies
19*73bd93f1SPatrick Williamsinherit cmake pkgconfig lib_package ptest multilib_header
20*73bd93f1SPatrick WilliamsDEPENDS = "libpcre2"
21*73bd93f1SPatrick WilliamsDEPENDS += "${@bb.utils.contains('PTEST_ENABLED', '1', 'cmocka', '', d)}"
22*73bd93f1SPatrick Williams
23*73bd93f1SPatrick WilliamsEXTRA_OECMAKE = "-DCMAKE_BUILD_TYPE=Release"
24*73bd93f1SPatrick WilliamsEXTRA_OECMAKE += " ${@bb.utils.contains('PTEST_ENABLED', '1', '-DENABLE_TESTS=ON -DENABLE_VALGRIND_TESTS=OFF', '', d)}"
25*73bd93f1SPatrick Williams
26*73bd93f1SPatrick Williamsdo_compile:prepend () {
27*73bd93f1SPatrick Williams    if [ ${PTEST_ENABLED} = "1" ]; then
28*73bd93f1SPatrick Williams        sed -i -e 's|${S}|${PTEST_PATH}|g' ${B}/tests/tests_config.h
29*73bd93f1SPatrick Williams        sed -i -e 's|${B}|${PTEST_PATH}|g' ${B}/tests/tests_config.h
30*73bd93f1SPatrick Williams    fi
31*73bd93f1SPatrick Williams}
32*73bd93f1SPatrick Williams
33*73bd93f1SPatrick Williamsdo_install:append () {
34*73bd93f1SPatrick Williams        oe_multilib_header  libyang/config.h
35*73bd93f1SPatrick Williams}
36*73bd93f1SPatrick Williams
37*73bd93f1SPatrick Williamsdo_install_ptest () {
38*73bd93f1SPatrick Williams    install -d ${D}${PTEST_PATH}/tests
39*73bd93f1SPatrick Williams    cp -f ${B}/tests/utest_* ${D}${PTEST_PATH}/tests/
40*73bd93f1SPatrick Williams    cp -fR ${S}/tests/modules ${D}${PTEST_PATH}/tests/
41*73bd93f1SPatrick Williams    install -d ${D}${PTEST_PATH}/tests/plugins
42*73bd93f1SPatrick Williams    cp -f ${B}/tests/plugins/plugin_*.so ${D}${PTEST_PATH}/tests/plugins/
43*73bd93f1SPatrick Williams}
44*73bd93f1SPatrick Williams
45*73bd93f1SPatrick WilliamsFILES:${PN} += "${datadir}/yang/*"
46