pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/devel/SDL2 enable Raspberry Pi native video driver if ...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/7515a4508db5
branches:  trunk
changeset: 646575:7515a4508db5
user:      jmcneill <jmcneill%pkgsrc.org@localhost>
date:      Wed Feb 11 14:00:45 2015 +0000

description:
enable Raspberry Pi native video driver if "rpi" option is set

diffstat:

 devel/SDL2/Makefile                           |  12 ++++++-
 devel/SDL2/buildlink3.mk                      |   6 +++-
 devel/SDL2/distinfo                           |   4 +-
 devel/SDL2/options.mk                         |  22 +++++++++++-
 devel/SDL2/patches/patch-configure            |  45 +++++++++++++++++++++++++++
 devel/SDL2/patches/patch-src_video_SDL__egl.c |  19 +++++++++++
 6 files changed, 101 insertions(+), 7 deletions(-)

diffs (178 lines):

diff -r 19c5609dfe7e -r 7515a4508db5 devel/SDL2/Makefile
--- a/devel/SDL2/Makefile       Wed Feb 11 13:56:07 2015 +0000
+++ b/devel/SDL2/Makefile       Wed Feb 11 14:00:45 2015 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.10 2015/02/09 08:27:07 snj Exp $
+# $NetBSD: Makefile,v 1.11 2015/02/11 14:00:45 jmcneill Exp $
 
 DISTNAME=      SDL2-2.0.3
 PKGREVISION=   5
@@ -13,7 +13,7 @@
 USE_LANGUAGES= c c++
 GNU_CONFIGURE= YES
 USE_LIBTOOL=   YES
-USE_TOOLS+=    gmake pkg-config
+USE_TOOLS+=    gmake pkg-config autoconf automake autoreconf
 
 PKGCONFIG_OVERRIDE+=   sdl2.pc.in
 
@@ -23,6 +23,14 @@
 BUILDLINK_TRANSFORM+=  rm:-ldl
 .endif
 
+SUBST_CLASSES+=                vc
+SUBST_STAGE.vc=                pre-configure
+SUBST_MESSAGE.vc=      Fixing path to VideoCore libraries.
+SUBST_FILES.vc=                configure
+SUBST_SED.vc+=         -e 's;/opt/vc;${PREFIX};g'
+
+CFLAGS+=       -DPREFIX=\"${PREFIX}\"
+
 .include "options.mk"
 
 .include "../../converters/libiconv/buildlink3.mk"
diff -r 19c5609dfe7e -r 7515a4508db5 devel/SDL2/buildlink3.mk
--- a/devel/SDL2/buildlink3.mk  Wed Feb 11 13:56:07 2015 +0000
+++ b/devel/SDL2/buildlink3.mk  Wed Feb 11 14:00:45 2015 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: buildlink3.mk,v 1.2 2015/02/09 08:27:07 snj Exp $
+# $NetBSD: buildlink3.mk,v 1.3 2015/02/11 14:00:45 jmcneill Exp $
 
 BUILDLINK_TREE+=       SDL2
 
@@ -33,4 +33,8 @@
 .include "../../mk/oss.buildlink3.mk"
 .endif # SDL2_BUILDLINK3_MK
 
+.if !empty(PKG_BUILD_OPTIONS.SDL2:Mrpi)
+.include "../../misc/raspberrypi-userland/buildlink3.mk"
+.endif
+
 BUILDLINK_TREE+=       -SDL2
diff -r 19c5609dfe7e -r 7515a4508db5 devel/SDL2/distinfo
--- a/devel/SDL2/distinfo       Wed Feb 11 13:56:07 2015 +0000
+++ b/devel/SDL2/distinfo       Wed Feb 11 14:00:45 2015 +0000
@@ -1,8 +1,10 @@
-$NetBSD: distinfo,v 1.6 2015/02/09 08:27:07 snj Exp $
+$NetBSD: distinfo,v 1.7 2015/02/11 14:00:45 jmcneill Exp $
 
 SHA1 (SDL2-2.0.3.tar.gz) = 21c45586a4e94d7622e371340edec5da40d06ecc
 RMD160 (SDL2-2.0.3.tar.gz) = e6f3718c7366c5da793c1454cf0ec0972e8bd347
 Size (SDL2-2.0.3.tar.gz) = 3871267 bytes
