Signed-off-by: Michael Grzeschik <m.grzesc...@pengutronix.de> --- v1 -> v2: - added a patch to select opengl dependency - removed extra space on _LDFLAGS - replaced customloops with foreach v2 -> v3: - nothing changed v3 -> v4: - added missing application files (dat, txt) to SDL2_TEST_DATA - removed sdl2- fileprefix and moved them to subdir sdl2tests v4 -> v5: - moved this patch behind the others - added dependecy to sdl2-ttfa - reworked the opengl enable patch on configure.in - added autogen.sh
...001-sdl-2.0.8-tests-configure-opengl.patch | 44 +++++ patches/SDL2_test-2.0.8/autogen.sh | 4 + patches/SDL2_test-2.0.8/series | 4 + rules/sdl2-test.in | 12 ++ rules/sdl2-test.make | 173 ++++++++++++++++++ 5 files changed, 237 insertions(+) create mode 100644 patches/SDL2_test-2.0.8/0001-sdl-2.0.8-tests-configure-opengl.patch create mode 100755 patches/SDL2_test-2.0.8/autogen.sh create mode 100644 patches/SDL2_test-2.0.8/series create mode 100644 rules/sdl2-test.in create mode 100644 rules/sdl2-test.make diff --git a/patches/SDL2_test-2.0.8/0001-sdl-2.0.8-tests-configure-opengl.patch b/patches/SDL2_test-2.0.8/0001-sdl-2.0.8-tests-configure-opengl.patch new file mode 100644 index 000000000..8be0b1a89 --- /dev/null +++ b/patches/SDL2_test-2.0.8/0001-sdl-2.0.8-tests-configure-opengl.patch @@ -0,0 +1,44 @@ +From: Jaret Cantu <jaret.ca...@timesys.com> +Date: Tue, 16 Jan 2018 12:16:16 -0500 +Subject: [PATCH] sdl-2.0.8: tests: configure opengl + + Allow OpenGL to be configured manually + + The autodetection uses the presence of a header file which + SDL2 always installs, regardless of whether or not OpenGL was + enabled. This causes the SDL2 tests to use OpenGL when SDL2 + itself was not configured for it. + + Configure certain tests not to build, depending on the + configuration. Tests which require OpenGL development files + will fail when no OpenGL is detected (which should be obvious, + but it apparently wasn't for whoever designed this). +--- + test/configure.in | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/test/configure.in b/test/configure.in +index fd3f3022bc2e..8ae15159b8f8 100644 +--- a/test/configure.in ++++ b/test/configure.in +@@ -115,6 +115,12 @@ if test x$have_x = xyes; then + fi + fi + ++dnl Check to see if OpenGL support is desired ++AC_ARG_ENABLE(opengl, ++AC_HELP_STRING([--enable-opengl], [include OpenGL support [[default=yes]]]), ++ , enable_opengl=yes) ++ ++if test x$enable_opengl = xyes; then + dnl Check for OpenGL + AC_MSG_CHECKING(for OpenGL support) + have_opengl=no +@@ -125,6 +131,7 @@ AC_TRY_COMPILE([ + have_opengl=yes + ]) + AC_MSG_RESULT($have_opengl) ++fi + + dnl Check for OpenGL ES + AC_MSG_CHECKING(for OpenGL ES support) diff --git a/patches/SDL2_test-2.0.8/autogen.sh b/patches/SDL2_test-2.0.8/autogen.sh new file mode 100755 index 000000000..1e5af6e71 --- /dev/null +++ b/patches/SDL2_test-2.0.8/autogen.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +./autogen.sh + diff --git a/patches/SDL2_test-2.0.8/series b/patches/SDL2_test-2.0.8/series new file mode 100644 index 000000000..7064d2850 --- /dev/null +++ b/patches/SDL2_test-2.0.8/series @@ -0,0 +1,4 @@ +# generated by git-ptx-patches +#tag:base --start-number 1 +0001-sdl-2.0.8-tests-configure-opengl.patch +# c71c8697191f98668c86bc2215feebce - git-ptx-patches magic diff --git a/rules/sdl2-test.in b/rules/sdl2-test.in new file mode 100644 index 000000000..ba1e84a44 --- /dev/null +++ b/rules/sdl2-test.in @@ -0,0 +1,12 @@ +## SECTION=multimedia_sdl + +config SDL2_TEST + tristate + prompt "SDL2 test" + select SDL2 + select SDL2_TTF + help + Simple DirectMedia Layer is a cross-platform multimedia + library designed to provide low level access to audio, + keyboard, mouse, joystick, 3D hardware via OpenGL, and + 2D video framebuffer. diff --git a/rules/sdl2-test.make b/rules/sdl2-test.make new file mode 100644 index 000000000..0b8dd3d5e --- /dev/null +++ b/rules/sdl2-test.make @@ -0,0 +1,173 @@ +# -*-makefile-*- +# +# Copyright (C) 2018 by Michael Grzeschik +# +# See CREDITS for details about who has contributed to this project. +# +# For further information about the PTXdist project and license conditions +# see the README file. +# + +# +# We provide this package +# +PACKAGES-$(PTXCONF_SDL2_TEST) += sdl2-test + +# +# Paths and names +# +SDL2_TEST_VERSION = $(SDL2_VERSION) +SDL2_TEST_MD5 = $(SDL2_MD5) +SDL2_TEST = SDL2_test-$(SDL2_VERSION) +SDL2_TEST_SUFFIX = $(SDL2_SUFFIX) +SDL2_TEST_URL = $(SDL2_URL) +SDL2_TEST_SOURCE = $(SDL2_SOURCE) +SDL2_TEST_DIR = $(BUILDDIR)/$(SDL2_TEST) +SDL2_TEST_SUBDIR := test +SDL2_TESTS_LICENSE := zlib + +# ---------------------------------------------------------------------------- +# Prepare +# ---------------------------------------------------------------------------- + +SDL2_TEST_ENV := \ + $(CROSS_ENV) \ + SDL_LIBS="-lSDL2 -lunwind -lunwind-generic" + +# +# autoconf +# +SDL2_TEST_CONF_TOOL := autoconf +SDL2_TEST_CONF_OPT := \ + $(CROSS_AUTOCONF_USR) \ + --$(call ptx/endis,PTXCONF_SDL2_OPENGL)-opengl + +ifdef PTXCONF_SDL2_PULSEAUDIO +SDL2_TEST_LDFLAGS := \ + -Wl,-rpath-link,$(SYSROOT)/usr/lib/pulseaudio +endif + +# ---------------------------------------------------------------------------- +# Install +# ---------------------------------------------------------------------------- + +SDL2_TEST_TOOLS := \ + checkkeys \ + controllermap \ + loopwave \ + loopwavequeue \ + testatomic \ + testaudiocapture \ + testaudiohotplug \ + testaudioinfo \ + testautomation \ + testbounds \ + testcustomcursor \ + testdisplayinfo \ + testdraw2 \ + testdrawchessboard \ + testdropfile \ + testerror \ + testfile \ + testfilesystem \ + testgamecontroller \ + testgesture \ + testhaptic \ + testhittesting \ + testhotplug \ + testiconv \ + testime \ + testintersections \ + testjoystick \ + testkeys \ + testloadso \ + testlock \ + testmessage \ + testmultiaudio \ + testnative \ + testoverlay2 \ + testplatform \ + testpower \ + testqsort \ + testrelative \ + testrendercopyex \ + testrendertarget \ + testresample \ + testrumble \ + testscale \ + testsem \ + testshape \ + testsprite2 \ + testspriteminimal \ + teststreaming \ + testthread \ + testtimer \ + testver \ + testviewport \ + testvulkan \ + testwm2 \ + testyuv \ + torturethread + +ifdef PTXCONF_SDL2_OPENGL +SDL2_TEST_TOOLS += \ + testgl2 \ + testshader +endif + +ifdef PTXCONF_SDL2_OPENGLES1 +SDL2_TEST_TOOLS += testgles +endif + +ifdef PTXCONF_SDL2_OPENGLES2 +SDL2_TEST_TOOLS += testgles2 +endif + +SDL2_TEST_DATA := \ + axis.bmp \ + button.bmp \ + controllermap.bmp \ + icon.bmp \ + sample.bmp \ + testyuv.bmp \ + sample.wav \ + picture.xbm \ + moose.dat \ + utf8.txt + +$(STATEDIR)/sdl2-test.install: + @$(call targetinfo) + @$(foreach file, $(SDL2_TEST_TOOLS), \ + install -vD -m 0755 $(SDL2_TEST_DIR)/$(SDL2_TEST_SUBDIR)/$(file) \ + $(SDL2_TEST_PKGDIR)/usr/bin/$(file)$(ptx/nl)) + @$(foreach file, $(SDL2_TEST_DATA), \ + install -vD -m 0644 $(SDL2_TEST_DIR)/$(SDL2_TEST_SUBDIR)/$(file) \ + $(SDL2_TEST_PKGDIR)/usr/bin/$(file)$(ptx/nl)) + @$(call touch) + +# ---------------------------------------------------------------------------- +# Target-Install +# ---------------------------------------------------------------------------- + +$(STATEDIR)/sdl2-test.targetinstall: + @$(call targetinfo) + + @$(call install_init, sdl2-test) + @$(call install_fixup, sdl2-test,PRIORITY,optional) + @$(call install_fixup, sdl2-test,SECTION,base) + @$(call install_fixup, sdl2-test,AUTHOR,"Michael Grzeschik <m...@pengutronix.de>") + @$(call install_fixup, sdl2-test,DESCRIPTION,missing) + + @$(foreach file, $(SDL2_TEST_TOOLS), \ + $(call install_copy, sdl2-test, 0, 0, 755, $(SDL2_TEST_PKGDIR)/usr/bin/$(file), \ + /usr/bin/sdl2tests/$(file))$(ptx/nl)) + + @$(foreach file, $(SDL2_TEST_DATA), \ + $(call install_copy, sdl2-test, 0, 0, 644, $(SDL2_TEST_PKGDIR)/usr/bin/$(file), \ + /usr/bin/sdl2tests/$(file))$(ptx/nl)) + + @$(call install_finish, sdl2-test) + + @$(call touch) + +# vim: syntax=make -- 2.18.0 _______________________________________________ ptxdist mailing list ptxdist@pengutronix.de