Message ID | 20250819221357.997067-1-a-christidis@ti.com |
---|---|
State | New |
Headers | show |
Series | [master] libsdl2: Add PACKAGECONFIG option for tests | expand |
On Wed, 20 Aug 2025 at 00:14, Antonios Christidis via lists.openembedded.org <a-christidis=ti.com@lists.openembedded.org> wrote: > +do_install:append() { > + if ${@bb.utils.contains('PACKAGECONFIG', 'tests', 'true', 'false', d)}; then > + install -d ${D}${bindir}/sdl2_tests > + cp -r ${B}/test/* ${D}${bindir}/sdl2_tests > + > + # Delete any leftover cmake files within the sdl2_tests dir > + find ${D}${bindir}/sdl2_tests -type f -name "*.cmake" -delete > + fi > +} The PACKAGECONFIG is okay, but this isn't. If you want to install the tests, you should also add run-ptest script, ptest package, and ensure they pass. Ideally, you should also make a patch to sdl that does the installation and offer that to upstream, rather than do it in a custom do_install snippet. Alex
diff --git a/meta/recipes-graphics/libsdl2/libsdl2_2.32.8.bb b/meta/recipes-graphics/libsdl2/libsdl2_2.32.8.bb index 98291e0f80..01f834aba9 100644 --- a/meta/recipes-graphics/libsdl2/libsdl2_2.32.8.bb +++ b/meta/recipes-graphics/libsdl2/libsdl2_2.32.8.bb @@ -79,9 +79,20 @@ PACKAGECONFIG[pulseaudio] = "-DSDL_PULSEAUDIO=ON,-DSDL_PULSEAUDIO=OFF,pulseaudio PACKAGECONFIG[vulkan] = "-DSDL_VULKAN=ON,-DSDL_VULKAN=OFF" PACKAGECONFIG[wayland] = "-DSDL_WAYLAND=ON,-DSDL_WAYLAND=OFF,wayland-native wayland wayland-protocols libxkbcommon" PACKAGECONFIG[x11] = "-DSDL_X11=ON,-DSDL_X11=OFF,virtual/libx11 libxext libxrandr libxrender" +PACKAGECONFIG[tests] = "-DSDL_TESTS=ON,-DSDL_TESTS=OFF" CFLAGS:append:class-native = " -DNO_SHARED_MEMORY" +do_install:append() { + if ${@bb.utils.contains('PACKAGECONFIG', 'tests', 'true', 'false', d)}; then + install -d ${D}${bindir}/sdl2_tests + cp -r ${B}/test/* ${D}${bindir}/sdl2_tests + + # Delete any leftover cmake files within the sdl2_tests dir + find ${D}${bindir}/sdl2_tests -type f -name "*.cmake" -delete + fi +} + FILES:${PN} += "${datadir}/licenses/SDL2/LICENSE.txt" BBCLASSEXTEND = "native nativesdk"