Files
sjiao f90ccad49a openjpeg: add ptest support
Add ptest support to enable runtime testing of openjpeg library.
Only unit tests are included, excluding tests that require external
data files (NR-/CONF-/ETS-/testjp2).

Tested on intel-x86-64: all 29 unit tests passed.

Signed-off-by: sjiao <Shilong.Jiao@windriver.com>
Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
2026-05-21 07:31:01 -07:00

57 lines
1.9 KiB
BlitzBasic

DESCRIPTION = "OpenJPEG library is an open-source JPEG 2000 codec"
HOMEPAGE = "http://www.openjpeg.org"
LICENSE = "BSD-2-Clause"
LIC_FILES_CHKSUM = "file://LICENSE;md5=c648878b4840d7babaade1303e7f108c"
DEPENDS = "libpng tiff lcms zlib"
SRC_URI = "git://github.com/uclouvain/openjpeg.git;branch=master;protocol=https \
file://0001-Do-not-ask-cmake-to-export-binaries-they-don-t-make-.patch \
file://CVE-2023-39327.patch \
file://CVE-2026-6192.patch \
file://run-ptest \
"
SRCREV = "6c4a29b00211eb0430fa0e5e890f1ce5c80f409f"
inherit cmake ptest
# for multilib
EXTRA_OECMAKE += "-DOPENJPEG_INSTALL_LIB_DIR=${@d.getVar('baselib').replace('/', '')}"
EXTRA_OECMAKE += "${@bb.utils.contains('PTEST_ENABLED', '1', '-DBUILD_TESTING=ON', '', d)}"
FILES:${PN} += "${libdir}/openjpeg*"
do_install_ptest() {
install -d ${D}${PTEST_PATH}
# Install test binaries only
if [ -d ${B}/bin ]; then
install -d ${D}${PTEST_PATH}/bin
find ${B}/bin -maxdepth 1 -type f -executable ! -name "*.so*" \
-exec install -m 0755 {} ${D}${PTEST_PATH}/bin/ \;
fi
# Install CTest configuration files with proper structure
if [ -d ${B}/tests ]; then
cp -r ${B}/tests ${D}${PTEST_PATH}/
fi
if [ -f ${B}/CTestTestfile.cmake ]; then
install -m 0644 ${B}/CTestTestfile.cmake ${D}${PTEST_PATH}/
fi
# Fix all build paths in cmake files to point to ptest installation
find ${D}${PTEST_PATH} \( -name "*.cmake" -o -name "*.ctest" \) -type f -exec sed -i \
-e "s#${B}/bin#${PTEST_PATH}/bin#g" \
-e "s#${B}#${PTEST_PATH}#g" \
-e "s#${S}#${PTEST_PATH}#g" \
-e "s#${TMPDIR}#/tmp#g" \
-e "s#${STAGING_DIR_NATIVE}##g" \
-e "s#/tmp/work/[^/]*/[^/]*/[^/]*/recipe-sysroot-native/usr/bin/cmake#/usr/bin/cmake#g" \
{} +
}
RDEPENDS:${PN}-ptest += "${PN} bash cmake"
BBCLASSEXTEND = "native nativesdk"