+SHA1 (patch-configure) = 7f0469ef69c2a7fc6a769435f0d29a01148df122
 SHA1 (patch-src_cpuinfo_SDL_cpuinfo.c) = 9482910e62023b92e80ce4d3b670a1a1e666789f
 SHA1 (patch-src_thread_pthread_SDL__systhread.c) = 68f32770d067d2b6dcffe96da2dd4aa6b4c82050
+SHA1 (patch-src_video_SDL__egl.c) = 665d8c7861cc61f2da9627c320cb7ae3193a393f
 SHA1 (patch-src_video_x11_SDL__x11opengl.c) = a435634da8b8bd5e74a281b9a26e8fb8a294e56b
diff -r 19c5609dfe7e -r 7515a4508db5 devel/SDL2/options.mk
--- a/devel/SDL2/options.mk     Wed Feb 11 13:56:07 2015 +0000
+++ b/devel/SDL2/options.mk     Wed Feb 11 14:00:45 2015 +0000
@@ -1,13 +1,24 @@
-# $NetBSD: options.mk,v 1.3 2015/02/09 08:27:07 snj Exp $
+# $NetBSD: options.mk,v 1.4 2015/02/11 14:00:45 jmcneill Exp $
 
 PKG_OPTIONS_VAR=       PKG_OPTIONS.SDL2
-PKG_SUPPORTED_OPTIONS= alsa arts dbus esound nas opengl oss pulseaudio x11
-PKG_SUGGESTED_OPTIONS+=        oss opengl
+PKG_OPTIONS_REQUIRED_GROUPS=   gl
+PKG_SUPPORTED_OPTIONS= alsa arts dbus esound nas oss pulseaudio x11
+PKG_OPTIONS_GROUP.gl=  opengl
+PKG_SUGGESTED_OPTIONS+=        oss
 
 .if ${OPSYS} != "Darwin"
 PKG_SUGGESTED_OPTIONS+=        x11
 .endif
 
+.include "../../mk/bsd.fast.prefs.mk"
+
+.if !empty(MACHINE_ARCH:M*arm*)
+PKG_OPTIONS_GROUP.gl+= rpi
+PKG_SUGGESTED_OPTIONS+=        rpi
+.else
+PKG_SUGGESTED_OPTIONS+=        opengl
+.endif
+
 .include "../../mk/bsd.options.mk"
 
 .if !empty(PKG_OPTIONS:Malsa)
@@ -61,3 +72,8 @@
 .else
 CONFIGURE_ARGS+=       --disable-video-x11 --disable-x11-shared
 .endif
