pkgsrc-WIP-changes archive

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

sdl12-compat: Import from devel to work on Darwin breakage



Module Name:	pkgsrc-wip
Committed By:	Jason Bacon <bacon%NetBSD.org@localhost>
Pushed By:	outpaddling
Date:		Sat Oct 28 09:18:59 2023 -0500
Changeset:	4f2c81add7de3e8d6fe73ec668d987fa50f93b4e

Modified Files:
	Makefile
Added Files:
	sdl12-compat/DESCR
	sdl12-compat/Makefile
	sdl12-compat/PLIST
	sdl12-compat/buildlink3.mk
	sdl12-compat/distinfo
	sdl12-compat/patches/patch-CMakeLists.txt
	sdl12-compat/patches/patch-include_SDL_SDL__config.h

Log Message:
sdl12-compat: Import from devel to work on Darwin breakage

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=4f2c81add7de3e8d6fe73ec668d987fa50f93b4e

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 Makefile                                           |  1 +
 sdl12-compat/DESCR                                 |  8 +++++
 sdl12-compat/Makefile                              | 36 +++++++++++++++++++
 sdl12-compat/PLIST                                 | 42 ++++++++++++++++++++++
 sdl12-compat/buildlink3.mk                         | 21 +++++++++++
 sdl12-compat/distinfo                              |  7 ++++
 sdl12-compat/patches/patch-CMakeLists.txt          | 33 +++++++++++++++++
 .../patches/patch-include_SDL_SDL__config.h        | 25 +++++++++++++
 8 files changed, 173 insertions(+)

diffs:
diff --git a/Makefile b/Makefile
index c297119854..dddd896622 100644
--- a/Makefile
+++ b/Makefile
@@ -4993,6 +4993,7 @@ SUBDIR+=	sdd
 SUBDIR+=	sddm
 SUBDIR+=	sdict-tools
 SUBDIR+=	sdif-git
+SUBDIR+=	sdl12-compat
 SUBDIR+=	seafile-client
 SUBDIR+=	seafile-gui
 SUBDIR+=	seafile-server
