Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 1 | SUMMARY = "A reliable logging library" |
| 2 | HOMEPAGE = "https://github.com/rsyslog/librelp" |
| 3 | |
Andrew Geissler | 9aee500 | 2022-03-30 16:27:02 +0000 | [diff] [blame] | 4 | LICENSE = "GPL-3.0-only" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 5 | LIC_FILES_CHKSUM = "file://COPYING;md5=1fb9c10ed9fd6826757615455ca893a9" |
| 6 | |
Andrew Geissler | 5082cc7 | 2023-09-11 08:41:39 -0400 | [diff] [blame] | 7 | DEPENDS = "gmp libidn zlib" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 8 | |
Andrew Geissler | 32b1199 | 2021-03-31 13:37:05 -0500 | [diff] [blame] | 9 | SRC_URI = "git://github.com/rsyslog/librelp.git;protocol=https;branch=stable \ |
Patrick Williams | 2a25492 | 2023-08-11 09:48:11 -0500 | [diff] [blame] | 10 | file://0001-Fix-function-inline-errors-in-debug-optimization-Og.patch \ |
Andrew Geissler | 5082cc7 | 2023-09-11 08:41:39 -0400 | [diff] [blame] | 11 | file://0001-tests-Fix-callback-prototype.patch \ |
| 12 | file://0001-tcp-fix-some-compiler-warnings-with-enable-tls-opens.patch \ |
| 13 | file://0001-tests-Include-missing-sys-time.h.patch \ |
| 14 | file://run-ptest \ |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 15 | " |
| 16 | |
Andrew Geissler | c5535c9 | 2023-01-27 16:10:19 -0600 | [diff] [blame] | 17 | SRCREV = "b421f56d9ee31a966058d23bd23c966221c91396" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 18 | |
| 19 | S = "${WORKDIR}/git" |
| 20 | |
Andrew Geissler | 5082cc7 | 2023-09-11 08:41:39 -0400 | [diff] [blame] | 21 | inherit autotools pkgconfig ptest |
| 22 | |
| 23 | PACKAGECONFIG ?= "tls-openssl valgrind" |
| 24 | # Valgrind is not available for RISCV yet |
| 25 | PACKAGECONFIG:remove:riscv64 = "valgrind" |
| 26 | PACKAGECONFIG:remove:riscv32 = "valgrind" |
| 27 | |
| 28 | PACKAGECONFIG[tls] = "--enable-tls,--disable-tls,gnutls nettle" |
| 29 | PACKAGECONFIG[tls-openssl] = "--enable-tls-openssl,--disable-tls-openssl,openssl" |
| 30 | PACKAGECONFIG[valgrind] = "--enable-valgrind,--disable-valgrind," |
| 31 | |
| 32 | # For ptests, copy source tests/*.sh scripts, Makefile and |
| 33 | # executables and run them with make on target. |
| 34 | TESTDIR = "tests" |
| 35 | do_compile_ptest() { |
| 36 | echo 'buildtest-TESTS: $(check_PROGRAMS)' >> ${TESTDIR}/Makefile |
| 37 | oe_runmake -C ${TESTDIR} buildtest-TESTS |
| 38 | } |
| 39 | |
| 40 | do_install_ptest() { |
| 41 | install -d ${D}${PTEST_PATH}/${TESTDIR} |
| 42 | |
| 43 | # copy source tests/*.sh and python scripts |
| 44 | cp -f ${S}/${TESTDIR}/*.sh ${S}/${TESTDIR}/*.py ${D}${PTEST_PATH}/${TESTDIR} |
| 45 | # install data files needed by the test scripts on the target |
| 46 | cp -f ${S}/${TESTDIR}/*.supp ${D}${PTEST_PATH}/${TESTDIR} |
| 47 | cp -rf ${S}/${TESTDIR}/tls-certs ${D}${PTEST_PATH}/${TESTDIR} |
| 48 | |
| 49 | # copy executables |
| 50 | find ${B}/${TESTDIR} -type f -executable -exec cp {} ${D}${PTEST_PATH}/${TESTDIR} \; |
| 51 | cp -rf ${B}/${TESTDIR}/.libs ${D}${PTEST_PATH}/${TESTDIR} |
| 52 | # copy Makefile |
| 53 | # run-ptest will run make which runs the executables |
| 54 | cp -f ${B}/${TESTDIR}/Makefile ${D}${PTEST_PATH}/${TESTDIR} |
| 55 | cp -f ${B}/${TESTDIR}/set-envvars ${D}${PTEST_PATH}/${TESTDIR} |
| 56 | |
| 57 | # give permissions to all users |
| 58 | # some tests need to write to this directory |
| 59 | chmod 777 -R ${D}${PTEST_PATH}/${TESTDIR} |
| 60 | |
| 61 | # do NOT need to rebuild Makefile or $(check_PROGRAMS) |
| 62 | sed -i 's/^Makefile:.*$/Makefile:/' ${D}${PTEST_PATH}/${TESTDIR}/Makefile |
| 63 | sed -i 's/^check-TESTS:.*$/check-TESTS:/' ${D}${PTEST_PATH}/${TESTDIR}/Makefile |
| 64 | |
| 65 | # fix the srcdir, top_srcdir, abs_top_builddir |
| 66 | sed -i 's,^\(srcdir = \).*,\1${PTEST_PATH}/${TESTDIR},' ${D}${PTEST_PATH}/${TESTDIR}/Makefile |
| 67 | sed -i 's,^\(top_srcdir = \).*,\1${PTEST_PATH}/${TESTDIR},' ${D}${PTEST_PATH}/${TESTDIR}/Makefile |
| 68 | sed -i 's,^\(abs_top_builddir = \).*,\1${PTEST_PATH}/,' ${D}${PTEST_PATH}/${TESTDIR}/Makefile |
| 69 | |
| 70 | # install test-driver |
| 71 | install -m 644 ${S}/test-driver ${D}${PTEST_PATH} |
| 72 | |
| 73 | # fix the python3 path for tests/set-envar |
| 74 | sed -i -e s:${HOSTTOOLS_DIR}:${bindir}:g ${D}${PTEST_PATH}/${TESTDIR}/set-envvars |
| 75 | |
| 76 | # these 2 scripts need help finding their /usr/lib/librelp/ptest/tests/.libs libraries |
| 77 | sed -i 's:${B}/src:${PTEST_PATH}/${TESTDIR}:' ${D}${PTEST_PATH}/${TESTDIR}/send |
| 78 | sed -i 's:${B}/src:${PTEST_PATH}/${TESTDIR}:' ${D}${PTEST_PATH}/${TESTDIR}/receive |
| 79 | } |
| 80 | |
| 81 | RDEPENDS:${PN}-ptest += "\ |
| 82 | make bash coreutils libgcc util-linux gawk grep \ |
| 83 | python3-core python3-io \ |
| 84 | " |
| 85 | RRECOMMENDS:${PN}-ptest += "${@bb.utils.filter('PACKAGECONFIG', 'valgrind', d)}" |
| 86 | |