import SDL2-2.0.3 as devel/SDL2-legacy-darwin
This is the version of SDL2 from TigerPorts and TigerBrew. Simple DirectMedia Layer is a cross-platform development library designed to provide low level access to audio, keyboard, mouse, joystick, and graphics hardware via OpenGL and Direct3D. It is used by video playback software, emulators, and popular games including Valve's award winning catalog and many Humble Bundle games. SDL officially supports Windows, Mac OS X, Linux, iOS, and Android. Support for other platforms may be found in the source code. SDL is written in C, works natively with C++, and there are bindings available for several other languages, including C# and Python. SDL 2.0 is distributed under the zlib license. This license allows you to use SDL freely in any software. This package is based on an older version of SDL2 suitable for use with legacy platforms such as PowerPC versions of Mac OS X. Features such as synchronous audio are unavailable. It may also be useful for developers seeking to target a wide range of SDL2 versions.
This commit is contained in:
parent
5edfb6d05d
commit
b2100aa71f
19
devel/SDL2-legacy-darwin/DESCR
Normal file
19
devel/SDL2-legacy-darwin/DESCR
Normal file
|
@ -0,0 +1,19 @@
|
|||
Simple DirectMedia Layer is a cross-platform development library designed to
|
||||
provide low level access to audio, keyboard, mouse, joystick, and graphics
|
||||
hardware via OpenGL and Direct3D. It is used by video playback software,
|
||||
emulators, and popular games including Valve's award winning catalog and many
|
||||
Humble Bundle games.
|
||||
|
||||
SDL officially supports Windows, Mac OS X, Linux, iOS, and Android. Support for
|
||||
other platforms may be found in the source code.
|
||||
|
||||
SDL is written in C, works natively with C++, and there are bindings available
|
||||
for several other languages, including C# and Python.
|
||||
|
||||
SDL 2.0 is distributed under the zlib license. This license allows you to use
|
||||
SDL freely in any software.
|
||||
|
||||
This package is based on an older version of SDL2 suitable for use with
|
||||
legacy platforms such as PowerPC versions of Mac OS X. Features such as
|
||||
synchronous audio are unavailable. It may also be useful for developers
|
||||
seeking to target a wide range of SDL2 versions.
|
49
devel/SDL2-legacy-darwin/Makefile
Normal file
49
devel/SDL2-legacy-darwin/Makefile
Normal file
|
@ -0,0 +1,49 @@
|
|||
# $NetBSD: Makefile,v 1.1 2023/11/12 21:28:04 nia Exp $
|
||||
|
||||
DISTNAME= SDL2-2.0.3
|
||||
CATEGORIES= devel
|
||||
MASTER_SITES= https://libsdl.org/release/
|
||||
|
||||
MAINTAINER= nia@NetBSD.org
|
||||
HOMEPAGE= https://www.libsdl.org/
|
||||
COMMENT= Legacy SDL2 suitable for old Mac OS X versions
|
||||
LICENSE= zlib
|
||||
|
||||
USE_LIBTOOL= yes
|
||||
USE_TOOLS+= gmake pkg-config
|
||||
GNU_CONFIGURE= yes
|
||||
|
||||
# Let pkgsrc handle the rpath.
|
||||
CONFIGURE_ARGS+= --disable-rpath
|
||||
|
||||
# Explicitly link against libraries.
|
||||
CONFIGURE_ARGS+= --disable-alsa-shared
|
||||
CONFIGURE_ARGS+= --disable-pulseaudio-shared
|
||||
CONFIGURE_ARGS+= --disable-x11-shared
|
||||
|
||||
# Deprecated, removed from pkgsrc.
|
||||
CONFIGURE_ARGS+= --disable-esd
|
||||
|
||||
CONFIGURE_ARGS+= --disable-video-wayland
|
||||
CONFIGURE_ARGS.Darwin+= --disable-haptic
|
||||
|
||||
# Needed to support the older joystick controller.
|
||||
LDFLAGS.Darwin+= -framework ForceFeedback
|
||||
|
||||
.include "../../mk/bsd.prefs.mk"
|
||||
|
||||
# Runtime detection is lacking and illegal instruction faults happen
|
||||
# on e.g. QEMU with -cpu pentium.
|
||||
.if ${MACHINE_ARCH} == "i386"
|
||||
CONFIGURE_ARGS+= --disable-sse
|
||||
CONFIGURE_ARGS+= --disable-ssemath
|
||||
CONFIGURE_ARGS+= --disable-sse2
|
||||
.endif
|
||||
|
||||
PKGCONFIG_OVERRIDE+= sdl2.pc.in
|
||||
|
||||
.include "options.mk"
|
||||
.include "../../converters/libiconv/buildlink3.mk"
|
||||
.include "../../mk/dlopen.buildlink3.mk"
|
||||
.include "../../mk/pthread.buildlink3.mk"
|
||||
.include "../../mk/bsd.pkg.mk"
|
71
devel/SDL2-legacy-darwin/PLIST
Normal file
71
devel/SDL2-legacy-darwin/PLIST
Normal file
|
@ -0,0 +1,71 @@
|
|||
@comment $NetBSD: PLIST,v 1.1 2023/11/12 21:28:04 nia Exp $
|
||||
bin/sdl2-config
|
||||
include/SDL2/SDL.h
|
||||
include/SDL2/SDL_assert.h
|
||||
include/SDL2/SDL_atomic.h
|
||||
include/SDL2/SDL_audio.h
|
||||
include/SDL2/SDL_bits.h
|
||||
include/SDL2/SDL_blendmode.h
|
||||
include/SDL2/SDL_clipboard.h
|
||||
include/SDL2/SDL_config.h
|
||||
include/SDL2/SDL_cpuinfo.h
|
||||
include/SDL2/SDL_endian.h
|
||||
include/SDL2/SDL_error.h
|
||||
include/SDL2/SDL_events.h
|
||||
include/SDL2/SDL_filesystem.h
|
||||
include/SDL2/SDL_gamecontroller.h
|
||||
include/SDL2/SDL_gesture.h
|
||||
include/SDL2/SDL_haptic.h
|
||||
include/SDL2/SDL_hints.h
|
||||
include/SDL2/SDL_joystick.h
|
||||
include/SDL2/SDL_keyboard.h
|
||||
include/SDL2/SDL_keycode.h
|
||||
include/SDL2/SDL_loadso.h
|
||||
include/SDL2/SDL_log.h
|
||||
include/SDL2/SDL_main.h
|
||||
include/SDL2/SDL_messagebox.h
|
||||
include/SDL2/SDL_mouse.h
|
||||
include/SDL2/SDL_mutex.h
|
||||
include/SDL2/SDL_name.h
|
||||
include/SDL2/SDL_opengl.h
|
||||
include/SDL2/SDL_opengles.h
|
||||
include/SDL2/SDL_opengles2.h
|
||||
include/SDL2/SDL_pixels.h
|
||||
include/SDL2/SDL_platform.h
|
||||
include/SDL2/SDL_power.h
|
||||
include/SDL2/SDL_quit.h
|
||||
include/SDL2/SDL_rect.h
|
||||
include/SDL2/SDL_render.h
|
||||
include/SDL2/SDL_revision.h
|
||||
include/SDL2/SDL_rwops.h
|
||||
include/SDL2/SDL_scancode.h
|
||||
include/SDL2/SDL_shape.h
|
||||
include/SDL2/SDL_stdinc.h
|
||||
include/SDL2/SDL_surface.h
|
||||
include/SDL2/SDL_system.h
|
||||
include/SDL2/SDL_syswm.h
|
||||
include/SDL2/SDL_test.h
|
||||
include/SDL2/SDL_test_assert.h
|
||||
include/SDL2/SDL_test_common.h
|
||||
include/SDL2/SDL_test_compare.h
|
||||
include/SDL2/SDL_test_crc32.h
|
||||
include/SDL2/SDL_test_font.h
|
||||
include/SDL2/SDL_test_fuzzer.h
|
||||
include/SDL2/SDL_test_harness.h
|
||||
include/SDL2/SDL_test_images.h
|
||||
include/SDL2/SDL_test_log.h
|
||||
include/SDL2/SDL_test_md5.h
|
||||
include/SDL2/SDL_test_random.h
|
||||
include/SDL2/SDL_thread.h
|
||||
include/SDL2/SDL_timer.h
|
||||
include/SDL2/SDL_touch.h
|
||||
include/SDL2/SDL_types.h
|
||||
include/SDL2/SDL_version.h
|
||||
include/SDL2/SDL_video.h
|
||||
include/SDL2/begin_code.h
|
||||
include/SDL2/close_code.h
|
||||
lib/libSDL2.la
|
||||
lib/libSDL2_test.a
|
||||
lib/libSDL2main.a
|
||||
lib/pkgconfig/sdl2.pc
|
||||
share/aclocal/sdl2.m4
|
50
devel/SDL2-legacy-darwin/buildlink3.mk
Normal file
50
devel/SDL2-legacy-darwin/buildlink3.mk
Normal file
|
@ -0,0 +1,50 @@
|
|||
# $NetBSD: buildlink3.mk,v 1.1 2023/11/12 21:28:04 nia Exp $
|
||||
|
||||
BUILDLINK_TREE+= SDL2
|
||||
|
||||
.if !defined(SDL2_BUILDLINK3_MK)
|
||||
SDL2_BUILDLINK3_MK:=
|
||||
|
||||
BUILDLINK_ABI_DEPENDS.SDL2+= SDL2>=2.0.3
|
||||
BUILDLINK_API_DEPENDS.SDL2+= SDL2>=2.0.3<2.1.0
|
||||
BUILDLINK_PKGSRCDIR.SDL2?= ../../devel/SDL2-legacy-darwin
|
||||
BUILDLINK_INCDIRS.SDL2+= include/SDL2
|
||||
|
||||
pkgbase := SDL2
|
||||
.include "../../mk/pkg-build-options.mk"
|
||||
|
||||
.if ${PKG_BUILD_OPTIONS.SDL2:Malsa}
|
||||
.include "../../audio/alsa-lib/buildlink3.mk"
|
||||
.endif
|
||||
|
||||
.if ${PKG_BUILD_OPTIONS.SDL2:Mpulseaudio}
|
||||
.include "../../audio/pulseaudio/buildlink3.mk"
|
||||
.endif
|
||||
|
||||
.if ${PKG_BUILD_OPTIONS.SDL2:Mnas}
|
||||
.include "../../audio/nas/buildlink3.mk"
|
||||
.endif
|
||||
|
||||
.if ${PKG_BUILD_OPTIONS.SDL2:Mopengl} && ${OPSYS} != "Darwin"
|
||||
.include "../../graphics/MesaLib/buildlink3.mk"
|
||||
.endif
|
||||
|
||||
.if ${PKG_BUILD_OPTIONS.SDL2:Mrpi}
|
||||
.include "../../misc/raspberrypi-userland/buildlink3.mk"
|
||||
.endif
|
||||
|
||||
.if ${PKG_BUILD_OPTIONS.SDL2:Mx11}
|
||||
.include "../../x11/libXcursor/buildlink3.mk"
|
||||
.include "../../x11/libXi/buildlink3.mk"
|
||||
.include "../../x11/libXinerama/buildlink3.mk"
|
||||
.include "../../x11/libXrandr/buildlink3.mk"
|
||||
.include "../../x11/libXScrnSaver/buildlink3.mk"
|
||||
.endif
|
||||
|
||||
.include "../../converters/libiconv/buildlink3.mk"
|
||||
.include "../../mk/dlopen.buildlink3.mk"
|
||||
.include "../../mk/pthread.buildlink3.mk"
|
||||
|
||||
.endif # SDL2_BUILDLINK3_MK
|
||||
|
||||
BUILDLINK_TREE+= -SDL2
|
26
devel/SDL2-legacy-darwin/distinfo
Normal file
26
devel/SDL2-legacy-darwin/distinfo
Normal file
|
@ -0,0 +1,26 @@
|
|||
$NetBSD: distinfo,v 1.1 2023/11/12 21:28:04 nia Exp $
|
||||
|
||||
BLAKE2s (SDL2-2.0.3.tar.gz) = 8b452c9d005e8b6da7b1cb8ab3e019522894714aa75c3c5ff100b49b1e75d1f6
|
||||
SHA512 (SDL2-2.0.3.tar.gz) = b6d2485154fbc07ab86a4305485e116d35fac25a97033b9e1c65ee0eb8251a18209cb1de3a914d9c0ddc53aa1ffac66c865b111d218e79eb5a10ed00dfec7540
|
||||
Size (SDL2-2.0.3.tar.gz) = 3871267 bytes
|
||||
SHA1 (patch-include_SDL__platform.h) = 6342e9528e5f5ecaae76a9cc9b196e0a7c0994ab
|
||||
SHA1 (patch-include_SDL__syswm.h) = f0a20f2536a7c0079053ff3a5069a580b036e9ec
|
||||
SHA1 (patch-src_audio_coreaudio_SDL__coreaudio.h) = 74d1a7782a177407b5ed571a8b86ea0ce7638048
|
||||
SHA1 (patch-src_cpuinfo_SDL__cpuinfo.c) = aa77236a2f9e6a662bb7671eb3a5a481a1a9478f
|
||||
SHA1 (patch-src_file_cocoa_SDL__rwopsbundlesupport.m) = 0fbd9d7f0f07ae3d00eaee7228305859d1109fb4
|
||||
SHA1 (patch-src_filesystem_cocoa_SDL__sysfilesystem.m) = f19fffa10898ac8bc772089af5b020c5246d3c41
|
||||
SHA1 (patch-src_joystick_darwin_SDL__sysjoystick.c) = c3c0490b51413003bb09a68489cb8fd67dab6ee3
|
||||
SHA1 (patch-src_joystick_darwin_SDL__sysjoystick__c.h) = a6b1e701949b7ea7173e01c586138c5938c0e6d0
|
||||
SHA1 (patch-src_power_macosx_SDL__syspower.c) = fbca2984f8738ed3b74417a209c2bdef69f06dd0
|
||||
SHA1 (patch-src_thread_pthread_SDL__systhread.c) = 13772719c7a2d2a408d3b5838636d51f25575965
|
||||
SHA1 (patch-src_video_cocoa_SDL__cocoaclipboard.m) = a9af5f93b3c96cebd7495159f0cb6257ae0bbfd1
|
||||
SHA1 (patch-src_video_cocoa_SDL__cocoakeyboard.m) = 1795e77319d759b4c372fe72adf3c4a1ae02ede0
|
||||
SHA1 (patch-src_video_cocoa_SDL__cocoamessagebox.m) = d3195f9c560205531957d0380608ce60fc42abec
|
||||
SHA1 (patch-src_video_cocoa_SDL__cocoamodes.m) = ac7e6996da2323d9f8b0bbc0520839d98181b949
|
||||
SHA1 (patch-src_video_cocoa_SDL__cocoamouse.h) = 12128f15544e898c02f700f48a644e836848ca55
|
||||
SHA1 (patch-src_video_cocoa_SDL__cocoaopengl.m) = 6d1099e16c491577bd033a77d87f5b35e9a96829
|
||||
SHA1 (patch-src_video_cocoa_SDL__cocoavideo.h) = eb74c336f935c3308cd31ef2b7c344cae98372b6
|
||||
SHA1 (patch-src_video_cocoa_SDL__cocoavideo.m) = 0f508c257ed89b6c0680d277e5bfb5aa5391f97c
|
||||
SHA1 (patch-src_video_cocoa_SDL__cocoawindow.h) = 4a0fe88e8f6d22afeb3587e23309b548abd60568
|
||||
SHA1 (patch-src_video_cocoa_SDL__cocoawindow.m) = 93903df0d968994b4c1c88f588ac5c11324ba318
|
||||
SHA1 (patch-src_video_x11_SDL__x11opengl.c) = 6df31f56c49a2173ee4ac78286c93a54ae8a9156
|
72
devel/SDL2-legacy-darwin/options.mk
Normal file
72
devel/SDL2-legacy-darwin/options.mk
Normal file
|
@ -0,0 +1,72 @@
|
|||
# $NetBSD: options.mk,v 1.1 2023/11/12 21:28:04 nia Exp $
|
||||
|
||||
PKG_OPTIONS_VAR= PKG_OPTIONS.SDL2
|
||||
PKG_OPTIONS_OPTIONAL_GROUPS= gl
|
||||
PKG_SUPPORTED_OPTIONS= alsa dbus nas pulseaudio x11
|
||||
PKG_SUGGESTED_OPTIONS.Linux= alsa
|
||||
PKG_OPTIONS_GROUP.gl= opengl
|
||||
PKG_SUGGESTED_OPTIONS+= opengl
|
||||
|
||||
.include "../../mk/bsd.fast.prefs.mk"
|
||||
|
||||
.if ${OPSYS} == "NetBSD" && ${MACHINE_ARCH:Mearm*}
|
||||
PKG_OPTIONS_GROUP.gl+= rpi
|
||||
.endif
|
||||
|
||||
.if ${OPSYS} != "Darwin"
|
||||
PKG_SUGGESTED_OPTIONS+= x11
|
||||
.endif
|
||||
|
||||
.include "../../mk/bsd.options.mk"
|
||||
|
||||
.if !empty(PKG_OPTIONS:Malsa)
|
||||
.include "../../audio/alsa-lib/buildlink3.mk"
|
||||
.else
|
||||
CONFIGURE_ARGS+= --disable-alsa
|
||||
.endif
|
||||
|
||||
.if !empty(PKG_OPTIONS:Mdbus)
|
||||
.include "../../sysutils/dbus/buildlink3.mk"
|
||||
.else
|
||||
CONFIGURE_ARGS+= --disable-dbus
|
||||
.endif
|
||||
|
||||
.if !empty(PKG_OPTIONS:Mnas)
|
||||
.include "../../audio/nas/buildlink3.mk"
|
||||
.else
|
||||
CONFIGURE_ARGS+= --disable-nas
|
||||
.endif
|
||||
|
||||
.if !empty(PKG_OPTIONS:Mopengl)
|
||||
. if ${OPSYS} != "Darwin"
|
||||
.include "../../graphics/MesaLib/buildlink3.mk"
|
||||
. endif
|
||||
.else
|
||||
CONFIGURE_ARGS+= --disable-video-opengl
|
||||
.endif
|
||||
|
||||
.if !empty(PKG_OPTIONS:Mpulseaudio)
|
||||
.include "../../audio/pulseaudio/buildlink3.mk"
|
||||
.else
|
||||
CONFIGURE_ARGS+= --disable-pulseaudio
|
||||
.endif
|
||||
|
||||
.if !empty(PKG_OPTIONS:Mx11)
|
||||
.include "../../x11/libXScrnSaver/buildlink3.mk"
|
||||
.include "../../x11/libXcursor/buildlink3.mk"
|
||||
.include "../../x11/libXi/buildlink3.mk"
|
||||
.include "../../x11/libXinerama/buildlink3.mk"
|
||||
.include "../../x11/libXrandr/buildlink3.mk"
|
||||
.else
|
||||
CONFIGURE_ARGS+= --disable-video-x11
|
||||
.endif
|
||||
|
||||
.if !empty(PKG_OPTIONS:Mrpi)
|
||||
LOWER_VENDOR= raspberry
|
||||
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"
|
||||
.include "../../misc/raspberrypi-userland/buildlink3.mk"
|
||||
.endif
|
|
@ -0,0 +1,26 @@
|
|||
$NetBSD: patch-include_SDL__platform.h,v 1.1 2023/11/12 21:28:04 nia Exp $
|
||||
|
||||
Restore support for Mac OS X 10.4, from "TigerPorts":
|
||||
https://raw.githubusercontent.com/evanmiller/TigerPorts/master/devel/libsdl2/files/patch-SDL2-2.0.3_OSX_104.diff
|
||||
|
||||
--- include/SDL_platform.h.orig 2014-03-16 02:31:42.000000000 +0000
|
||||
+++ include/SDL_platform.h
|
||||
@@ -70,7 +70,7 @@
|
||||
/* lets us know what version of Mac OS X we're compiling on */
|
||||
#include "AvailabilityMacros.h"
|
||||
#include "TargetConditionals.h"
|
||||
-#if TARGET_OS_IPHONE
|
||||
+#if defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE
|
||||
/* if compiling for iPhone */
|
||||
#undef __IPHONEOS__
|
||||
#define __IPHONEOS__ 1
|
||||
@@ -80,7 +80,9 @@
|
||||
#undef __MACOSX__
|
||||
#define __MACOSX__ 1
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED < 1050
|
||||
+#if 0
|
||||
# error SDL for Mac OS X only supports deploying on 10.5 and above.
|
||||
+#endif
|
||||
#endif /* MAC_OS_X_VERSION_MIN_REQUIRED < 1050 */
|
||||
#endif /* TARGET_OS_IPHONE */
|
||||
#endif /* defined(__APPLE__) */
|
20
devel/SDL2-legacy-darwin/patches/patch-include_SDL__syswm.h
Normal file
20
devel/SDL2-legacy-darwin/patches/patch-include_SDL__syswm.h
Normal file
|
@ -0,0 +1,20 @@
|
|||
$NetBSD: patch-include_SDL__syswm.h,v 1.1 2023/11/12 21:28:04 nia Exp $
|
||||
|
||||
Restore support for Mac OS X 10.4, from "TigerPorts":
|
||||
https://raw.githubusercontent.com/evanmiller/TigerPorts/master/devel/libsdl2/files/patch-SDL2-2.0.3_OSX_104.diff
|
||||
|
||||
--- include/SDL_syswm.h.orig 2014-03-16 02:31:42.000000000 +0000
|
||||
+++ include/SDL_syswm.h
|
||||
@@ -83,6 +83,12 @@ struct SDL_SysWMinfo;
|
||||
|
||||
#if defined(SDL_VIDEO_DRIVER_COCOA)
|
||||
#ifdef __OBJC__
|
||||
+#if defined(__ALTIVEC__) && !defined(MAC_OS_X_VERSION_10_5)
|
||||
+/* to cricumvent a bug in Mac OS X 10.4 SDK */
|
||||
+#define vector __vector
|
||||
+#include <CoreServices/CoreServices.h>
|
||||
+#undef vector
|
||||
+#endif
|
||||
#include <Cocoa/Cocoa.h>
|
||||
#else
|
||||
typedef struct _NSWindow NSWindow;
|
|
@ -0,0 +1,22 @@
|
|||
$NetBSD: patch-src_audio_coreaudio_SDL__coreaudio.h,v 1.1 2023/11/12 21:28:04 nia Exp $
|
||||
|
||||
Restore support for Mac OS X 10.4, from "TigerPorts":
|
||||
https://raw.githubusercontent.com/evanmiller/TigerPorts/master/devel/libsdl2/files/patch-SDL2-2.0.3_OSX_104.diff
|
||||
|
||||
--- src/audio/coreaudio/SDL_coreaudio.h.orig 2014-03-16 02:31:44.000000000 +0000
|
||||
+++ src/audio/coreaudio/SDL_coreaudio.h
|
||||
@@ -31,7 +31,14 @@
|
||||
|
||||
#if MACOSX_COREAUDIO
|
||||
#include <CoreAudio/CoreAudio.h>
|
||||
+#if defined(__ALTIVEC__) && !defined(MAC_OS_X_VERSION_10_5)
|
||||
+/* to cricumvent a bug in Mac OS X 10.4 SDK */
|
||||
+#define vector __vector
|
||||
#include <CoreServices/CoreServices.h>
|
||||
+#undef vector
|
||||
+#else
|
||||
+#include <CoreServices/CoreServices.h>
|
||||
+#endif
|
||||
#else
|
||||
#include <AudioToolbox/AudioToolbox.h>
|
||||
#endif
|
|
@ -0,0 +1,17 @@
|
|||
$NetBSD: patch-src_cpuinfo_SDL__cpuinfo.c,v 1.1 2023/11/12 21:28:04 nia Exp $
|
||||
|
||||
NetBSD support.
|
||||
|
||||
--- src/cpuinfo/SDL_cpuinfo.c.orig 2014-03-16 02:31:44.000000000 +0000
|
||||
+++ src/cpuinfo/SDL_cpuinfo.c
|
||||
@@ -665,7 +665,9 @@ SDL_GetSystemRAM(void)
|
||||
#endif
|
||||
#ifdef HAVE_SYSCTLBYNAME
|
||||
if (SDL_SystemRAM <= 0) {
|
||||
-#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
|
||||
+#ifdef HW_PHYSMEM64
|
||||
+ int mib[2] = {CTL_HW, HW_PHYSMEM64};
|
||||
+#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
|
||||
#ifdef HW_REALMEM
|
||||
int mib[2] = {CTL_HW, HW_REALMEM};
|
||||
#else
|
|
@ -0,0 +1,20 @@
|
|||
$NetBSD: patch-src_file_cocoa_SDL__rwopsbundlesupport.m,v 1.1 2023/11/12 21:28:04 nia Exp $
|
||||
|
||||
Restore support for Mac OS X 10.4, from "TigerPorts":
|
||||
https://raw.githubusercontent.com/evanmiller/TigerPorts/master/devel/libsdl2/files/patch-SDL2-2.0.3_OSX_104.diff
|
||||
|
||||
--- src/file/cocoa/SDL_rwopsbundlesupport.m.orig 2014-03-16 02:31:41.000000000 +0000
|
||||
+++ src/file/cocoa/SDL_rwopsbundlesupport.m
|
||||
@@ -21,6 +21,12 @@
|
||||
#include "../../SDL_internal.h"
|
||||
|
||||
#ifdef __APPLE__
|
||||
+#if defined(__ALTIVEC__) && !defined(MAC_OS_X_VERSION_10_5)
|
||||
+/* to cricumvent a bug in Mac OS X 10.4 SDK */
|
||||
+#define vector __vector
|
||||
+#include <CoreServices/CoreServices.h>
|
||||
+#undef vector
|
||||
+#endif
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
#include "SDL_rwopsbundlesupport.h"
|
|
@ -0,0 +1,20 @@
|
|||
$NetBSD: patch-src_filesystem_cocoa_SDL__sysfilesystem.m,v 1.1 2023/11/12 21:28:04 nia Exp $
|
||||
|
||||
Restore support for Mac OS X 10.4, from "TigerPorts":
|
||||
https://raw.githubusercontent.com/evanmiller/TigerPorts/master/devel/libsdl2/files/patch-SDL2-2.0.3_OSX_104.diff
|
||||
|
||||
--- src/filesystem/cocoa/SDL_sysfilesystem.m.orig 2014-03-16 02:31:41.000000000 +0000
|
||||
+++ src/filesystem/cocoa/SDL_sysfilesystem.m
|
||||
@@ -25,6 +25,12 @@
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
||||
/* System dependent filesystem routines */
|
||||
|
||||
+#if defined(__ALTIVEC__) && !defined(MAC_OS_X_VERSION_10_5)
|
||||
+/* to cricumvent a bug in Mac OS X 10.4 SDK */
|
||||
+#define vector __vector
|
||||
+#include <CoreServices/CoreServices.h>
|
||||
+#undef vector
|
||||
+#endif
|
||||
#include <Foundation/Foundation.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/types.h>
|
File diff suppressed because it is too large
Load diff
|
@ -0,0 +1,88 @@
|
|||
$NetBSD: patch-src_joystick_darwin_SDL__sysjoystick__c.h,v 1.1 2023/11/12 21:28:04 nia Exp $
|
||||
|
||||
Restore support for Mac OS X 10.4, from "TigerPorts".
|
||||
|
||||
--- src/joystick/darwin/SDL_sysjoystick_c.h.orig 2014-03-16 02:31:41.000000000 +0000
|
||||
+++ src/joystick/darwin/SDL_sysjoystick_c.h
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
Simple DirectMedia Layer
|
||||
- Copyright (C) 1997-2014 Sam Lantinga <slouken@libsdl.org>
|
||||
+ Copyright (C) 1997-2013 Sam Lantinga <slouken@libsdl.org>
|
||||
|
||||
This software is provided 'as-is', without any express or implied
|
||||
warranty. In no event will the authors be held liable for any damages
|
||||
@@ -18,23 +18,38 @@
|
||||
misrepresented as being the original software.
|
||||
3. This notice may not be removed or altered from any source distribution.
|
||||
*/
|
||||
-#include "../../SDL_internal.h"
|
||||
+#include "SDL_config.h"
|
||||
|
||||
#ifndef SDL_JOYSTICK_IOKIT_H
|
||||
|
||||
+
|
||||
#include <IOKit/hid/IOHIDLib.h>
|
||||
+#include <IOKit/hid/IOHIDKeys.h>
|
||||
+#include <IOKit/IOKitLib.h>
|
||||
+
|
||||
|
||||
struct recElement
|
||||
{
|
||||
- IOHIDElementRef elementRef;
|
||||
- IOHIDElementCookie cookie;
|
||||
- uint32_t usagePage, usage; /* HID usage */
|
||||
- SInt32 min; /* reported min value possible */
|
||||
- SInt32 max; /* reported max value possible */
|
||||
+ IOHIDElementCookie cookie; /* unique value which identifies element, will NOT change */
|
||||
+ long usagePage, usage; /* HID usage */
|
||||
+ long min; /* reported min value possible */
|
||||
+ long max; /* reported max value possible */
|
||||
+#if 0
|
||||
+ /* TODO: maybe should handle the following stuff somehow? */
|
||||
+
|
||||
+ long scaledMin; /* reported scaled min value possible */
|
||||
+ long scaledMax; /* reported scaled max value possible */
|
||||
+ long size; /* size in bits of data return from element */
|
||||
+ Boolean relative; /* are reports relative to last report (deltas) */
|
||||
+ Boolean wrapping; /* does element wrap around (one value higher than max is min) */
|
||||
+ Boolean nonLinear; /* are the values reported non-linear relative to element movement */
|
||||
+ Boolean preferredState; /* does element have a preferred state (such as a button) */
|
||||
+ Boolean nullState; /* does element have null state */
|
||||
+#endif /* 0 */
|
||||
|
||||
/* runtime variables used for auto-calibration */
|
||||
- SInt32 minReport; /* min returned value */
|
||||
- SInt32 maxReport; /* max returned value */
|
||||
+ long minReport; /* min returned value */
|
||||
+ long maxReport; /* max returned value */
|
||||
|
||||
struct recElement *pNext; /* next element in list */
|
||||
};
|
||||
@@ -42,17 +57,19 @@ typedef struct recElement recElement;
|
||||
|
||||
struct joystick_hwdata
|
||||
{
|
||||
- IOHIDDeviceRef deviceRef; /* HIDManager device handle */
|
||||
io_service_t ffservice; /* Interface for force feedback, 0 = no ff */
|
||||
+ IOHIDDeviceInterface **interface; /* interface to device, NULL = no interface */
|
||||
+ IONotificationPortRef notificationPort; /* port to be notified on joystick removal */
|
||||
+ io_iterator_t portIterator; /* iterator for removal callback */
|
||||
|
||||
char product[256]; /* name of product */
|
||||
- uint32_t usage; /* usage page from IOUSBHID Parser.h which defines general usage */
|
||||
- uint32_t usagePage; /* usage within above page from IOUSBHID Parser.h which defines specific usage */
|
||||
+ long usage; /* usage page from IOUSBHID Parser.h which defines general usage */
|
||||
+ long usagePage; /* usage within above page from IOUSBHID Parser.h which defines specific usage */
|
||||
|
||||
- int axes; /* number of axis (calculated, not reported by device) */
|
||||
- int buttons; /* number of buttons (calculated, not reported by device) */
|
||||
- int hats; /* number of hat switches (calculated, not reported by device) */
|
||||
- int elements; /* number of total elements (should be total of above) (calculated, not reported by device) */
|
||||
+ long axes; /* number of axis (calculated, not reported by device) */
|
||||
+ long buttons; /* number of buttons (calculated, not reported by device) */
|
||||
+ long hats; /* number of hat switches (calculated, not reported by device) */
|
||||
+ long elements; /* number of total elements (should be total of above) (calculated, not reported by device) */
|
||||
|
||||
recElement *firstAxis;
|
||||
recElement *firstButton;
|
|
@ -0,0 +1,20 @@
|
|||
$NetBSD: patch-src_power_macosx_SDL__syspower.c,v 1.1 2023/11/12 21:28:04 nia Exp $
|
||||
|
||||
Restore support for Mac OS X 10.4, from "TigerPorts":
|
||||
https://raw.githubusercontent.com/evanmiller/TigerPorts/master/devel/libsdl2/files/patch-SDL2-2.0.3_OSX_104.diff
|
||||
|
||||
--- src/power/macosx/SDL_syspower.c.orig 2014-03-16 02:31:42.000000000 +0000
|
||||
+++ src/power/macosx/SDL_syspower.c
|
||||
@@ -23,6 +23,12 @@
|
||||
#ifndef SDL_POWER_DISABLED
|
||||
#if SDL_POWER_MACOSX
|
||||
|
||||
+#if defined(__ALTIVEC__) && !defined(MAC_OS_X_VERSION_10_5)
|
||||
+/* to cricumvent a bug in Mac OS X 10.4 SDK */
|
||||
+#define vector __vector
|
||||
+#include <CoreServices/CoreServices.h>
|
||||
+#undef vector
|
||||
+#endif
|
||||
#include <Carbon/Carbon.h>
|
||||
#include <IOKit/ps/IOPowerSources.h>
|
||||
#include <IOKit/ps/IOPSKeys.h>
|
|
@ -0,0 +1,15 @@
|
|||
$NetBSD: patch-src_thread_pthread_SDL__systhread.c,v 1.1 2023/11/12 21:28:04 nia Exp $
|
||||
|
||||
NetBSD support. This was upstreamed ages ago.
|
||||
|
||||
--- src/thread/pthread/SDL_systhread.c.orig 2014-03-16 02:31:44.000000000 +0000
|
||||
+++ src/thread/pthread/SDL_systhread.c
|
||||
@@ -128,6 +128,8 @@ SDL_SYS_SetupThread(const char *name)
|
||||
ppthread_setname_np(pthread_self(), name);
|
||||
#endif
|
||||
}
|
||||
+ #elif defined(__NetBSD__)
|
||||
+ pthread_setname_np(pthread_self(), "%s", name);
|
||||
#elif HAVE_PTHREAD_SETNAME_NP
|
||||
pthread_setname_np(pthread_self(), name);
|
||||
#elif HAVE_PTHREAD_SET_NAME_NP
|
|
@ -0,0 +1,23 @@
|
|||
$NetBSD: patch-src_video_cocoa_SDL__cocoaclipboard.m,v 1.1 2023/11/12 21:28:04 nia Exp $
|
||||
|
||||
Restore support for Mac OS X 10.4, from "TigerPorts":
|
||||
https://raw.githubusercontent.com/evanmiller/TigerPorts/master/devel/libsdl2/files/patch-SDL2-2.0.3_OSX_104.diff
|
||||
|
||||
--- src/video/cocoa/SDL_cocoaclipboard.m.orig 2014-03-16 02:31:45.000000000 +0000
|
||||
+++ src/video/cocoa/SDL_cocoaclipboard.m
|
||||
@@ -30,11 +30,15 @@ GetTextFormat(_THIS)
|
||||
{
|
||||
SDL_VideoData *data = (SDL_VideoData *) _this->driverdata;
|
||||
|
||||
+#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
|
||||
if (data->osversion >= 0x1060) {
|
||||
return NSPasteboardTypeString;
|
||||
} else {
|
||||
+#endif
|
||||
return NSStringPboardType;
|
||||
+#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
|
||||
}
|
||||
+#endif
|
||||
}
|
||||
|
||||
int
|
|
@ -0,0 +1,23 @@
|
|||
$NetBSD: patch-src_video_cocoa_SDL__cocoakeyboard.m,v 1.1 2023/11/12 21:28:04 nia Exp $
|
||||
|
||||
Restore support for Mac OS X 10.4, from "TigerPorts":
|
||||
https://raw.githubusercontent.com/evanmiller/TigerPorts/master/devel/libsdl2/files/patch-SDL2-2.0.3_OSX_104.diff
|
||||
|
||||
--- src/video/cocoa/SDL_cocoakeyboard.m.orig 2014-03-16 02:31:45.000000000 +0000
|
||||
+++ src/video/cocoa/SDL_cocoakeyboard.m
|
||||
@@ -426,6 +426,7 @@ HandleModifiers(_THIS, unsigned short sc
|
||||
static void
|
||||
UpdateKeymap(SDL_VideoData *data)
|
||||
{
|
||||
+#if defined(MAC_OS_X_VERSION_10_5)
|
||||
TISInputSourceRef key_layout;
|
||||
const void *chr_data;
|
||||
int i;
|
||||
@@ -483,6 +484,7 @@ UpdateKeymap(SDL_VideoData *data)
|
||||
|
||||
cleanup:
|
||||
CFRelease(key_layout);
|
||||
+#endif
|
||||
}
|
||||
|
||||
void
|
|
@ -0,0 +1,21 @@
|
|||
$NetBSD: patch-src_video_cocoa_SDL__cocoamessagebox.m,v 1.1 2023/11/12 21:28:04 nia Exp $
|
||||
|
||||
The altivec header inclusion does not appear to be used in these files, and
|
||||
breaks non-Altivec builds.
|
||||
|
||||
--- src/video/cocoa/SDL_cocoamessagebox.m.orig 2014-03-16 02:31:45.000000000 +0000
|
||||
+++ src/video/cocoa/SDL_cocoamessagebox.m
|
||||
@@ -22,13 +22,6 @@
|
||||
|
||||
#if SDL_VIDEO_DRIVER_COCOA
|
||||
|
||||
-#if defined(__APPLE__) && defined(__POWERPC__) && !defined(__APPLE_ALTIVEC__)
|
||||
-#include <altivec.h>
|
||||
-#undef bool
|
||||
-#undef vector
|
||||
-#undef pixel
|
||||
-#endif
|
||||
-
|
||||
#include "SDL_events.h"
|
||||
#include "SDL_timer.h"
|
||||
#include "SDL_messagebox.h"
|
|
@ -0,0 +1,93 @@
|
|||
$NetBSD: patch-src_video_cocoa_SDL__cocoamodes.m,v 1.1 2023/11/12 21:28:04 nia Exp $
|
||||
|
||||
Restore support for Mac OS X 10.4, from "TigerPorts":
|
||||
https://raw.githubusercontent.com/evanmiller/TigerPorts/master/devel/libsdl2/files/patch-SDL2-2.0.3_OSX_104.diff
|
||||
|
||||
--- src/video/cocoa/SDL_cocoamodes.m.orig 2014-03-16 02:31:41.000000000 +0000
|
||||
+++ src/video/cocoa/SDL_cocoamodes.m
|
||||
@@ -127,6 +127,7 @@ GetDisplayMode(_THIS, const void *modere
|
||||
}
|
||||
data->moderef = moderef;
|
||||
|
||||
+ #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
|
||||
if (IS_SNOW_LEOPARD_OR_LATER(_this)) {
|
||||
CGDisplayModeRef vidmode = (CGDisplayModeRef) moderef;
|
||||
CFStringRef fmt = CGDisplayModeCopyPixelEncoding(vidmode);
|
||||
@@ -146,6 +147,7 @@ GetDisplayMode(_THIS, const void *modere
|
||||
|
||||
CFRelease(fmt);
|
||||
}
|
||||
+ #endif
|
||||
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED < 1060
|
||||
if (!IS_SNOW_LEOPARD_OR_LATER(_this)) {
|
||||
@@ -184,17 +186,21 @@ GetDisplayMode(_THIS, const void *modere
|
||||
static void
|
||||
Cocoa_ReleaseDisplayMode(_THIS, const void *moderef)
|
||||
{
|
||||
+ #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
|
||||
if (IS_SNOW_LEOPARD_OR_LATER(_this)) {
|
||||
CGDisplayModeRelease((CGDisplayModeRef) moderef); /* NULL is ok */
|
||||
}
|
||||
+ #endif
|
||||
}
|
||||
|
||||
static void
|
||||
Cocoa_ReleaseDisplayModeList(_THIS, CFArrayRef modelist)
|
||||
{
|
||||
+ #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
|
||||
if (IS_SNOW_LEOPARD_OR_LATER(_this)) {
|
||||
CFRelease(modelist); /* NULL is ok */
|
||||
}
|
||||
+ #endif
|
||||
}
|
||||
|
||||
static const char *
|
||||
@@ -257,9 +263,11 @@ Cocoa_InitModes(_THIS)
|
||||
continue;
|
||||
}
|
||||
|
||||
+ #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
|
||||
if (IS_SNOW_LEOPARD_OR_LATER(_this)) {
|
||||
moderef = CGDisplayCopyDisplayMode(displays[i]);
|
||||
}
|
||||
+ #endif
|
||||
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED < 1060
|
||||
if (!IS_SNOW_LEOPARD_OR_LATER(_this)) {
|
||||
@@ -319,9 +327,11 @@ Cocoa_GetDisplayModes(_THIS, SDL_VideoDi
|
||||
SDL_DisplayData *data = (SDL_DisplayData *) display->driverdata;
|
||||
CFArrayRef modes = NULL;
|
||||
|
||||
+ #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
|
||||
if (IS_SNOW_LEOPARD_OR_LATER(_this)) {
|
||||
modes = CGDisplayCopyAllDisplayModes(data->display, NULL);
|
||||
}
|
||||
+ #endif
|
||||
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED < 1060
|
||||
if (!IS_SNOW_LEOPARD_OR_LATER(_this)) {
|
||||
@@ -337,9 +347,11 @@ Cocoa_GetDisplayModes(_THIS, SDL_VideoDi
|
||||
const void *moderef = CFArrayGetValueAtIndex(modes, i);
|
||||
SDL_DisplayMode mode;
|
||||
if (GetDisplayMode(_this, moderef, &mode)) {
|
||||
+ #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
|
||||
if (IS_SNOW_LEOPARD_OR_LATER(_this)) {
|
||||
CGDisplayModeRetain((CGDisplayModeRef) moderef);
|
||||
}
|
||||
+ #endif
|
||||
SDL_AddDisplayMode(display, &mode);
|
||||
}
|
||||
}
|
||||
@@ -351,9 +363,11 @@ Cocoa_GetDisplayModes(_THIS, SDL_VideoDi
|
||||
static CGError
|
||||
Cocoa_SwitchMode(_THIS, CGDirectDisplayID display, const void *mode)
|
||||
{
|
||||
+ #if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
|
||||
if (IS_SNOW_LEOPARD_OR_LATER(_this)) {
|
||||
return CGDisplaySetDisplayMode(display, (CGDisplayModeRef) mode, NULL);
|
||||
}
|
||||
+ #endif
|
||||
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED < 1060
|
||||
if (!IS_SNOW_LEOPARD_OR_LATER(_this)) {
|
|
@ -0,0 +1,18 @@
|
|||
$NetBSD: patch-src_video_cocoa_SDL__cocoamouse.h,v 1.1 2023/11/12 21:28:04 nia Exp $
|
||||
|
||||
Restore support for Mac OS X 10.4, from "TigerPorts":
|
||||
https://raw.githubusercontent.com/evanmiller/TigerPorts/master/devel/libsdl2/files/patch-SDL2-2.0.3_OSX_104.diff
|
||||
|
||||
--- src/video/cocoa/SDL_cocoamouse.h.orig 2014-03-16 02:31:41.000000000 +0000
|
||||
+++ src/video/cocoa/SDL_cocoamouse.h
|
||||
@@ -25,6 +25,10 @@
|
||||
|
||||
#include "SDL_cocoavideo.h"
|
||||
|
||||
+#if !defined(MAC_OS_X_VERSION_10_5)
|
||||
+typedef float CGFloat;
|
||||
+#endif
|
||||
+
|
||||
extern void Cocoa_InitMouse(_THIS);
|
||||
extern void Cocoa_HandleMouseEvent(_THIS, NSEvent * event);
|
||||
extern void Cocoa_HandleMouseWheel(SDL_Window *window, NSEvent * event);
|
|
@ -0,0 +1,19 @@
|
|||
$NetBSD: patch-src_video_cocoa_SDL__cocoaopengl.m,v 1.1 2023/11/12 21:28:04 nia Exp $
|
||||
|
||||
Restore support for Mac OS X 10.4, from "TigerPorts":
|
||||
https://raw.githubusercontent.com/evanmiller/TigerPorts/master/devel/libsdl2/files/patch-SDL2-2.0.3_OSX_104.diff
|
||||
|
||||
--- src/video/cocoa/SDL_cocoaopengl.m.orig 2014-03-16 02:31:41.000000000 +0000
|
||||
+++ src/video/cocoa/SDL_cocoaopengl.m
|
||||
@@ -347,9 +347,11 @@ Cocoa_GL_GetDrawableSize(_THIS, SDL_Wind
|
||||
|
||||
/* This gives us the correct viewport for a Retina-enabled view, only
|
||||
* supported on 10.7+. */
|
||||
+#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
|
||||
if ([contentView respondsToSelector:@selector(convertRectToBacking:)]) {
|
||||
viewport = [contentView convertRectToBacking:viewport];
|
||||
}
|
||||
+#endif
|
||||
|
||||
if (w) {
|
||||
*w = viewport.size.width;
|
|
@ -0,0 +1,32 @@
|
|||
$NetBSD: patch-src_video_cocoa_SDL__cocoavideo.h,v 1.1 2023/11/12 21:28:04 nia Exp $
|
||||
|
||||
Restore support for Mac OS X 10.4, from "TigerPorts":
|
||||
https://raw.githubusercontent.com/evanmiller/TigerPorts/master/devel/libsdl2/files/patch-SDL2-2.0.3_OSX_104.diff
|
||||
|
||||
--- src/video/cocoa/SDL_cocoavideo.h.orig 2014-03-16 02:31:41.000000000 +0000
|
||||
+++ src/video/cocoa/SDL_cocoavideo.h
|
||||
@@ -25,6 +25,12 @@
|
||||
|
||||
#include "SDL_opengl.h"
|
||||
|
||||
+#if defined(__ALTIVEC__) && !defined(MAC_OS_X_VERSION_10_5)
|
||||
+/* to cricumvent a bug in Mac OS X 10.4 SDK */
|
||||
+#define vector __vector
|
||||
+#include <CoreServices/CoreServices.h>
|
||||
+#undef vector
|
||||
+#endif
|
||||
#include <ApplicationServices/ApplicationServices.h>
|
||||
#include <Cocoa/Cocoa.h>
|
||||
|
||||
@@ -39,6 +45,11 @@
|
||||
#include "SDL_cocoaopengl.h"
|
||||
#include "SDL_cocoawindow.h"
|
||||
|
||||
+#if !defined(MAC_OS_X_VERSION_10_5)
|
||||
+typedef long int NSInteger;
|
||||
+typedef unsigned int NSUInteger;
|
||||
+#endif
|
||||
+
|
||||
/* Private display data */
|
||||
|
||||
@class SDLTranslatorResponder;
|
|
@ -0,0 +1,21 @@
|
|||
$NetBSD: patch-src_video_cocoa_SDL__cocoavideo.m,v 1.1 2023/11/12 21:28:04 nia Exp $
|
||||
|
||||
The altivec header inclusion does not appear to be used in these files, and
|
||||
breaks non-Altivec builds.
|
||||
|
||||
--- src/video/cocoa/SDL_cocoavideo.m.orig 2014-03-16 02:31:41.000000000 +0000
|
||||
+++ src/video/cocoa/SDL_cocoavideo.m
|
||||
@@ -22,13 +22,6 @@
|
||||
|
||||
#if SDL_VIDEO_DRIVER_COCOA
|
||||
|
||||
-#if defined(__APPLE__) && defined(__POWERPC__) && !defined(__APPLE_ALTIVEC__)
|
||||
-#include <altivec.h>
|
||||
-#undef bool
|
||||
-#undef vector
|
||||
-#undef pixel
|
||||
-#endif
|
||||
-
|
||||
#include "SDL.h"
|
||||
#include "SDL_endian.h"
|
||||
#include "SDL_cocoavideo.h"
|
|
@ -0,0 +1,29 @@
|
|||
$NetBSD: patch-src_video_cocoa_SDL__cocoawindow.h,v 1.1 2023/11/12 21:28:04 nia Exp $
|
||||
|
||||
Restore support for Mac OS X 10.4, from "TigerPorts":
|
||||
https://raw.githubusercontent.com/evanmiller/TigerPorts/master/devel/libsdl2/files/patch-SDL2-2.0.3_OSX_104.diff
|
||||
|
||||
--- src/video/cocoa/SDL_cocoawindow.h.orig 2014-03-16 02:31:41.000000000 +0000
|
||||
+++ src/video/cocoa/SDL_cocoawindow.h
|
||||
@@ -35,7 +35,11 @@ typedef enum
|
||||
PENDING_OPERATION_MINIMIZE
|
||||
} PendingWindowOperation;
|
||||
|
||||
+#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
|
||||
@interface Cocoa_WindowListener : NSResponder <NSWindowDelegate> {
|
||||
+#else
|
||||
+@interface Cocoa_WindowListener : NSResponder {
|
||||
+#endif
|
||||
SDL_WindowData *_data;
|
||||
BOOL observingVisible;
|
||||
BOOL wasCtrlLeft;
|
||||
@@ -73,7 +77,9 @@ typedef enum
|
||||
-(void) windowDidEnterFullScreen:(NSNotification *) aNotification;
|
||||
-(void) windowWillExitFullScreen:(NSNotification *) aNotification;
|
||||
-(void) windowDidExitFullScreen:(NSNotification *) aNotification;
|
||||
+#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
|
||||
-(NSApplicationPresentationOptions)window:(NSWindow *)window willUseFullScreenPresentationOptions:(NSApplicationPresentationOptions)proposedOptions;
|
||||
+#endif
|
||||
|
||||
/* Window event handling */
|
||||
-(void) mouseDown:(NSEvent *) theEvent;
|
|
@ -0,0 +1,175 @@
|
|||
$NetBSD: patch-src_video_cocoa_SDL__cocoawindow.m,v 1.1 2023/11/12 21:28:04 nia Exp $
|
||||
|
||||
Restore support for Mac OS X 10.4, from "TigerPorts":
|
||||
https://raw.githubusercontent.com/evanmiller/TigerPorts/master/devel/libsdl2/files/patch-SDL2-2.0.3_OSX_104.diff
|
||||
|
||||
--- src/video/cocoa/SDL_cocoawindow.m.orig 2014-03-16 02:31:41.000000000 +0000
|
||||
+++ src/video/cocoa/SDL_cocoawindow.m
|
||||
@@ -23,7 +23,9 @@
|
||||
#if SDL_VIDEO_DRIVER_COCOA
|
||||
|
||||
#if MAC_OS_X_VERSION_MAX_ALLOWED < 1070
|
||||
+#if 0
|
||||
# error SDL for Mac OS X must be built with a 10.7 SDK or above.
|
||||
+#endif
|
||||
#endif /* MAC_OS_X_VERSION_MAX_ALLOWED < 1070 */
|
||||
|
||||
#include "SDL_syswm.h"
|
||||
@@ -100,7 +102,14 @@ ScheduleContextUpdates(SDL_WindowData *d
|
||||
NSOpenGLContext *currentContext = [NSOpenGLContext currentContext];
|
||||
NSMutableArray *contexts = data->nscontexts;
|
||||
@synchronized (contexts) {
|
||||
+#if defined(MAC_OS_X_VERSION_10_5)
|
||||
for (SDLOpenGLContext *context in contexts) {
|
||||
+#else
|
||||
+ /* old way to iterate */
|
||||
+ int i;
|
||||
+ for (i = 0; i < [contexts count]; i++) {
|
||||
+ SDLOpenGLContext *context = [contexts objectAtIndex:i];
|
||||
+#endif
|
||||
if (context == currentContext) {
|
||||
[context update];
|
||||
} else {
|
||||
@@ -190,10 +199,12 @@ SetWindowStyle(SDL_Window * window, unsi
|
||||
[center addObserver:self selector:@selector(windowDidDeminiaturize:) name:NSWindowDidDeminiaturizeNotification object:window];
|
||||
[center addObserver:self selector:@selector(windowDidBecomeKey:) name:NSWindowDidBecomeKeyNotification object:window];
|
||||
[center addObserver:self selector:@selector(windowDidResignKey:) name:NSWindowDidResignKeyNotification object:window];
|
||||
+#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
|
||||
[center addObserver:self selector:@selector(windowWillEnterFullScreen:) name:NSWindowWillEnterFullScreenNotification object:window];
|
||||
[center addObserver:self selector:@selector(windowDidEnterFullScreen:) name:NSWindowDidEnterFullScreenNotification object:window];
|
||||
[center addObserver:self selector:@selector(windowWillExitFullScreen:) name:NSWindowWillExitFullScreenNotification object:window];
|
||||
[center addObserver:self selector:@selector(windowDidExitFullScreen:) name:NSWindowDidExitFullScreenNotification object:window];
|
||||
+#endif
|
||||
} else {
|
||||
[window setDelegate:self];
|
||||
}
|
||||
@@ -212,9 +223,11 @@ SetWindowStyle(SDL_Window * window, unsi
|
||||
|
||||
[view setNextResponder:self];
|
||||
|
||||
+#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
|
||||
if ([view respondsToSelector:@selector(setAcceptsTouchEvents:)]) {
|
||||
[view setAcceptsTouchEvents:YES];
|
||||
}
|
||||
+#endif
|
||||
}
|
||||
|
||||
- (void)observeValueForKeyPath:(NSString *)keyPath
|
||||
@@ -282,7 +295,9 @@ SetWindowStyle(SDL_Window * window, unsi
|
||||
inFullscreenTransition = YES;
|
||||
|
||||
/* you need to be FullScreenPrimary, or toggleFullScreen doesn't work. Unset it again in windowDidExitFullScreen. */
|
||||
+#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
|
||||
[nswindow setCollectionBehavior:NSWindowCollectionBehaviorFullScreenPrimary];
|
||||
+#endif
|
||||
[nswindow performSelectorOnMainThread: @selector(toggleFullScreen:) withObject:nswindow waitUntilDone:NO];
|
||||
return YES;
|
||||
}
|
||||
@@ -319,10 +334,12 @@ SetWindowStyle(SDL_Window * window, unsi
|
||||
[center removeObserver:self name:NSWindowDidDeminiaturizeNotification object:window];
|
||||
[center removeObserver:self name:NSWindowDidBecomeKeyNotification object:window];
|
||||
[center removeObserver:self name:NSWindowDidResignKeyNotification object:window];
|
||||
+#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
|
||||
[center removeObserver:self name:NSWindowWillEnterFullScreenNotification object:window];
|
||||
[center removeObserver:self name:NSWindowDidEnterFullScreenNotification object:window];
|
||||
[center removeObserver:self name:NSWindowWillExitFullScreenNotification object:window];
|
||||
[center removeObserver:self name:NSWindowDidExitFullScreenNotification object:window];
|
||||
+#endif
|
||||
} else {
|
||||
[window setDelegate:nil];
|
||||
}
|
||||
@@ -346,8 +363,14 @@ SetWindowStyle(SDL_Window * window, unsi
|
||||
!!! FIXME: http://bugzilla.libsdl.org/show_bug.cgi?id=1825
|
||||
*/
|
||||
windows = [NSApp orderedWindows];
|
||||
- for (NSWindow *win in windows)
|
||||
- {
|
||||
+#if defined(MAC_OS_X_VERSION_10_5)
|
||||
+ for (NSWindow *win in windows) {
|
||||
+#else
|
||||
+ /* old way to iterate */
|
||||
+ int i;
|
||||
+ for (i = 0; i < [windows count]; i++) {
|
||||
+ NSWindow *win = [windows objectAtIndex:i];
|
||||
+#endif
|
||||
if (win == window) {
|
||||
continue;
|
||||
}
|
||||
@@ -597,12 +620,14 @@ SetWindowStyle(SDL_Window * window, unsi
|
||||
[nswindow miniaturize:nil];
|
||||
} else {
|
||||
/* Adjust the fullscreen toggle button and readd menu now that we're here. */
|
||||
+#if MAC_OS_X_VERSION_MIN_REQUIRED > 1070
|
||||
if (window->flags & SDL_WINDOW_RESIZABLE) {
|
||||
/* resizable windows are Spaces-friendly: they get the "go fullscreen" toggle button on their titlebar. */
|
||||
[nswindow setCollectionBehavior:NSWindowCollectionBehaviorFullScreenPrimary];
|
||||
} else {
|
||||
[nswindow setCollectionBehavior:NSWindowCollectionBehaviorManaged];
|
||||
}
|
||||
+#endif
|
||||
[NSMenu setMenuBarVisible:YES];
|
||||
|
||||
pendingWindowOperation = PENDING_OPERATION_NONE;
|
||||
@@ -620,6 +645,7 @@ SetWindowStyle(SDL_Window * window, unsi
|
||||
}
|
||||
}
|
||||
|
||||
+#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
|
||||
-(NSApplicationPresentationOptions)window:(NSWindow *)window willUseFullScreenPresentationOptions:(NSApplicationPresentationOptions)proposedOptions
|
||||
{
|
||||
if ((_data->window->flags & SDL_WINDOW_FULLSCREEN_DESKTOP) == SDL_WINDOW_FULLSCREEN_DESKTOP) {
|
||||
@@ -628,6 +654,7 @@ SetWindowStyle(SDL_Window * window, unsi
|
||||
return proposedOptions;
|
||||
}
|
||||
}
|
||||
+#endif
|
||||
|
||||
|
||||
/* We'll respond to key events by doing nothing so we don't beep.
|
||||
@@ -822,6 +849,7 @@ SetWindowStyle(SDL_Window * window, unsi
|
||||
[self handleTouches:COCOA_TOUCH_CANCELLED withEvent:theEvent];
|
||||
}
|
||||
|
||||
+#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
|
||||
- (void)handleTouches:(cocoaTouchType)type withEvent:(NSEvent *)event
|
||||
{
|
||||
NSSet *touches = 0;
|
||||
@@ -875,6 +903,7 @@ SetWindowStyle(SDL_Window * window, unsi
|
||||
touch = (NSTouch*)[enumerator nextObject];
|
||||
}
|
||||
}
|
||||
+#endif
|
||||
|
||||
@end
|
||||
|
||||
@@ -1040,6 +1069,7 @@ Cocoa_CreateWindow(_THIS, SDL_Window * w
|
||||
[nswindow setBackgroundColor:[NSColor blackColor]];
|
||||
|
||||
if (videodata->allow_spaces) {
|
||||
+#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
|
||||
SDL_assert(videodata->osversion >= 0x1070);
|
||||
SDL_assert([nswindow respondsToSelector:@selector(toggleFullScreen:)]);
|
||||
/* we put FULLSCREEN_DESKTOP windows in their own Space, without a toggle button or menubar, later */
|
||||
@@ -1047,6 +1077,7 @@ Cocoa_CreateWindow(_THIS, SDL_Window * w
|
||||
/* resizable windows are Spaces-friendly: they get the "go fullscreen" toggle button on their titlebar. */
|
||||
[nswindow setCollectionBehavior:NSWindowCollectionBehaviorFullScreenPrimary];
|
||||
}
|
||||
+#endif
|
||||
}
|
||||
|
||||
/* Create a default view for this window */
|
||||
@@ -1490,7 +1521,14 @@ Cocoa_DestroyWindow(_THIS, SDL_Window *
|
||||
}
|
||||
|
||||
NSArray *contexts = [[data->nscontexts copy] autorelease];
|
||||
+#if defined(MAC_OS_X_VERSION_10_5)
|
||||
for (SDLOpenGLContext *context in contexts) {
|
||||
+#else
|
||||
+ /* old way to iterate */
|
||||
+ int i;
|
||||
+ for (i = 0; i < [contexts count]; i++) {
|
||||
+ SDLOpenGLContext *context = [contexts objectAtIndex:i];
|
||||
+#endif
|
||||
/* Calling setWindow:NULL causes the context to remove itself from the context list. */
|
||||
[context setWindow:NULL];
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
$NetBSD: patch-src_video_x11_SDL__x11opengl.c,v 1.1 2023/11/12 21:28:04 nia Exp $
|
||||
|
||||
NetBSD support. This was upstreamed a long time ago.
|
||||
We can have different versioning systems depending on modular xorg vs. xsrc.
|
||||
|
||||
--- src/video/x11/SDL_x11opengl.c.orig 2014-03-16 02:31:44.000000000 +0000
|
||||
+++ src/video/x11/SDL_x11opengl.c
|
||||
@@ -31,7 +31,7 @@
|
||||
#include "SDL_loadso.h"
|
||||
#include "SDL_x11opengles.h"
|
||||
|
||||
-#if defined(__IRIX__)
|
||||
+#if defined(__IRIX__) || defined(__NetBSD__)
|
||||
/* IRIX doesn't have a GL library versioning system */
|
||||
#define DEFAULT_OPENGL "libGL.so"
|
||||
#elif defined(__MACOSX__)
|
|
@ -1,4 +1,4 @@
|
|||
# $NetBSD: Makefile,v 1.84 2023/11/02 19:34:12 adam Exp $
|
||||
# $NetBSD: Makefile,v 1.85 2023/11/12 21:28:04 nia Exp $
|
||||
|
||||
DISTNAME= SDL2-2.28.5
|
||||
CATEGORIES= devel
|
||||
|
@ -16,6 +16,9 @@ USE_LIBTOOL= yes
|
|||
USE_TOOLS+= gmake pkg-config
|
||||
GNU_CONFIGURE= yes
|
||||
|
||||
# See devel/SDL2-legacy-darwin
|
||||
NOT_FOR_PLATFORM+= Darwin-*-powerpc*
|
||||
|
||||
# Let pkgsrc handle the rpath.
|
||||
CONFIGURE_ARGS+= --disable-rpath
|
||||
|
||||
|
|
|
@ -1,7 +1,13 @@
|
|||
# $NetBSD: buildlink3.mk,v 1.18 2023/05/06 19:08:48 ryoon Exp $
|
||||
# $NetBSD: buildlink3.mk,v 1.19 2023/11/12 21:28:04 nia Exp $
|
||||
|
||||
BUILDLINK_TREE+= SDL2
|
||||
|
||||
.include "../../mk/bsd.fast.prefs.mk"
|
||||
.if ${MACHINE_PLATFORM:MDarwin-*-powerpc*}
|
||||
# This defines SDL2_BUILDLINK3_MK.
|
||||
. include "../../devel/SDL2-legacy-darwin/buildlink3.mk"
|
||||
.endif
|
||||
|
||||
.if !defined(SDL2_BUILDLINK3_MK)
|
||||
SDL2_BUILDLINK3_MK:=
|
||||
|
||||
|
|
Loading…
Reference in a new issue