diff --git a/sdl12-compat/DESCR b/sdl12-compat/DESCR
new file mode 100644
index 0000000000..4a4fac9641
--- /dev/null
+++ b/sdl12-compat/DESCR
@@ -0,0 +1,8 @@
+This is the Simple DirectMedia Layer, a general API that provides low level
+access to audio, keyboard, mouse, joystick, 3D hardware via OpenGL, and 2D
+framebuffer across multiple platforms.
+
+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.
diff --git a/sdl12-compat/Makefile b/sdl12-compat/Makefile
new file mode 100644
index 0000000000..93278e5275
--- /dev/null
+++ b/sdl12-compat/Makefile
@@ -0,0 +1,36 @@
+# $NetBSD: Makefile,v 1.6 2023/05/06 19:09:11 ryoon Exp $
+
+DISTNAME=	sdl12-compat-1.2.52
+PKGREVISION=	3
+CATEGORIES=	devel
+MASTER_SITES=	${MASTER_SITE_GITHUB:=libsdl-org/}
+GITHUB_TAG=	release-${PKGVERSION_NOREV}
+
+MAINTAINER=	nia%NetBSD.org@localhost
+HOMEPAGE=	https://github.com/libsdl-org/sdl12-compat
+COMMENT=	SDL-1.2 compatibility layer that uses SDL 2.0 behind the scenes
+LICENSE=	zlib
+
+USE_CMAKE=	yes
+
+CONFLICTS+=	SDL-[0-9]*
+
+PKGCONFIG_OVERRIDE+=	sdl12_compat.pc.in
+
+SUBST_CLASSES+=			install_name
+SUBST_STAGE.install_name=	post-configure
+SUBST_FILES.install_name=	CMakeFiles/SDL.dir/link.txt
+SUBST_SED.install_name=		-e 's|@rpath|${PREFIX}/lib|g'
+
+CMAKE_ARGS+=	-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON
+
+post-install:
+	${RM} ${DESTDIR}${PREFIX}/include/SDL/*.orig
+
+.include "../../devel/SDL2/buildlink3.mk"
+.include "../../mk/bsd.prefs.mk"
+.if ${OPSYS} != "Darwin"
+.  include "../../graphics/MesaLib/buildlink3.mk"
+.  include "../../graphics/glu/buildlink3.mk"
+.endif
+.include "../../mk/bsd.pkg.mk"
diff --git a/sdl12-compat/PLIST b/sdl12-compat/PLIST
new file mode 100644
index 0000000000..3ac3b59e09
--- /dev/null
+++ b/sdl12-compat/PLIST
@@ -0,0 +1,42 @@
+@comment $NetBSD: PLIST,v 1.1 2022/04/01 10:43:05 nia Exp $
+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_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.${PKGVERSION}
+lib/libSDL.so
+lib/libSDLmain.a
+lib/pkgconfig/sdl12_compat.pc
+share/aclocal/sdl.m4
diff --git a/sdl12-compat/buildlink3.mk b/sdl12-compat/buildlink3.mk
new file mode 100644
index 0000000000..d7a4150d07
--- /dev/null
+++ b/sdl12-compat/buildlink3.mk
@@ -0,0 +1,21 @@
+# $NetBSD: buildlink3.mk,v 1.2 2022/04/21 06:56:18 nia Exp $
+
+BUILDLINK_TREE+=	sdl12-compat
+
+.if !defined(SDL12_COMPAT_BUILDLINK3_MK)
+SDL12_COMPAT_BUILDLINK3_MK:=
+
+BUILDLINK_API_DEPENDS.sdl12-compat+=	sdl12-compat>=1.2.52
+BUILDLINK_PKGSRCDIR.sdl12-compat?=	../../wip/sdl12-compat
+BUILDLINK_INCDIRS.sdl12-compat+=	include/SDL
+
+.include "../../mk/bsd.fast.prefs.mk"
+
+.if ${OPSYS} != "Darwin"
+.  include "../../graphics/MesaLib/buildlink3.mk"
+.  include "../../graphics/glu/buildlink3.mk"
+.endif
+
+.endif	# SDL12_COMPAT_BUILDLINK3_MK
+
+BUILDLINK_TREE+=	-sdl12-compat
diff --git a/sdl12-compat/distinfo b/sdl12-compat/distinfo
new file mode 100644
index 0000000000..f464f00fdf
--- /dev/null
+++ b/sdl12-compat/distinfo
@@ -0,0 +1,7 @@
+$NetBSD: distinfo,v 1.1 2022/04/01 10:43:05 nia Exp $
+
+BLAKE2s (sdl12-compat-1.2.52.tar.gz) = d8abf6a0bfa94472c664208232c654ea358aff157f4c14f8c508b887d7801479
+SHA512 (sdl12-compat-1.2.52.tar.gz) = cd8f34f61ee9c6d0bd635f4c7a6f3cfb6bb570976f3bf843f1e3893b3a86d087a40bdf5f6bb2de16c9534ec42bc846b6ff599ac557c3b088c447e6106e2558f9
+Size (sdl12-compat-1.2.52.tar.gz) = 421046 bytes
+SHA1 (patch-CMakeLists.txt) = ca6c1fc0c32c4e68f6d1f9bcf988f5bcdbecfa5b
+SHA1 (patch-include_SDL_SDL__config.h) = 96eb020bb246e111d4240f94f68a1f5e49222070
diff --git a/sdl12-compat/patches/patch-CMakeLists.txt b/sdl12-compat/patches/patch-CMakeLists.txt
new file mode 100644
index 0000000000..277dad7dd2
--- /dev/null
+++ b/sdl12-compat/patches/patch-CMakeLists.txt
@@ -0,0 +1,33 @@
+$NetBSD: patch-CMakeLists.txt,v 1.1 2022/04/01 10:43:05 nia Exp $
+
+Not every unix system has libdl.
+
+--- CMakeLists.txt.orig	2022-03-03 14:56:56.000000000 +0000
++++ CMakeLists.txt
+@@ -71,7 +71,7 @@ string(STRIP "${CMAKE_C_FLAGS}" CMAKE_C_
+ 
+ if(UNIX AND NOT APPLE)
+     set_target_properties(SDL PROPERTIES COMPILE_DEFINITIONS "_REENTRANT")
+-    target_link_libraries(SDL PRIVATE dl)
++    target_link_libraries(SDL PRIVATE ${CMAKE_DL_LIBS})
+ endif()
+ if(APPLE)
+     set_target_properties(SDL PROPERTIES INSTALL_NAME_DIR "")
+@@ -254,7 +254,7 @@ if(SDL12DEVEL)
+       set(SDL_CFLAGS "-D_GNU_SOURCE=1 -D_REENTRANT")
+       set(SDL_RLD_FLAGS "")  # !!! FIXME: this forces rpath, which we might want?
+       set(SDL_LIBS "-lSDL")
+-      set(SDL_STATIC_LIBS "-ldl")
++      set(SDL_STATIC_LIBS ${CMAKE_DL_LIBS})
+       if(NOT STATICDEVEL)
+         set(SDL_STATIC_LIBS "")
+       endif()
+@@ -297,7 +297,7 @@ if(STATICDEVEL AND SDL12DEVEL)
+   add_library(SDL-static STATIC ${SDL12COMPAT_SRCS})
+   target_include_directories(SDL-static PRIVATE ${SDL2_INCLUDE_DIRS})
+   set_target_properties(SDL-static PROPERTIES COMPILE_DEFINITIONS "_REENTRANT")
+-  target_link_libraries(SDL-static PRIVATE dl)
++  target_link_libraries(SDL-static PRIVATE ${CMAKE_DL_LIBS})
+   set_target_properties(SDL-static PROPERTIES
+           VERSION "${PROJECT_VERSION}"
+         OUTPUT_NAME "SDL")
diff --git a/sdl12-compat/patches/patch-include_SDL_SDL__config.h b/sdl12-compat/patches/patch-include_SDL_SDL__config.h
new file mode 100644
index 0000000000..0d925214f7
--- /dev/null
+++ b/sdl12-compat/patches/patch-include_SDL_SDL__config.h
@@ -0,0 +1,25 @@
+$NetBSD: patch-include_SDL_SDL__config.h,v 1.1 2022/04/01 10:43:05 nia Exp $
+
+Not every Unix system has alloca.h.
+
+--- include/SDL/SDL_config.h.orig	2022-03-03 14:56:56.000000000 +0000
++++ include/SDL/SDL_config.h
+@@ -59,7 +59,6 @@ has these C runtime functions available.
+ stage, though. Send patches if your platform lacks something. */
+ #ifndef _WIN32
+ #define HAVE_LIBC 1
+-#define HAVE_ALLOCA_H 1
+ #define HAVE_SYS_TYPES_H 1
+ #define HAVE_STDIO_H 1
+ #define STDC_HEADERS 1
+@@ -72,6 +71,10 @@ stage, though. Send patches if your plat
+ #define HAVE_MATH_H 1
+ #endif
+ 
++#if defined(__linux__) || defined(__sun)
++#define HAVE_ALLOCA_H 1
++#endif
++
+ #if defined(__unix__) || defined(__APPLE__)
+ #define HAVE_ICONV_H 1
+ #define HAVE_SIGNAL_H 1


Home | Main Index | Thread Index | Old Index