diff options
author | snj <snj@pkgsrc.org> | 2015-02-09 08:27:07 +0000 |
---|---|---|
committer | snj <snj@pkgsrc.org> | 2015-02-09 08:27:07 +0000 |
commit | dd1b4cfcd8cd64d6286f59872ab45147d03899e6 (patch) | |
tree | 60b828559b44cc39298a493d7962fdd36088d831 | |
parent | 477bb477315acb3ee9d6cfa83609ef7bc438655e (diff) | |
download | pkgsrc-dd1b4cfcd8cd64d6286f59872ab45147d03899e6.tar.gz |
Switch SDL2 to the standard autotools build system. Upstream considers
the CMake build system to be experimental. This gets us working joystick
support on NetBSD, avoids installing bogus headers, and moves us to a sane
library major (which is highly unlikely to ever change again). Bump
PKGREVISION to 5 and set BUILDLINK_ABI_DEPENDS accordingly.
Recursive revbump coming up.
While here, tidy up this package's options a bit:
- instead of providing six (!) options for standard modern X libraries,
simply lump them all into the existing x11 option
- provide a dbus option
-rw-r--r-- | devel/SDL2/Makefile | 15 | ||||
-rw-r--r-- | devel/SDL2/PLIST | 20 | ||||
-rw-r--r-- | devel/SDL2/buildlink3.mk | 12 | ||||
-rw-r--r-- | devel/SDL2/distinfo | 4 | ||||
-rw-r--r-- | devel/SDL2/options.mk | 71 | ||||
-rw-r--r-- | devel/SDL2/patches/patch-CMakeLists.txt | 32 | ||||
-rw-r--r-- | devel/SDL2/patches/patch-src_thread_pthread_SDL__systhread.c | 18 |
7 files changed, 47 insertions, 125 deletions
diff --git a/devel/SDL2/Makefile b/devel/SDL2/Makefile index 7636ef8006d..326c6ecda43 100644 --- a/devel/SDL2/Makefile +++ b/devel/SDL2/Makefile @@ -1,7 +1,7 @@ -# $NetBSD: Makefile,v 1.9 2015/02/03 08:50:44 snj Exp $ +# $NetBSD: Makefile,v 1.10 2015/02/09 08:27:07 snj Exp $ DISTNAME= SDL2-2.0.3 -PKGREVISION= 4 +PKGREVISION= 5 CATEGORIES= devel MASTER_SITES= http://www.libsdl.org/release/ @@ -11,8 +11,9 @@ COMMENT= Simple DirectMedia Layer is a cross-platform multimedia library LICENSE= zlib USE_LANGUAGES= c c++ -USE_CMAKE= yes -USE_TOOLS+= pkg-config +GNU_CONFIGURE= YES +USE_LIBTOOL= YES +USE_TOOLS+= gmake pkg-config PKGCONFIG_OVERRIDE+= sdl2.pc.in @@ -22,12 +23,6 @@ PKGCONFIG_OVERRIDE+= sdl2.pc.in BUILDLINK_TRANSFORM+= rm:-ldl .endif -SUBST_CLASSES+= prefix -SUBST_FILES.prefix= build/cmake_install.cmake -SUBST_MESSAGE.prefix= Fixing PREFIX path. -SUBST_SED.prefix= -e "s|/usr/local|${PREFIX}|1" -SUBST_STAGE.prefix= pre-install - .include "options.mk" .include "../../converters/libiconv/buildlink3.mk" diff --git a/devel/SDL2/PLIST b/devel/SDL2/PLIST index fdf833a9b67..5cef2a17faf 100644 --- a/devel/SDL2/PLIST +++ b/devel/SDL2/PLIST @@ -1,4 +1,4 @@ -@comment $NetBSD: PLIST,v 1.4 2014/03/18 20:09:36 adam Exp $ +@comment $NetBSD: PLIST,v 1.5 2015/02/09 08:27:07 snj Exp $ bin/sdl2-config include/SDL2/SDL.h include/SDL2/SDL_assert.h @@ -8,18 +8,7 @@ include/SDL2/SDL_bits.h include/SDL2/SDL_blendmode.h include/SDL2/SDL_clipboard.h include/SDL2/SDL_config.h -include/SDL2/SDL_config_android.h -include/SDL2/SDL_config_iphoneos.h -include/SDL2/SDL_config_macosx.h -include/SDL2/SDL_config_minimal.h -include/SDL2/SDL_config_pandora.h -include/SDL2/SDL_config_psp.h -include/SDL2/SDL_config_windows.h -include/SDL2/SDL_config_winrt.h -include/SDL2/SDL_config_wiz.h -include/SDL2/SDL_copying.h include/SDL2/SDL_cpuinfo.h -include/SDL2/SDL_egl.h include/SDL2/SDL_endian.h include/SDL2/SDL_error.h include/SDL2/SDL_events.h @@ -75,11 +64,8 @@ include/SDL2/SDL_version.h include/SDL2/SDL_video.h include/SDL2/begin_code.h include/SDL2/close_code.h -lib/libSDL2-2.0.so -lib/libSDL2-2.0.so.0.2.1 -lib/libSDL2-2.0.so.1 -lib/libSDL2.a -lib/libSDL2.so +lib/libSDL2.la +lib/libSDL2_test.a lib/libSDL2main.a lib/pkgconfig/sdl2.pc share/aclocal/sdl2.m4 diff --git a/devel/SDL2/buildlink3.mk b/devel/SDL2/buildlink3.mk index 82c908beb0a..f5ed9ba51d2 100644 --- a/devel/SDL2/buildlink3.mk +++ b/devel/SDL2/buildlink3.mk @@ -1,10 +1,11 @@ -# $NetBSD: buildlink3.mk,v 1.1 2013/08/15 10:26:16 adam Exp $ +# $NetBSD: buildlink3.mk,v 1.2 2015/02/09 08:27:07 snj Exp $ BUILDLINK_TREE+= SDL2 .if !defined(SDL2_BUILDLINK3_MK) SDL2_BUILDLINK3_MK:= +BUILDLINK_ABI_DEPENDS.SDL2+= SDL2>=2.0.3nb5 BUILDLINK_API_DEPENDS.SDL2+= SDL2>=2.0 BUILDLINK_PKGSRCDIR.SDL2?= ../../devel/SDL2 BUILDLINK_INCDIRS.SDL2+= include/SDL2 @@ -18,10 +19,11 @@ pkgbase := SDL2 .include "../../converters/libiconv/buildlink3.mk" -.if ${OPSYS} != "Darwin" -. if !empty(PKG_BUILD_OPTIONS.SDL2:Mopengl) -. include "../../graphics/MesaLib/buildlink3.mk" -. endif +.if !empty(PKG_BUILD_OPTIONS.SDL2:Mopengl) && empty(OPSYS:MDarwin) +.include "../../graphics/MesaLib/buildlink3.mk" +.endif + +.if !empty(PKG_BUILD_OPTIONS.SDL2:Mx11) .include "../../x11/xproto/buildlink3.mk" .include "../../x11/libX11/buildlink3.mk" .endif diff --git a/devel/SDL2/distinfo b/devel/SDL2/distinfo index ae6b6c28710..66eb0c6f705 100644 --- a/devel/SDL2/distinfo +++ b/devel/SDL2/distinfo @@ -1,8 +1,8 @@ -$NetBSD: distinfo,v 1.5 2015/02/03 08:50:44 snj Exp $ +$NetBSD: distinfo,v 1.6 2015/02/09 08:27:07 snj 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-CMakeLists.txt) = b2bc2b520be6040bff6224fb3c103878c3820986 SHA1 (patch-src_cpuinfo_SDL_cpuinfo.c) = 9482910e62023b92e80ce4d3b670a1a1e666789f +SHA1 (patch-src_thread_pthread_SDL__systhread.c) = 68f32770d067d2b6dcffe96da2dd4aa6b4c82050 SHA1 (patch-src_video_x11_SDL__x11opengl.c) = a435634da8b8bd5e74a281b9a26e8fb8a294e56b diff --git a/devel/SDL2/options.mk b/devel/SDL2/options.mk index 48b19b8b866..ff615bb9c47 100644 --- a/devel/SDL2/options.mk +++ b/devel/SDL2/options.mk @@ -1,8 +1,7 @@ -# $NetBSD: options.mk,v 1.2 2015/02/03 08:50:44 snj Exp $ +# $NetBSD: options.mk,v 1.3 2015/02/09 08:27:07 snj Exp $ PKG_OPTIONS_VAR= PKG_OPTIONS.SDL2 -PKG_SUPPORTED_OPTIONS= alsa arts esound nas opengl oss pulseaudio -PKG_SUPPORTED_OPTIONS+= x11 xcursor xim xinerama xrandr xrender xscrnsaver +PKG_SUPPORTED_OPTIONS= alsa arts dbus esound nas opengl oss pulseaudio x11 PKG_SUGGESTED_OPTIONS+= oss opengl .if ${OPSYS} != "Darwin" @@ -13,98 +12,52 @@ PKG_SUGGESTED_OPTIONS+= x11 .if !empty(PKG_OPTIONS:Malsa) .include "../../audio/alsa-lib/buildlink3.mk" -CMAKE_ARGS+= -DALSA=ON -.else -CMAKE_ARGS+= -DALSA=OFF .endif .if !empty(PKG_OPTIONS:Marts) .include "../../audio/arts/buildlink3.mk" -CMAKE_ARGS+= -DARTS=ON -.else -CMAKE_ARGS+= -DARTS=OFF +.endif + +.if !empty(PKG_OPTIONS:Mdbus) +.include "../../sysutils/dbus/buildlink3.mk" .endif .if !empty(PKG_OPTIONS:Mesound) .include "../../audio/esound/buildlink3.mk" -CMAKE_ARGS+= -DESD=ON -.else -CMAKE_ARGS+= -DESD=OFF .endif .if !empty(PKG_OPTIONS:Mnas) .include "../../audio/nas/buildlink3.mk" -CMAKE_ARGS+= -DNAS=ON -.else -CMAKE_ARGS+= -DNAS=OFF .endif .if !empty(PKG_OPTIONS:Mopengl) . if ${OPSYS} != "Darwin" .include "../../graphics/MesaLib/buildlink3.mk" . endif -CMAKE_ARGS+= -DVIDEO_OPENGL=ON .else -CMAKE_ARGS+= -DVIDEO_OPENGL=OFF +CONFIGURE_ARGS+= --disable-video-opengl .endif .if !empty(PKG_OPTIONS:Moss) -CMAKE_ARGS+= -DOSS=ON +.include "../../mk/oss.buildlink3.mk" .else -CMAKE_ARGS+= -DOSS=OFF +CONFIGURE_ARGS+= --disable-oss .endif .if !empty(PKG_OPTIONS:Mpulseaudio) .include "../../audio/pulseaudio/buildlink3.mk" -CMAKE_ARGS+= -DPULSEAUDIO=ON -.else -CMAKE_ARGS+= -DPULSEAUDIO=OFF .endif .if !empty(PKG_OPTIONS:Mx11) .include "../../x11/libX11/buildlink3.mk" -.include "../../x11/libXext/buildlink3.mk" -.include "../../x11/xproto/buildlink3.mk" -CMAKE_ARGS+= -DX11_SHARED=ON -DVIDEO_X11=ON -.else -CMAKE_ARGS+= -DX11_SHARED=OFF -DVIDEO_X11=OFF -.endif - -.if !empty(PKG_OPTIONS:Mxcursor) .include "../../x11/libXcursor/buildlink3.mk" -CMAKE_ARGS+= -DVIDEO_X11_XCURSOR=ON -.else -CMAKE_ARGS+= -DVIDEO_X11_XCURSOR=OFF -.endif - -.if !empty(PKG_OPTIONS:Mxim) +.include "../../x11/libXext/buildlink3.mk" .include "../../x11/libXi/buildlink3.mk" -CMAKE_ARGS+= -DVIDEO_X11_XINPUT=ON -.else -CMAKE_ARGS+= -DVIDEO_X11_XINPUT=OFF -.endif - -.if !empty(PKG_OPTIONS:Mxinerama) .include "../../x11/libXinerama/buildlink3.mk" -CMAKE_ARGS+= -DVIDEO_X11_XINERAMA=ON -.else -CMAKE_ARGS+= -DVIDEO_X11_XINERAMA=OFF -.endif - -.if !empty(PKG_OPTIONS:Mxrandr) .include "../../x11/libXrandr/buildlink3.mk" -CMAKE_ARGS+= -DVIDEO_X11_XRANDR=ON -.else -CMAKE_ARGS+= -DVIDEO_X11_XRANDR=OFF -.endif - -.if !empty(PKG_OPTIONS:Mxrender) .include "../../x11/libXrender/buildlink3.mk" -.endif - -.if !empty(PKG_OPTIONS:Mxscrnsaver) .include "../../x11/libXScrnSaver/buildlink3.mk" -CMAKE_ARGS+= -DVIDEO_X11_XSCRNSAVER=ON +.include "../../x11/xproto/buildlink3.mk" .else -CMAKE_ARGS+= -DVIDEO_X11_XSCRNSAVER=OFF +CONFIGURE_ARGS+= --disable-video-x11 --disable-x11-shared .endif diff --git a/devel/SDL2/patches/patch-CMakeLists.txt b/devel/SDL2/patches/patch-CMakeLists.txt deleted file mode 100644 index 89e36773b4d..00000000000 --- a/devel/SDL2/patches/patch-CMakeLists.txt +++ /dev/null @@ -1,32 +0,0 @@ -$NetBSD: patch-CMakeLists.txt,v 1.3 2014/03/13 13:25:49 adam Exp $ - -Allow in-tree build. -Handle .dylib extension on Darwin. - ---- CMakeLists.txt.orig 2014-03-08 04:36:49.000000000 +0000 -+++ CMakeLists.txt -@@ -1,6 +1,3 @@ --if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR}) -- message(FATAL_ERROR "Prevented in-tree built. Please create a build directory outside of the SDL source code and call cmake from there") --endif() - - cmake_minimum_required(VERSION 2.6) - project(SDL2 C) -@@ -1283,10 +1280,15 @@ install(FILES ${INCLUDE_FILES} DESTINATI - - if(NOT WINDOWS OR CYGWIN) - if(SDL_SHARED) -+ if(APPLE) -+ set(SO_EXT "dylib") -+ else(APPLE) -+ set(SO_EXT "so") -+ endif(APPLE) - install(CODE " - execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink -- \"libSDL2-2.0.so\" \"libSDL2.so\")") -- install(FILES ${SDL2_BINARY_DIR}/libSDL2.so DESTINATION "lib${LIB_SUFFIX}") -+ \"libSDL2-2.0.${SO_EXT}\" \"libSDL2.${SO_EXT}\")") -+ install(FILES ${SDL2_BINARY_DIR}/libSDL2.${SO_EXT} DESTINATION "lib${LIB_SUFFIX}") - endif() - if(FREEBSD) - # FreeBSD uses ${PREFIX}/libdata/pkgconfig diff --git a/devel/SDL2/patches/patch-src_thread_pthread_SDL__systhread.c b/devel/SDL2/patches/patch-src_thread_pthread_SDL__systhread.c new file mode 100644 index 00000000000..74fe3ff075f --- /dev/null +++ b/devel/SDL2/patches/patch-src_thread_pthread_SDL__systhread.c @@ -0,0 +1,18 @@ +$NetBSD: patch-src_thread_pthread_SDL__systhread.c,v 1.1 2015/02/09 08:27:07 snj Exp $ + +Handle NetBSD's pthread_setname_np. + +--- src/thread/pthread/SDL_systhread.c.orig 2014-03-15 19:31:44.000000000 -0700 ++++ src/thread/pthread/SDL_systhread.c 2015-02-09 00:17:52.000000000 -0800 +@@ -129,7 +129,11 @@ SDL_SYS_SetupThread(const char *name) + #endif + } + #elif HAVE_PTHREAD_SETNAME_NP ++ #if defined(__NETBSD__) ++ pthread_setname_np(pthread_self(), "%s", name); ++ #else + pthread_setname_np(pthread_self(), name); ++ #endif + #elif HAVE_PTHREAD_SET_NAME_NP + pthread_set_name_np(pthread_self(), name); + #elif defined(__HAIKU__) |