+
+.if !empty(PKG_OPTIONS:Mrpi)
+LOWER_VENDOR=  raspberry
+.include "../../misc/raspberrypi-userland/buildlink3.mk"
+.endif
diff -r 19c5609dfe7e -r 7515a4508db5 devel/SDL2/patches/patch-configure
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/devel/SDL2/patches/patch-configure        Wed Feb 11 14:00:45 2015 +0000
@@ -0,0 +1,45 @@
+$NetBSD: patch-configure,v 1.1 2015/02/11 14:00:46 jmcneill Exp $
+
+--- configure.orig     2014-03-16 02:31:41.000000000 +0000
++++ configure
+@@ -22536,15 +22536,16 @@ case "$host" in
+             *-raspberry-linux*)
+                 # Raspberry Pi
+                 ARCH=linux
+-                RPI_CFLAGS="-I/opt/vc/include -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux"
++                RPI_CFLAGS="-I/usr/pkg/include -I/usr/pkg/include/interface/vcos/pthreads -I/usr/pkg/include/interface/vmcs_host/linux"
+                 CFLAGS="$CFLAGS $RPI_CFLAGS"
+                 SDL_CFLAGS="$SDL_CFLAGS $RPI_CFLAGS"
+                 EXTRA_CFLAGS="$EXTRA_CFLAGS $RPI_CFLAGS"
+-                EXTRA_LDFLAGS="$EXTRA_LDFLAGS -L/opt/vc/lib -lbcm_host -ldl"
++                EXTRA_LDFLAGS="$EXTRA_LDFLAGS -L/usr/pkg/lib -lbcm_host -ldl"
+ 
+                 if test x$enable_video = xyes; then
+                     SOURCES="$SOURCES $srcdir/src/video/raspberry/*.c"
+                     $as_echo "#define SDL_VIDEO_DRIVER_RPI 1" >>confdefs.h
++                    SUMMARY_video="${SUMMARY_video} raspberry"
+                 fi
+                 ;;
+             *-*-linux*)         ARCH=linux ;;
+@@ -22556,6 +22557,21 @@ case "$host" in
+             *-*-bsdi*)          ARCH=bsdi ;;
+             *-*-freebsd*)       ARCH=freebsd ;;
+             *-*-dragonfly*)     ARCH=freebsd ;;
++            *-raspberry-netbsd*)
++                # Raspberry Pi
++                ARCH=netbsd
++                RPI_CFLAGS="-I/usr/pkg/include -I/usr/pkg/include/interface/vcos/pthreads -I/usr/pkg/include/interface/vmcs_host/linux"
++                CFLAGS="$CFLAGS $RPI_CFLAGS"
++                SDL_CFLAGS="$SDL_CFLAGS $RPI_CFLAGS"
++                EXTRA_CFLAGS="$EXTRA_CFLAGS $RPI_CFLAGS"
++                EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-R/usr/pkg/lib -L/usr/pkg/lib -lbcm_host -ldl"
++
++                if test x$enable_video = xyes; then
++                    SOURCES="$SOURCES $srcdir/src/video/raspberry/*.c"
++                    $as_echo "#define SDL_VIDEO_DRIVER_RPI 1" >>confdefs.h
++                    SUMMARY_video="${SUMMARY_video} raspberry"
++                fi
++                ;;
+             *-*-netbsd*)        ARCH=netbsd ;;
+             *-*-openbsd*)       ARCH=openbsd ;;
+             *-*-sysv5*)         ARCH=sysv5 ;;
diff -r 19c5609dfe7e -r 7515a4508db5 devel/SDL2/patches/patch-src_video_SDL__egl.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/devel/SDL2/patches/patch-src_video_SDL__egl.c     Wed Feb 11 14:00:45 2015 +0000
@@ -0,0 +1,19 @@
+$NetBSD: patch-src_video_SDL__egl.c,v 1.1 2015/02/11 14:00:46 jmcneill Exp $
+
+--- src/video/SDL_egl.c.orig   2014-03-16 02:31:44.000000000 +0000
++++ src/video/SDL_egl.c
+@@ -29,10 +29,10 @@
+ 
+ #if SDL_VIDEO_DRIVER_RPI
+ /* Raspbian places the OpenGL ES/EGL binaries in a non standard path */
+-#define DEFAULT_EGL "/opt/vc/lib/libEGL.so"
+-#define DEFAULT_OGL_ES2 "/opt/vc/lib/libGLESv2.so"
+-#define DEFAULT_OGL_ES_PVR "/opt/vc/lib/libGLES_CM.so"
+-#define DEFAULT_OGL_ES "/opt/vc/lib/libGLESv1_CM.so"
++#define DEFAULT_EGL PREFIX "/lib/libEGL.so"
++#define DEFAULT_OGL_ES2 PREFIX "/lib/libGLESv2.so"
++#define DEFAULT_OGL_ES_PVR PREFIX "/lib/libGLES_CM.so"
++#define DEFAULT_OGL_ES PREFIX "/lib/libGLESv1_CM.so"
+ 
+ #elif SDL_VIDEO_DRIVER_ANDROID
+ /* Android */



Home | Main Index | Thread Index | Old Index