summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--devel/Makefile1
-rw-r--r--devel/sdl12-compat/Makefile60
-rw-r--r--devel/sdl12-compat/distinfo3
-rw-r--r--devel/sdl12-compat/pkg-descr6
-rw-r--r--devel/sdl12-compat/pkg-plist42
-rw-r--r--devel/sdl12/Makefile2
6 files changed, 114 insertions, 0 deletions
diff --git a/devel/Makefile b/devel/Makefile
index 90eb401fceb8..15cd1b65d205 100644
--- a/devel/Makefile
+++ b/devel/Makefile
@@ -6863,6 +6863,7 @@
SUBDIR += scons
SUBDIR += sd-mux-ctrl
SUBDIR += sdl12
+ SUBDIR += sdl12-compat
SUBDIR += sdl20
SUBDIR += sdl2pp
SUBDIR += sdl_console
diff --git a/devel/sdl12-compat/Makefile b/devel/sdl12-compat/Makefile
new file mode 100644
index 000000000000..151a74c678e1
--- /dev/null
+++ b/devel/sdl12-compat/Makefile
@@ -0,0 +1,60 @@
+PORTNAME= sdl12-compat
+PORTVERSION= s20210901
+CATEGORIES= devel
+
+MAINTAINER= jbeich@FreeBSD.org
+COMMENT= SDL-1.2 compatibility layer that uses SDL 2.0 behind the scenes
+
+LICENSE= ZLIB
+LICENSE_FILE= ${WRKSRC}/LICENSE.txt
+
+CONFLICTS_INSTALL= sdl
+
+USES= cmake:testing gl localbase sdl
+USE_GITHUB= yes
+USE_GL= glu
+USE_LDCONFIG= yes
+USE_SDL= sdl2
+CMAKE_OFF+= ${CMAKE_TESTING_ON}
+CMAKE_TESTING_ON= SDL12TESTS
+CMAKE_TESTING_TARGET= # post-test
+GH_ACCOUNT= libsdl-org
+GH_TAGNAME= dae1119
+
+post-patch:
+# Replace sdl12 for pkg-config consumers a la sdl-config
+ @${REINPLACE_CMD} -e '/DESTINATION/s/pkgconfig/& RENAME sdl.pc/' \
+ ${WRKSRC}/CMakeLists.txt
+# <alloca.h> doesn't exist on BSDs and is included by <stdlib.h> on Linux
+ @${REINPLACE_CMD} -e '/ALLOCA_H/d' \
+ ${WRKSRC}/include/SDL/SDL_config.h
+
+pre-test:
+# Enable RPATH for test executables to avoid LD_LIBRARY_PATH
+ @${REINPLACE_CMD} -i.tests -e '/CMAKE_SKIP_RPATH/d' \
+ ${WRKSRC}/CMakeLists.txt
+
+post-test: # subset known to work
+.for t in ver error file platform thread timer
+ (cd ${TEST_WRKSRC} && ./test$t)
+.endfor
+ (cd ${TEST_WRKSRC} && ./testloadso libpthread.so pthread_create)
+ (cd ${TEST_WRKSRC} && ./torturethread)
+# (cd ${TEST_WRKSRC} && ./testiconv) # FAIL: UCS4
+# (cd ${TEST_WRKSRC} && timeout 10 ./testlock) # hangs
+# (cd ${TEST_WRKSRC} && timeout -s ABRT 20 ./testsem mysem) # hangs
+.if exists(/dev/dsp)
+ (cd ${TEST_WRKSRC} && timeout --preserve-status 10 ./loopwave)
+.endif
+.if defined(WAYLAND_DISPLAY) || defined(DISPLAY) || exists(/dev/dri/card0)
+# Text-only: finishes without interaction
+. for t in vidinfo joystick keys blitspeed
+ (cd ${TEST_WRKSRC} && ./test$t)
+. endfor
+# Window: finishes via user input or timeout
+. for t in bitmap gl overlay overlay2 sprite win
+ (cd ${TEST_WRKSRC} && timeout --preserve-status 3 ./test$t)
+. endfor
+.endif
+
+.include <bsd.port.mk>
diff --git a/devel/sdl12-compat/distinfo b/devel/sdl12-compat/distinfo
new file mode 100644
index 000000000000..8ba29b330c2d
--- /dev/null
+++ b/devel/sdl12-compat/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1630508188
+SHA256 (libsdl-org-sdl12-compat-s20210901-dae1119_GH0.tar.gz) = 7dab7efd60165e5afbcc9c06c569eed2e37c814e9dec221d9fe1f37389395387
+SIZE (libsdl-org-sdl12-compat-s20210901-dae1119_GH0.tar.gz) = 410633
diff --git a/devel/sdl12-compat/pkg-descr b/devel/sdl12-compat/pkg-descr
new file mode 100644
index 000000000000..7dc2c43d16bf
--- /dev/null
+++ b/devel/sdl12-compat/pkg-descr
@@ -0,0 +1,6 @@
+This code is a compatibility layer; it provides a binary and source
+compatible API for programs written against SDL 1.2, but it uses SDL 2.0
+behind the scenes. If you are writing new code, please target SDL 2.0
+directly and do not use this layer.
+
+WWW: https://github.com/libsdl-org/sdl12-compat
diff --git a/devel/sdl12-compat/pkg-plist b/devel/sdl12-compat/pkg-plist
new file mode 100644
index 000000000000..225484ef672a
--- /dev/null
+++ b/devel/sdl12-compat/pkg-plist
@@ -0,0 +1,42 @@
+bin/sdl-config
+include/SDL/SDL.h
+include/SDL/SDL_active.h
+include/SDL/SDL_audio.h
+include/SDL/SDL_byteorder.h
+include/SDL/SDL_cdrom.h
+include/SDL/SDL_config.h
+include/SDL/SDL_config.h.bak
+include/SDL/SDL_copying.h
+include/SDL/SDL_cpuinfo.h
+include/SDL/SDL_endian.h
+include/SDL/SDL_error.h
+include/SDL/SDL_events.h
+include/SDL/SDL_getenv.h
+include/SDL/SDL_joystick.h
+include/SDL/SDL_keyboard.h
+include/SDL/SDL_keysym.h
+include/SDL/SDL_loadso.h
+include/SDL/SDL_main.h
+include/SDL/SDL_mouse.h
+include/SDL/SDL_mutex.h
+include/SDL/SDL_name.h
+include/SDL/SDL_opengl.h
+include/SDL/SDL_platform.h
+include/SDL/SDL_quit.h
+include/SDL/SDL_rwops.h
+include/SDL/SDL_stdinc.h
+include/SDL/SDL_syswm.h
+include/SDL/SDL_thread.h
+include/SDL/SDL_timer.h
+include/SDL/SDL_types.h
+include/SDL/SDL_version.h
+include/SDL/SDL_video.h
+include/SDL/begin_code.h
+include/SDL/close_code.h
+lib/libSDL-1.2.so
+lib/libSDL-1.2.so.0
+lib/libSDL-1.2.so.1.2.50
+lib/libSDL.so
+lib/libSDLmain.a
+libdata/pkgconfig/sdl.pc
+share/aclocal/sdl.m4
diff --git a/devel/sdl12/Makefile b/devel/sdl12/Makefile
index 7a979cd0b043..4a2fb142e101 100644
--- a/devel/sdl12/Makefile
+++ b/devel/sdl12/Makefile
@@ -16,6 +16,8 @@ LICENSE_FILE= ${WRKSRC}/COPYING
BUILD_DEPENDS= nasm:devel/nasm
+CONFLICTS_INSTALL= sdl12-compat
+
USES= gmake iconv libtool localbase:ldflags pathfix pkgconfig
USE_LDCONFIG= yes