blob: b1438c3b2bfa892630bf7e56a158adfe5795b2ab [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
19inherit cmake pkgconfig lib_package ptest
20DEPENDS = "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
33do_install_ptest () {
34 install -d ${D}${PTEST_PATH}/tests
35 cp -f ${B}/tests/utest_* ${D}${PTEST_PATH}/tests/
36 cp -fR ${S}/tests/modules ${D}${PTEST_PATH}/tests/
37 install -d ${D}${PTEST_PATH}/tests/plugins
38 cp -f ${B}/tests/plugins/plugin_*.so ${D}${PTEST_PATH}/tests/plugins/
39}
40
41FILES:${PN} += "${datadir}/yang/*"