blob: bddf30bf6a6bf1c0aa8c828432b291808446b82c [file] [log] [blame]
Andrew Geisslerfc113ea2023-03-31 09:59:46 -05001SUMMARY = "YANG data modeling language library"
2DESCRIPTION = "libyang is a YANG data modelling language parser and toolkit written (and providing API) in C."
3HOMEPAGE = "https://github.com/CESNET/libyang"
4SECTION = "libs"
5LICENSE = "BSD-3-Clause"
6
7LIC_FILES_CHKSUM = "file://LICENSE;md5=f3916d7d8d42a6508d0ea418cfff10ad"
8
9SRCREV = "9a4e5b2ce30b9696116d6e654ee55caab5aafed8"
10
11SRC_URI = "git://github.com/CESNET/libyang.git;branch=master;protocol=https \
12 file://0001-test_context-skip-test-case-test_searchdirs.patch \
13 file://run-ptest \
14 "
15
16S = "${WORKDIR}/git"
17
18# Main dependencies
Andrew Geissler8f840682023-07-21 09:09:43 -050019inherit cmake pkgconfig lib_package ptest multilib_header
Andrew Geisslerfc113ea2023-03-31 09:59:46 -050020DEPENDS = "libpcre2"
21DEPENDS += "${@bb.utils.contains('PTEST_ENABLED', '1', 'cmocka', '', d)}"
22
23EXTRA_OECMAKE = "-DCMAKE_BUILD_TYPE=Release"
24EXTRA_OECMAKE += " ${@bb.utils.contains('PTEST_ENABLED', '1', '-DENABLE_TESTS=ON -DENABLE_VALGRIND_TESTS=OFF', '', d)}"
25
26do_compile:prepend () {
27 if [ ${PTEST_ENABLED} = "1" ]; then
28 sed -i -e 's|${S}|${PTEST_PATH}|g' ${B}/tests/tests_config.h
29 sed -i -e 's|${B}|${PTEST_PATH}|g' ${B}/tests/tests_config.h
30 fi
31}
32
Andrew Geissler8f840682023-07-21 09:09:43 -050033do_install:append () {
34 oe_multilib_header libyang/config.h
35}
36
Andrew Geisslerfc113ea2023-03-31 09:59:46 -050037do_install_ptest () {
38 install -d ${D}${PTEST_PATH}/tests
39 cp -f ${B}/tests/utest_* ${D}${PTEST_PATH}/tests/
40 cp -fR ${S}/tests/modules ${D}${PTEST_PATH}/tests/
41 install -d ${D}${PTEST_PATH}/tests/plugins
42 cp -f ${B}/tests/plugins/plugin_*.so ${D}${PTEST_PATH}/tests/plugins/
43}
44
45FILES:${PN} += "${datadir}/yang/*"