blob: e59235690ae75e5e72ae28695dd253a8a5264a7c [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
Andrew Geissler5082cc72023-09-11 08:41:39 -04009SRCREV = "8b0b910a2dcb7360cb5b0aaefbd1338271d50946"
Andrew Geisslerfc113ea2023-03-31 09:59:46 -050010
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/*"