summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatoro Mahri <matoro_gentoo@matoro.tk>2023-11-18 22:54:56 -0500
committerMichał Górny <mgorny@gentoo.org>2023-11-20 06:56:49 +0100
commit848b64f38b4d7459c3cd58fcbc88125d93b54a2d (patch)
treee7ba326fae2b5fd6dd79d7dbb7087d9d0a9d1287 /media-libs/libsdl2
parentnet-misc/yt-dlp: drop 2023.11.14 (diff)
downloadgentoo-848b64f38b4d7459c3cd58fcbc88125d93b54a2d.tar.gz
gentoo-848b64f38b4d7459c3cd58fcbc88125d93b54a2d.tar.bz2
gentoo-848b64f38b4d7459c3cd58fcbc88125d93b54a2d.zip
media-libs/libsdl2: wire up tests
Bug: https://bugs.gentoo.org/896130 Signed-off-by: Matoro Mahri <matoro_gentoo@matoro.tk> Closes: https://github.com/gentoo/gentoo/pull/33898 Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'media-libs/libsdl2')
-rw-r--r--media-libs/libsdl2/libsdl2-2.28.5.ebuild32
1 files changed, 30 insertions, 2 deletions
diff --git a/media-libs/libsdl2/libsdl2-2.28.5.ebuild b/media-libs/libsdl2/libsdl2-2.28.5.ebuild
index e01e4f109cd0..b37d436cf46e 100644
--- a/media-libs/libsdl2/libsdl2-2.28.5.ebuild
+++ b/media-libs/libsdl2/libsdl2-2.28.5.ebuild
@@ -15,7 +15,8 @@ LICENSE="ZLIB"
SLOT="0"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~ppc ~ppc64 ~riscv ~sparc ~x86"
-IUSE="alsa aqua cpu_flags_ppc_altivec cpu_flags_x86_3dnow cpu_flags_x86_mmx cpu_flags_x86_sse cpu_flags_x86_sse2 custom-cflags dbus doc fcitx4 gles1 gles2 haptic ibus jack +joystick kms libsamplerate nas opengl oss pipewire pulseaudio sndio +sound static-libs +threads udev +video video_cards_vc4 vulkan wayland X xscreensaver"
+IUSE="alsa aqua cpu_flags_ppc_altivec cpu_flags_x86_3dnow cpu_flags_x86_mmx cpu_flags_x86_sse cpu_flags_x86_sse2 custom-cflags dbus doc fcitx4 gles1 gles2 haptic ibus jack +joystick kms libsamplerate nas opengl oss pipewire pulseaudio sndio +sound static-libs test +threads udev +video video_cards_vc4 vulkan wayland X xscreensaver"
+RESTRICT="!test? ( test )"
REQUIRED_USE="
alsa? ( sound )
fcitx4? ( dbus )
@@ -110,6 +111,10 @@ src_prepare() {
# Unbundle some headers.
rm -r src/video/khronos || die
ln -s "${ESYSROOT}/usr/include" src/video/khronos || die
+ if ! use vulkan
+ then
+ sed -i '/testvulkan$(EXE) \\/d' "test/Makefile.in" || die
+ fi
# SDL seems to customize SDL_config.h.in to remove macros like
# PACKAGE_NAME. Add AT_NOEAUTOHEADER="yes" to prevent those macros from
@@ -202,13 +207,32 @@ multilib_src_configure() {
--disable-rpath
--disable-render-d3d
$(use_with X x)
+ ac_cv_header_libunwind_h=no
)
ECONF_SOURCE="${S}" econf "${myeconfargs[@]}"
+
+ if use test; then
+ # Most of these workarounds courtesy Debian
+ # https://salsa.debian.org/sdl-team/libsdl2/-/blob/debian/latest/debian/rules
+ local mytestargs=(
+ --x-includes="/usr/include"
+ --x-libraries="/usr/$(get_libdir)"
+ SDL_CFLAGS="-I${S}/include"
+ SDL_LIBS="-L${BUILD_DIR}/build/.libs -lSDL2"
+ ac_cv_lib_SDL2_ttf_TTF_Init=no
+ CFLAGS="${CPPFLAGS} ${CFLAGS} ${LDFLAGS}"
+ )
+
+ mkdir "${BUILD_DIR}/test" || die
+ cd "${BUILD_DIR}/test" || die
+ ECONF_SOURCE="${S}/test" econf "${mytestargs[@]}"
+ fi
}
multilib_src_compile() {
- emake V=1
+ emake all V=1
+ use test && emake -C test all V=1
}
src_compile() {
@@ -220,6 +244,10 @@ src_compile() {
fi
}
+multilib_src_test() {
+ LD_LIBRARY_PATH="${BUILD_DIR}/build/.libs" emake -C test check V=1
+}
+
multilib_src_install() {
emake DESTDIR="${D}" install
}