SDL2: Add support for Wayland in options.mk. While here, resolve some pkglint problems. Builds on NetBSD with Wayland support...diff -r1.38 -r1.39 pkgsrc/devel/SDL2/Makefile
(nia)
@@ -1,37 +1,37 @@ | @@ -1,37 +1,37 @@ | |||
1 | # $NetBSD: Makefile,v 1.38 2019/07/27 15:29:10 nia Exp $ | 1 | # $NetBSD: Makefile,v 1.39 2019/08/18 16:16:24 nia Exp $ | |
2 | 2 | |||
3 | DISTNAME= SDL2-2.0.10 | 3 | DISTNAME= SDL2-2.0.10 | |
4 | CATEGORIES= devel | 4 | CATEGORIES= devel | |
5 | MASTER_SITES= http://www.libsdl.org/release/ | 5 | MASTER_SITES= http://www.libsdl.org/release/ | |
6 | 6 | |||
7 | MAINTAINER= nia@NetBSD.org | 7 | MAINTAINER= nia@NetBSD.org | |
8 | HOMEPAGE= http://www.libsdl.org/ | 8 | HOMEPAGE= http://www.libsdl.org/ | |
9 | COMMENT= Simple DirectMedia Layer is a cross-platform multimedia library | 9 | COMMENT= Simple DirectMedia Layer - cross-platform multimedia library | |
10 | LICENSE= zlib | 10 | LICENSE= zlib | |
11 | 11 | |||
12 | USE_LANGUAGES= c c++ | 12 | USE_LANGUAGES= c c++ | |
13 | USE_LIBTOOL= yes | 13 | USE_LIBTOOL= yes | |
14 | USE_TOOLS+= gmake pkg-config autoconf automake autoreconf | 14 | USE_TOOLS+= gmake pkg-config autoconf automake autoreconf | |
15 | GNU_CONFIGURE= yes | 15 | GNU_CONFIGURE= yes | |
16 | PKGCONFIG_OVERRIDE+= sdl2.pc.in | 16 | PKGCONFIG_OVERRIDE+= sdl2.pc.in | |
17 | 17 | |||
18 | CONFIGURE_ENV+= SDL_RLD_FLAGS="${COMPILER_RPATH_FLAG}${PREFIX}/lib \ | 18 | CONFIGURE_ENV+= SDL_RLD_FLAGS="${COMPILER_RPATH_FLAG}${PREFIX}/lib \ | |
19 | ${COMPILER_RPATH_FLAG}${X11BASE}/lib" | 19 | ${COMPILER_RPATH_FLAG}${X11BASE}/lib" | |
20 | 20 | |||
21 | CONFIGURE_ARGS+= --disable-x11-shared | 21 | CONFIGURE_ARGS+= --disable-x11-shared | |
22 | 22 | |||
23 | CHECK_PORTABILITY_SKIP+=build-scripts/androidbuildlibs.sh | 23 | CHECK_PORTABILITY_SKIP+= build-scripts/androidbuildlibs.sh | |
24 | CHECK_PORTABILITY_SKIP+=build-scripts/iosbuild.sh | 24 | CHECK_PORTABILITY_SKIP+= build-scripts/iosbuild.sh | |
25 | 25 | |||
26 | .include "../../mk/bsd.prefs.mk" | 26 | .include "../../mk/bsd.prefs.mk" | |
27 | 27 | |||
28 | .if ${OPSYS} != "Linux" | 28 | .if ${OPSYS} != "Linux" | |
29 | BUILDLINK_TRANSFORM+= rm:-ldl | 29 | BUILDLINK_TRANSFORM+= rm:-ldl | |
30 | .endif | 30 | .endif | |
31 | 31 | |||
32 | CFLAGS+= -DPREFIX=\"${PREFIX}\" | 32 | CFLAGS+= -DPREFIX=\"${PREFIX}\" | |
33 | 33 | |||
34 | .include "options.mk" | 34 | .include "options.mk" | |
35 | 35 | |||
36 | .include "../../converters/libiconv/buildlink3.mk" | 36 | .include "../../converters/libiconv/buildlink3.mk" | |
37 | .include "../../mk/libusb.buildlink3.mk" | 37 | .include "../../mk/libusb.buildlink3.mk" |
@@ -1,10 +1,11 @@ | @@ -1,10 +1,11 @@ | |||
1 | $NetBSD: distinfo,v 1.34 2019/07/27 15:29:10 nia Exp $ | 1 | $NetBSD: distinfo,v 1.35 2019/08/18 16:16:24 nia Exp $ | |
2 | 2 | |||
3 | SHA1 (SDL2-2.0.10.tar.gz) = fb31312ea1d4b45db839796ae2336dfe3d5884e5 | 3 | SHA1 (SDL2-2.0.10.tar.gz) = fb31312ea1d4b45db839796ae2336dfe3d5884e5 | |
4 | RMD160 (SDL2-2.0.10.tar.gz) = b35818cbf8eaf0c9c4d3b6d7a293c05a368366b2 | 4 | RMD160 (SDL2-2.0.10.tar.gz) = b35818cbf8eaf0c9c4d3b6d7a293c05a368366b2 | |
5 | SHA512 (SDL2-2.0.10.tar.gz) = f49b869362699b3282f6e82920e59c7fac581bcbf955f18a81cc126293c08093a90df7fcb39517cc8bc32708d2213fe645a42b655d6d811c1386efebb3d3c798 | 5 | SHA512 (SDL2-2.0.10.tar.gz) = f49b869362699b3282f6e82920e59c7fac581bcbf955f18a81cc126293c08093a90df7fcb39517cc8bc32708d2213fe645a42b655d6d811c1386efebb3d3c798 | |
6 | Size (SDL2-2.0.10.tar.gz) = 5550762 bytes | 6 | Size (SDL2-2.0.10.tar.gz) = 5550762 bytes | |
7 | SHA1 (patch-configure) = 1631314dab18886ea553ee53fac89e16718cacab | 7 | SHA1 (patch-configure) = 1631314dab18886ea553ee53fac89e16718cacab | |
8 | SHA1 (patch-src_joystick_bsd_SDL__sysjoystick.c) = 1c5756e47ad906235369b46b36d7b0b1ee776156 | 8 | SHA1 (patch-src_joystick_bsd_SDL__sysjoystick.c) = 1c5756e47ad906235369b46b36d7b0b1ee776156 | |
9 | SHA1 (patch-src_video_cocoa_SDL__cocoawindow.m) = 1d5ac9c17ceadf668925734b5cad311e26f2fc58 | 9 | SHA1 (patch-src_video_cocoa_SDL__cocoawindow.m) = 1d5ac9c17ceadf668925734b5cad311e26f2fc58 | |
10 | SHA1 (patch-src_video_wayland_SDL__waylandevents.c) = 3a59fde90766bf1219ac204a2ce3596280a6dd2a | |||
10 | SHA1 (patch-src_video_x11_SDL__x11opengl.c) = 70b63021c12c52760c0811c673b259844bdfcdc0 | 11 | SHA1 (patch-src_video_x11_SDL__x11opengl.c) = 70b63021c12c52760c0811c673b259844bdfcdc0 |
@@ -1,18 +1,18 @@ | @@ -1,18 +1,18 @@ | |||
1 | # $NetBSD: options.mk,v 1.12 2019/05/27 17:21:01 nia Exp $ | 1 | # $NetBSD: options.mk,v 1.13 2019/08/18 16:16:24 nia Exp $ | |
2 | 2 | |||
3 | PKG_OPTIONS_VAR= PKG_OPTIONS.SDL2 | 3 | PKG_OPTIONS_VAR= PKG_OPTIONS.SDL2 | |
4 | PKG_OPTIONS_REQUIRED_GROUPS= gl | 4 | PKG_OPTIONS_REQUIRED_GROUPS= gl | |
5 | PKG_SUPPORTED_OPTIONS= alsa dbus esound nas oss jack pulseaudio x11 | 5 | PKG_SUPPORTED_OPTIONS= alsa dbus esound nas oss jack pulseaudio wayland x11 | |
6 | PKG_OPTIONS_GROUP.gl= opengl | 6 | PKG_OPTIONS_GROUP.gl= opengl | |
7 | PKG_SUGGESTED_OPTIONS+= oss | 7 | PKG_SUGGESTED_OPTIONS+= oss | |
8 | PKG_SUGGESTED_OPTIONS.Linux+= alsa | 8 | PKG_SUGGESTED_OPTIONS.Linux+= alsa | |
9 | 9 | |||
10 | .if ${OPSYS} != "Darwin" | 10 | .if ${OPSYS} != "Darwin" | |
11 | PKG_SUGGESTED_OPTIONS+= x11 | 11 | PKG_SUGGESTED_OPTIONS+= x11 | |
12 | .endif | 12 | .endif | |
13 | 13 | |||
14 | .include "../../mk/bsd.fast.prefs.mk" | 14 | .include "../../mk/bsd.fast.prefs.mk" | |
15 | 15 | |||
16 | .if !empty(MACHINE_ARCH:M*arm*) | 16 | .if !empty(MACHINE_ARCH:M*arm*) | |
17 | PKG_OPTIONS_GROUP.gl+= rpi | 17 | PKG_OPTIONS_GROUP.gl+= rpi | |
18 | PKG_SUGGESTED_OPTIONS+= rpi | 18 | PKG_SUGGESTED_OPTIONS+= rpi | |
@@ -81,13 +81,23 @@ CONFIGURE_ARGS+= --disable-pulseaudio | @@ -81,13 +81,23 @@ CONFIGURE_ARGS+= --disable-pulseaudio | |||
81 | .else | 81 | .else | |
82 | CONFIGURE_ARGS+= --disable-video-x11 | 82 | CONFIGURE_ARGS+= --disable-video-x11 | |
83 | .endif | 83 | .endif | |
84 | 84 | |||
85 | .if !empty(PKG_OPTIONS:Mrpi) | 85 | .if !empty(PKG_OPTIONS:Mrpi) | |
86 | LOWER_VENDOR= raspberry | 86 | LOWER_VENDOR= raspberry | |
87 | SUBST_CLASSES+= vc | 87 | SUBST_CLASSES+= vc | |
88 | SUBST_STAGE.vc= pre-configure | 88 | SUBST_STAGE.vc= pre-configure | |
89 | SUBST_MESSAGE.vc= Fixing path to VideoCore libraries. | 89 | SUBST_MESSAGE.vc= Fixing path to VideoCore libraries. | |
90 | SUBST_FILES.vc= configure | 90 | SUBST_FILES.vc= configure | |
91 | SUBST_SED.vc+= -e "s;/opt/vc;${PREFIX};g" | 91 | SUBST_SED.vc+= -e "s;/opt/vc;${PREFIX};g" | |
92 | .include "../../misc/raspberrypi-userland/buildlink3.mk" | 92 | .include "../../misc/raspberrypi-userland/buildlink3.mk" | |
93 | .endif | 93 | .endif | |
94 | ||||
95 | .if !empty(PKG_OPTIONS:Mwayland) | |||
96 | CONFIGURE_ARGS+= --enable-video-wayland | |||
97 | CONFIGURE_ARGS+= --disable-wayland-shared | |||
98 | .include "../../devel/wayland/buildlink3.mk" | |||
99 | .include "../../devel/wayland-protocols/buildlink3.mk" | |||
100 | .include "../../x11/libxkbcommon/buildlink3.mk" | |||
101 | .else | |||
102 | CONFIGURE_ARGS+= --disable-video-wayland | |||
103 | .endif |
$NetBSD: patch-src_video_wayland_SDL__waylandevents.c,v 1.1 2019/08/18 16:16:25 nia Exp $
Allow building with Wayland on operating systems without evdev.
--- src/video/wayland/SDL_waylandevents.c.orig 2019-07-25 04:32:36.000000000 +0000
+++ src/video/wayland/SDL_waylandevents.c
@@ -43,7 +43,15 @@
#include "xdg-shell-client-protocol.h"
#include "xdg-shell-unstable-v6-client-protocol.h"
+#ifdef __linux
#include <linux/input.h>
+#else
+#define BTN_LEFT (0)
+#define BTN_MIDDLE (1)
+#define BTN_RIGHT (2)
+#define BTN_SIDE (3)
+#define BTN_EXTRA (4)
+#endif
#include <sys/select.h>
#include <sys/mman.h>
#include <poll.h>