Re: [ptxdist] [PATCH v3] sdl2: add new package

2018-07-16 Thread Michael Olbrich
On Mon, Jul 16, 2018 at 02:54:43PM +0200, Michael Grzeschik wrote:
> Signed-off-by: Michael Grzeschik 
> ---
> v1 -> v2: - added select to MESALIB_GL* on SDL2_OPENGL*
>   - padded prompt entry with extra spaces
> v2 -> v3: - added patch to add egl cflags on configure.in and enabled 
> autogen.sh
> 
>  ...001-sdl-2.0.8-add-egl-cflags-to-test.patch |  41 
>  patches/SDL2-2.0.8/series |   4 +
>  rules/sdl2.in | 206 ++
>  rules/sdl2.make   | 164 ++
>  4 files changed, 415 insertions(+)
>  create mode 100644 
> patches/SDL2-2.0.8/0001-sdl-2.0.8-add-egl-cflags-to-test.patch
>  create mode 100644 patches/SDL2-2.0.8/series
>  create mode 100644 rules/sdl2.in
>  create mode 100644 rules/sdl2.make
> 
> diff --git a/patches/SDL2-2.0.8/0001-sdl-2.0.8-add-egl-cflags-to-test.patch 
> b/patches/SDL2-2.0.8/0001-sdl-2.0.8-add-egl-cflags-to-test.patch
> new file mode 100644
> index 0..84313d2aa
> --- /dev/null
> +++ b/patches/SDL2-2.0.8/0001-sdl-2.0.8-add-egl-cflags-to-test.patch
> @@ -0,0 +1,41 @@
> +From: Sergey Zhuravlevich 
> +Date: Mon, 16 Jul 2018 12:03:42 +0200
> +Subject: [PATCH] sdl-2.0.8: add egl-cflags to test
> +
> +Signed-off-by: Sergey Zhuravlevich 
> +---
> + configure.in | 14 ++
> + 1 file changed, 14 insertions(+)
> +
> +diff --git a/configure.in b/configure.in
> +index 1c7e79338a88..bfa14fbd4fa7 100644
> +--- a/configure.in
>  b/configure.in
> +@@ -2335,6 +2335,17 @@ dnl Find OpenGL ES
> + CheckOpenGLESX11()
> + {
> + if test x$enable_video = xyes -a x$enable_video_opengles = xyes; then
> ++AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
> ++if  test x$PKG_CONFIG != xno; then
> ++if $PKG_CONFIG --exists egl ; then
> ++EGL_CFLAGS=`$PKG_CONFIG --cflags egl`
> ++EXTRA_CFLAGS="$EXTRA_CFLAGS $EGL_CFLAGS"
> ++fi
> ++fi
> ++
> ++save_CFLAGS="$CFLAGS"
> ++CFLAGS="$save_CFLAGS $EGL_CFLAGS"

PKG_CHECK_MODULES([EGL], [egl],[have_egl=yes],[have_egl=no])

save_CFLAGS="$CFLAGS"
if [ "x$have_egl" = "xyes" ]; then
CFLAGS="$save_CFLAGS $EGL_CFLAGS"
fi

Untested, but PKG_CHECK_MODULES should be used here.

Michael

> ++
> + AC_MSG_CHECKING(for EGL support)
> + video_opengl_egl=no
> + AC_TRY_COMPILE([
> +@@ -2347,6 +2358,9 @@ CheckOpenGLESX11()
> + video_opengl_egl=yes
> + ])
> + AC_MSG_RESULT($video_opengl_egl)
> ++
> ++CFLAGS="$save_CFLAGS"
> ++
> + if test x$video_opengl_egl = xyes; then
> + AC_DEFINE(SDL_VIDEO_OPENGL_EGL, 1, [ ])
> + fi
> diff --git a/patches/SDL2-2.0.8/series b/patches/SDL2-2.0.8/series
> new file mode 100644
> index 0..3693c2785
> --- /dev/null
> +++ b/patches/SDL2-2.0.8/series
> @@ -0,0 +1,4 @@
> +# generated by git-ptx-patches
> +#tag:base --start-number 1
> +0001-sdl-2.0.8-add-egl-cflags-to-test.patch
> +# 57d72a951bd7f961008ad5274d82876a  - git-ptx-patches magic
> diff --git a/rules/sdl2.in b/rules/sdl2.in
> new file mode 100644
> index 0..54edea6ab
> --- /dev/null
> +++ b/rules/sdl2.in
> @@ -0,0 +1,206 @@
> +## SECTION=multimedia_sdl
> +
> +menuconfig SDL2
> + tristate
> + prompt "SDL2  "
> + select LIBC_M
> + select LIBC_DL
> + select LIBC_PTHREAD
> + select GCCLIBS_GCC_S
> + select LIBUNWIND
> + select CROSS_NASM   if SDL2_VIDEO
> + select ALSA_LIB if SDL2_ALSA
> + select XORG_LIB_X11 if SDL2_XORG
> + select XORG_LIB_XT  if SDL2_XORG
> + select XORG_LIB_XVMCif SDL2_XORG && SDL2_VIDEO
> + select DIRECTFB if SDL2_DIRECTFB
> + select TSLIBif SDL2_TSLIB
> + select DBUS if SDL2_DBUS
> + select LIBDRM   if SDL2_WAYLAND
> + select MESALIB_GLX  if SDL2_OPENGL
> + select MESALIB_GLES1if SDL2_OPENGLES1
> + select MESALIB_GLES2if SDL2_OPENGLES2
> + select MESALIB  if SDL2_WAYLAND
> + select MESALIB_GBM  if SDL2_WAYLAND
> + select MESALIB_EGL  if SDL2_WAYLAND
> + select MESALIB_EGL_DRM  if SDL2_WAYLAND
> + select MESALIB_EGL_WAYLAND  if SDL2_WAYLAND
> + select LIBXKBCOMMON if SDL2_WAYLAND
> + select UDEV if SDL2_UDEV
> + select UDEV_LIBUDEV if SDL2_UDEV
> + select PULSEAUDIO   if SDL2_PULSEAUDIO
> + select WAYLAND  if SDL2_WAYLAND
> + select WAYLAND_PROTOCOLSif SDL2_WAYLAND
> + help
> +   Simple DirectMedia Layer is a cross-platform multimedia
> +   library designed to provide low level access to audio,
> +   keyboard, mouse, joystick, 3D hardware via 

Re: [ptxdist] [PATCH v3] sdl2: add new package

2018-07-16 Thread Michael Olbrich
On Mon, Jul 16, 2018 at 02:54:43PM +0200, Michael Grzeschik wrote:
> Signed-off-by: Michael Grzeschik 
> ---
> v1 -> v2: - added select to MESALIB_GL* on SDL2_OPENGL*
>   - padded prompt entry with extra spaces
> v2 -> v3: - added patch to add egl cflags on configure.in and enabled 
> autogen.sh
> 
>  ...001-sdl-2.0.8-add-egl-cflags-to-test.patch |  41 
>  patches/SDL2-2.0.8/series |   4 +
>  rules/sdl2.in | 206 ++
>  rules/sdl2.make   | 164 ++
>  4 files changed, 415 insertions(+)
>  create mode 100644 
> patches/SDL2-2.0.8/0001-sdl-2.0.8-add-egl-cflags-to-test.patch
>  create mode 100644 patches/SDL2-2.0.8/series
>  create mode 100644 rules/sdl2.in
>  create mode 100644 rules/sdl2.make
> 
> diff --git a/patches/SDL2-2.0.8/0001-sdl-2.0.8-add-egl-cflags-to-test.patch 
> b/patches/SDL2-2.0.8/0001-sdl-2.0.8-add-egl-cflags-to-test.patch
> new file mode 100644
> index 0..84313d2aa
> --- /dev/null
> +++ b/patches/SDL2-2.0.8/0001-sdl-2.0.8-add-egl-cflags-to-test.patch
> @@ -0,0 +1,41 @@
> +From: Sergey Zhuravlevich 
> +Date: Mon, 16 Jul 2018 12:03:42 +0200
> +Subject: [PATCH] sdl-2.0.8: add egl-cflags to test
> +
> +Signed-off-by: Sergey Zhuravlevich 
> +---
> + configure.in | 14 ++
> + 1 file changed, 14 insertions(+)
> +
> +diff --git a/configure.in b/configure.in
> +index 1c7e79338a88..bfa14fbd4fa7 100644
> +--- a/configure.in
>  b/configure.in
> +@@ -2335,6 +2335,17 @@ dnl Find OpenGL ES
> + CheckOpenGLESX11()
> + {
> + if test x$enable_video = xyes -a x$enable_video_opengles = xyes; then
> ++AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
> ++if  test x$PKG_CONFIG != xno; then
> ++if $PKG_CONFIG --exists egl ; then
> ++EGL_CFLAGS=`$PKG_CONFIG --cflags egl`
> ++EXTRA_CFLAGS="$EXTRA_CFLAGS $EGL_CFLAGS"
> ++fi
> ++fi
> ++
> ++save_CFLAGS="$CFLAGS"
> ++CFLAGS="$save_CFLAGS $EGL_CFLAGS"
> ++
> + AC_MSG_CHECKING(for EGL support)
> + video_opengl_egl=no
> + AC_TRY_COMPILE([
> +@@ -2347,6 +2358,9 @@ CheckOpenGLESX11()
> + video_opengl_egl=yes
> + ])
> + AC_MSG_RESULT($video_opengl_egl)
> ++
> ++CFLAGS="$save_CFLAGS"
> ++
> + if test x$video_opengl_egl = xyes; then
> + AC_DEFINE(SDL_VIDEO_OPENGL_EGL, 1, [ ])
> + fi
> diff --git a/patches/SDL2-2.0.8/series b/patches/SDL2-2.0.8/series
> new file mode 100644
> index 0..3693c2785
> --- /dev/null
> +++ b/patches/SDL2-2.0.8/series
> @@ -0,0 +1,4 @@
> +# generated by git-ptx-patches
> +#tag:base --start-number 1
> +0001-sdl-2.0.8-add-egl-cflags-to-test.patch
> +# 57d72a951bd7f961008ad5274d82876a  - git-ptx-patches magic
> diff --git a/rules/sdl2.in b/rules/sdl2.in
> new file mode 100644
> index 0..54edea6ab
> --- /dev/null
> +++ b/rules/sdl2.in
> @@ -0,0 +1,206 @@
> +## SECTION=multimedia_sdl
> +
> +menuconfig SDL2
> + tristate
> + prompt "SDL2  "
> + select LIBC_M
> + select LIBC_DL
> + select LIBC_PTHREAD
> + select GCCLIBS_GCC_S
> + select LIBUNWIND
> + select CROSS_NASM   if SDL2_VIDEO
> + select ALSA_LIB if SDL2_ALSA
> + select XORG_LIB_X11 if SDL2_XORG
> + select XORG_LIB_XT  if SDL2_XORG
> + select XORG_LIB_XVMCif SDL2_XORG && SDL2_VIDEO
> + select DIRECTFB if SDL2_DIRECTFB
> + select TSLIBif SDL2_TSLIB
> + select DBUS if SDL2_DBUS
> + select LIBDRM   if SDL2_WAYLAND
> + select MESALIB_GLX  if SDL2_OPENGL
> + select MESALIB_GLES1if SDL2_OPENGLES1
> + select MESALIB_GLES2if SDL2_OPENGLES2
> + select MESALIB  if SDL2_WAYLAND
> + select MESALIB_GBM  if SDL2_WAYLAND
> + select MESALIB_EGL  if SDL2_WAYLAND
> + select MESALIB_EGL_DRM  if SDL2_WAYLAND
> + select MESALIB_EGL_WAYLAND  if SDL2_WAYLAND
> + select LIBXKBCOMMON if SDL2_WAYLAND
> + select UDEV if SDL2_UDEV
> + select UDEV_LIBUDEV if SDL2_UDEV
> + select PULSEAUDIO   if SDL2_PULSEAUDIO
> + select WAYLAND  if SDL2_WAYLAND
> + select WAYLAND_PROTOCOLSif SDL2_WAYLAND
> + 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.
> +
> +if SDL2
> +
> +config SDL2_TIMERS
> + bool
> + prompt "SDL2 Timers Support"
> + default y
> + help
> +   FIXME
> +
> +config SDL2_FILE
> + bool
> + prompt "SDL2 File Support"
> + default y
> + help
> +

[ptxdist] [PATCH v3] sdl2: add new package

2018-07-16 Thread Michael Grzeschik
Signed-off-by: Michael Grzeschik 
---
v1 -> v2: - added select to MESALIB_GL* on SDL2_OPENGL*
  - padded prompt entry with extra spaces
v2 -> v3: - added patch to add egl cflags on configure.in and enabled autogen.sh

 ...001-sdl-2.0.8-add-egl-cflags-to-test.patch |  41 
 patches/SDL2-2.0.8/series |   4 +
 rules/sdl2.in | 206 ++
 rules/sdl2.make   | 164 ++
 4 files changed, 415 insertions(+)
 create mode 100644 
patches/SDL2-2.0.8/0001-sdl-2.0.8-add-egl-cflags-to-test.patch
 create mode 100644 patches/SDL2-2.0.8/series
 create mode 100644 rules/sdl2.in
 create mode 100644 rules/sdl2.make

diff --git a/patches/SDL2-2.0.8/0001-sdl-2.0.8-add-egl-cflags-to-test.patch 
b/patches/SDL2-2.0.8/0001-sdl-2.0.8-add-egl-cflags-to-test.patch
new file mode 100644
index 0..84313d2aa
--- /dev/null
+++ b/patches/SDL2-2.0.8/0001-sdl-2.0.8-add-egl-cflags-to-test.patch
@@ -0,0 +1,41 @@
+From: Sergey Zhuravlevich 
+Date: Mon, 16 Jul 2018 12:03:42 +0200
+Subject: [PATCH] sdl-2.0.8: add egl-cflags to test
+
+Signed-off-by: Sergey Zhuravlevich 
+---
+ configure.in | 14 ++
+ 1 file changed, 14 insertions(+)
+
+diff --git a/configure.in b/configure.in
+index 1c7e79338a88..bfa14fbd4fa7 100644
+--- a/configure.in
 b/configure.in
+@@ -2335,6 +2335,17 @@ dnl Find OpenGL ES
+ CheckOpenGLESX11()
+ {
+ if test x$enable_video = xyes -a x$enable_video_opengles = xyes; then
++AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
++if  test x$PKG_CONFIG != xno; then
++if $PKG_CONFIG --exists egl ; then
++EGL_CFLAGS=`$PKG_CONFIG --cflags egl`
++EXTRA_CFLAGS="$EXTRA_CFLAGS $EGL_CFLAGS"
++fi
++fi
++
++save_CFLAGS="$CFLAGS"
++CFLAGS="$save_CFLAGS $EGL_CFLAGS"
++
+ AC_MSG_CHECKING(for EGL support)
+ video_opengl_egl=no
+ AC_TRY_COMPILE([
+@@ -2347,6 +2358,9 @@ CheckOpenGLESX11()
+ video_opengl_egl=yes
+ ])
+ AC_MSG_RESULT($video_opengl_egl)
++
++CFLAGS="$save_CFLAGS"
++
+ if test x$video_opengl_egl = xyes; then
+ AC_DEFINE(SDL_VIDEO_OPENGL_EGL, 1, [ ])
+ fi
diff --git a/patches/SDL2-2.0.8/series b/patches/SDL2-2.0.8/series
new file mode 100644
index 0..3693c2785
--- /dev/null
+++ b/patches/SDL2-2.0.8/series
@@ -0,0 +1,4 @@
+# generated by git-ptx-patches
+#tag:base --start-number 1
+0001-sdl-2.0.8-add-egl-cflags-to-test.patch
+# 57d72a951bd7f961008ad5274d82876a  - git-ptx-patches magic
diff --git a/rules/sdl2.in b/rules/sdl2.in
new file mode 100644
index 0..54edea6ab
--- /dev/null
+++ b/rules/sdl2.in
@@ -0,0 +1,206 @@
+## SECTION=multimedia_sdl
+
+menuconfig SDL2
+   tristate
+   prompt "SDL2  "
+   select LIBC_M
+   select LIBC_DL
+   select LIBC_PTHREAD
+   select GCCLIBS_GCC_S
+   select LIBUNWIND
+   select CROSS_NASM   if SDL2_VIDEO
+   select ALSA_LIB if SDL2_ALSA
+   select XORG_LIB_X11 if SDL2_XORG
+   select XORG_LIB_XT  if SDL2_XORG
+   select XORG_LIB_XVMCif SDL2_XORG && SDL2_VIDEO
+   select DIRECTFB if SDL2_DIRECTFB
+   select TSLIBif SDL2_TSLIB
+   select DBUS if SDL2_DBUS
+   select LIBDRM   if SDL2_WAYLAND
+   select MESALIB_GLX  if SDL2_OPENGL
+   select MESALIB_GLES1if SDL2_OPENGLES1
+   select MESALIB_GLES2if SDL2_OPENGLES2
+   select MESALIB  if SDL2_WAYLAND
+   select MESALIB_GBM  if SDL2_WAYLAND
+   select MESALIB_EGL  if SDL2_WAYLAND
+   select MESALIB_EGL_DRM  if SDL2_WAYLAND
+   select MESALIB_EGL_WAYLAND  if SDL2_WAYLAND
+   select LIBXKBCOMMON if SDL2_WAYLAND
+   select UDEV if SDL2_UDEV
+   select UDEV_LIBUDEV if SDL2_UDEV
+   select PULSEAUDIO   if SDL2_PULSEAUDIO
+   select WAYLAND  if SDL2_WAYLAND
+   select WAYLAND_PROTOCOLSif SDL2_WAYLAND
+   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.
+
+if SDL2
+
+config SDL2_TIMERS
+   bool
+   prompt "SDL2 Timers Support"
+   default y
+   help
+ FIXME
+
+config SDL2_FILE
+   bool
+   prompt "SDL2 File Support"
+   default y
+   help
+ FIXME
+
+config SDL2_CPUINFO
+   bool
+   prompt "SDL2 CPU Info Support"
+   default y
+   help
+ FIXME
+
+menuconfig SDL2_AUDIO
+   bool
+   prompt "SDL2 Audio Support "
+   default y
+   help