blob: 9d949c63030e31cf02eb58c28347eb28e65e719f [file] [log] [blame]
Andrew Geissler82c905d2020-04-13 13:39:40 -05001SUMMARY = "A reliable logging library"
2HOMEPAGE = "https://github.com/rsyslog/librelp"
3
Andrew Geissler9aee5002022-03-30 16:27:02 +00004LICENSE = "GPL-3.0-only"
Andrew Geissler82c905d2020-04-13 13:39:40 -05005LIC_FILES_CHKSUM = "file://COPYING;md5=1fb9c10ed9fd6826757615455ca893a9"
6
Andrew Geissler5082cc72023-09-11 08:41:39 -04007DEPENDS = "gmp libidn zlib"
Andrew Geissler82c905d2020-04-13 13:39:40 -05008
Andrew Geissler32b11992021-03-31 13:37:05 -05009SRC_URI = "git://github.com/rsyslog/librelp.git;protocol=https;branch=stable \
Patrick Williams2a254922023-08-11 09:48:11 -050010 file://0001-Fix-function-inline-errors-in-debug-optimization-Og.patch \
Andrew Geissler5082cc72023-09-11 08:41:39 -040011 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 Geissler82c905d2020-04-13 13:39:40 -050015"
16
Andrew Geisslerc5535c92023-01-27 16:10:19 -060017SRCREV = "b421f56d9ee31a966058d23bd23c966221c91396"
Andrew Geissler82c905d2020-04-13 13:39:40 -050018
19S = "${WORKDIR}/git"
20
Andrew Geissler5082cc72023-09-11 08:41:39 -040021inherit autotools pkgconfig ptest
22
23PACKAGECONFIG ?= "tls-openssl valgrind"
24# Valgrind is not available for RISCV yet
25PACKAGECONFIG:remove:riscv64 = "valgrind"
26PACKAGECONFIG:remove:riscv32 = "valgrind"
27
28PACKAGECONFIG[tls] = "--enable-tls,--disable-tls,gnutls nettle"
29PACKAGECONFIG[tls-openssl] = "--enable-tls-openssl,--disable-tls-openssl,openssl"
30PACKAGECONFIG[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.
34TESTDIR = "tests"
35do_compile_ptest() {
36 echo 'buildtest-TESTS: $(check_PROGRAMS)' >> ${TESTDIR}/Makefile
37 oe_runmake -C ${TESTDIR} buildtest-TESTS
38}
39
40do_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
81RDEPENDS:${PN}-ptest += "\
82 make bash coreutils libgcc util-linux gawk grep \
83 python3-core python3-io \
84"
85RRECOMMENDS:${PN}-ptest += "${@bb.utils.filter('PACKAGECONFIG', 'valgrind', d)}"
86