Welcome SDL2 to the FreeBSD ports system!

A set of new SDL2 related ports has been added, which are essentially
the same as their corresponding port for SDL1.2:

    audio/sdl2_mixer
    graphics/sdl2_image
    graphics/sdl2_ttf
    net/sdl2_net

A set of new USE_SDL knobs is available to enable SDL2 and its related
ports to be added as dependency to ports. Use either of

  USE_SDL= sdl2 image2 mixer2 net2 ttf2

to pull in the specific sdl2_* or sdl20 port.
This commit is contained in:
Marcus von Appen 2013-06-21 19:56:27 +00:00
parent 2b6d9fd950
commit c5a4db7c11
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=321500
20 changed files with 284 additions and 36 deletions

View file

@ -32,89 +32,99 @@
# $FreeBSD$
#
SDL_Include_MAINTAINER= edwin@FreeBSD.org
SDL_Include_MAINTAINER= mva@FreeBSD.org
#
# These are the current supported SDL modules
# These are the current supported SDL1.2 modules
#
_USE_SDL_ALL= console gfx gui image mixer mm net pango sdl sound ttf
_USE_SDL_ALL= console gfx image mixer mm net pango sdl sound ttf
#
# These are the current supported SDL2 modules
#
_USE_SDL_ALL+= image2 mixer2 net2 sdl2 ttf2
#
# Variables used to determine what is needed:
# _VERSION_xxx version of the shared library (required)
# _SUBDIR_xxx subdirectory below ${PORTSDIR} (required)
# _PORTDIR_xxx subdirectory below ${PORTSDIR}/${_SUBDIR_xxx}, default sdl_xxx
# _LIB_xxx name of the shared lib, default SDL_xxx
# _REQUIRES_xxx also needs these SDL libraries
#
_VERSION_console= 0
_SUBDIR_console= devel
_PORTDIR_console= sdl_console
_LIB_console= SDL_console-2.1
_REQUIRES_console= sdl
_VERSION_gfx= 22
_SUBDIR_gfx= graphics
_PORTDIR_gfx= sdl_gfx
_LIB_gfx= SDL_gfx
_REQUIRES_gfx= sdl
_VERSION_gui= 0
_SUBDIR_gui= x11-toolkits
_REQUIRES_gui= sdl image ttf
_VERSION_image= 8
_SUBDIR_image= graphics
_PORTDIR_image= sdl_image
_LIB_image= SDL_image-1.2
_REQUIRES_image=sdl
_VERSION_mixer= 12
_SUBDIR_mixer= audio
_PORTDIR_mixer= sdl_mixer
_LIB_mixer= SDL_mixer-1.2
_REQUIRES_mixer=sdl
_VERSION_mm= 8
_SUBDIR_mm= devel
_LIB_mm= SDLmm
_PORTDIR_mm= sdlmm
_LIB_mm= SDLmm
_REQUIRES_mm= sdl
_VERSION_net= 8
_SUBDIR_net= net
_PORTDIR_net= sdl_net
_LIB_net= SDL_net-1.2
_REQUIRES_net= sdl
_VERSION_pango= 2
_SUBDIR_pango= x11-toolkits
_PORTDIR_pango= sdl_pango
_LIB_pango= SDL_Pango
_REQUIRES_pango=sdl
_VERSION_sdl= 11
_SUBDIR_sdl= devel
_LIB_sdl= SDL-1.2
_PORTDIR_sdl= sdl12
_LIB_sdl= SDL-1.2
_REQUIRES_sdl=
_VERSION_sound= 1
_SUBDIR_sound= audio
_PORTDIR_sound= sdl_sound
_LIB_sound= SDL_sound
_REQUIRES_sound=sdl
_VERSION_ttf= 10
_SUBDIR_ttf= graphics
_PORTDIR_ttf= sdl_ttf
_LIB_ttf= SDL_ttf-2.0
_REQUIRES_ttf= sdl
#
# Update the variables if they need the default values.
#
.for component in ${_USE_SDL_ALL}
. if !defined(_LIB_${component})
_LIB_${component}=SDL_${component}
. endif
. if !defined(_PORTDIR_${component})
_PORTDIR_${component}=sdl_${component}
. endif
. if !defined(_REQUIRES_${component})
_REQUIRES_${component}=
. endif
.endfor
_SUBDIR_image2= graphics
_PORTDIR_image2= sdl2_image
_LIB_image2= SDL2_image
_REQUIRES_image2= sdl2
_SUBDIR_mixer2= audio
_PORTDIR_mixer2= sdl2_mixer
_LIB_mixer2= SDL2_mixer
_REQUIRES_mixer2= sdl2
_SUBDIR_net2= net
_PORTDIR_net2= sdl2_net
_LIB_net2= SDL2_net
_REQUIRES_net2= sdl2
_SUBDIR_sdl2= devel
_PORTDIR_sdl2= sdl20
_LIB_sdl2= SDL2
_REQUIRES_sdl2=
_SUBDIR_ttf2= graphics
_PORTDIR_ttf2= sdl2_ttf
_LIB_ttf2= SDL2_ttf
_REQUIRES_ttf2= sdl2
#
# If WANT_SDL is defined, check for the available libraries
@ -127,7 +137,7 @@ SDL_Include_pre= bsd.sdl.mk
HAVE_SDL?=
.if defined(WANT_SDL)
.for component in ${_USE_SDL_ALL}
.if exists(${LOCALBASE}/lib/lib${_LIB_${component}}.so.${_VERSION_${component}})
.if exists(${LOCALBASE}/lib/lib${_LIB_${component}}.so)
HAVE_SDL+= ${component}
.endif
.endfor
@ -177,16 +187,24 @@ __USE_SDL+= ${component}
# Finally make the list of libs required
#
.for component in ${__USE_SDL}
LIB_DEPENDS+= ${_LIB_${component}}.${_VERSION_${component}}:${PORTSDIR}/${_SUBDIR_${component}}/${_PORTDIR_${component}}
LIB_DEPENDS+= ${_LIB_${component}}:${PORTSDIR}/${_SUBDIR_${component}}/${_PORTDIR_${component}}
.endfor
#
# "Normal" dependencies and variables
#
.if ${__USE_SDL:Msdl} != ""
BUILD_DEPENDS+= ${SDL_CONFIG}:${PORTSDIR}/${_SUBDIR_sdl}/${_PORTDIR_sdl}
SDL_CONFIG?= ${LOCALBASE}/bin/sdl-config
CONFIGURE_ENV+= SDL_CONFIG=${SDL_CONFIG}
MAKE_ENV+= SDL_CONFIG=${SDL_CONFIG}
.endif
.if ${__USE_SDL:Msdl2} != ""
BUILD_DEPENDS+= ${SDL2_CONFIG}:${PORTSDIR}/${_SUBDIR_sdl2}/${_PORTDIR_sdl2}
SDL2_CONFIG?= ${LOCALBASE}/bin/sdl2-config
CONFIGURE_ENV+= SDL2_CONFIG=${SDL2_CONFIG}
MAKE_ENV+= SDL2_CONFIG=${SDL2_CONFIG}
.endif
.endif
.endif

View file

@ -703,6 +703,7 @@
SUBDIR += schism
SUBDIR += scmpc
SUBDIR += scrobbler
SUBDIR += sdl2_mixer
SUBDIR += sdl_mixer
SUBDIR += sdl_sound
SUBDIR += sfront

60
audio/sdl2_mixer/Makefile Normal file
View file

@ -0,0 +1,60 @@
# $FreeBSD$
PORTNAME= sdl2_mixer
PORTVERSION= 2.0.p1
CATEGORIES= audio
MASTER_SITES= http://www.libsdl.org/tmp/SDL_mixer/release/
DISTNAME= SDL2_mixer-2.0.0
MAINTAINER= mva@FreeBSD.org
COMMENT= A sample multi-channel audio mixer library
LICENSE= ZLIB
USES= pathfix pkgconfig:build
USE_GMAKE= yes
USE_SDL= sdl2
GNU_CONFIGURE= yes
LDFLAGS+= -L${LOCALBASE}/lib
CPPFLAGS+= -I${LOCALBASE}/include
USE_LDCONFIG= yes
OPTIONS_DEFINE= FLUIDSYNTH MODPLUG FLAC VORBIS
OPTIONS_DEFAULT= FLUIDSYNTH MODPLUG FLAC VORBIS
FLUIDSYNTH_DESC= Enable SoundFont2 Midi support via fluidsynth
MODPLUG_DESC= Enable MOD music via libModPlug
FLAC_DESC= Enable FLAC encoding support via flac
VORBIS_DESC= Enable Ogg Vorbis music
.include <bsd.port.options.mk>
.if ${PORT_OPTIONS:MMODPLUG}
LIB_DEPENDS+= modplug:${PORTSDIR}/audio/libmodplug
CONFIGURE_ARGS+= --enable-music-mod --enable-music-mod-modplug
.else
CONFIGURE_ARGS+= --disable-music-mod --disable-music-mod-modplug
.endif
.if ${PORT_OPTIONS:MFLAC}
LIB_DEPENDS+= FLAC:${PORTSDIR}/audio/flac
CONFIGURE_ARGS+= --enable-music-flac
.else
CONFIGURE_ARGS+= --disable-music-flac
.endif
.if ${PORT_OPTIONS:MFLUIDSYNTH}
LIB_DEPENDS+= fluidsynth:${PORTSDIR}/audio/fluidsynth
CONFIGURE_ARGS+= --enable-music-midi --enable-music-midi-fluidsynth
.else
CONFIGURE_ARGS+= --disable-music-midi --disable-music-midi-fluidsynth
.endif
.if ${PORT_OPTIONS:MVORBIS}
LIB_DEPENDS+= vorbis:${PORTSDIR}/audio/libvorbis
CONFIGURE_ARGS+= --enable-music-ogg
.else
CONFIGURE_ARGS+= --disable-music-ogg
.endif
.include <bsd.port.mk>

View file

@ -0,0 +1,2 @@
SHA256 (SDL2_mixer-2.0.0.tar.gz) = a3d72b0a02d27defc58665ffeef09247d874ea3e652a0326ef9b9f339581f836
SIZE (SDL2_mixer-2.0.0.tar.gz) = 10109109

View file

@ -0,0 +1,6 @@
SDL_mixer is a sample multi-channel audio mixer library. It supports any number
of simultaneously playing channels of 16 bit stereo audio, plus a single
channel of music, mixed by the popular MikMod MOD, Timidity MIDI and SMPEG MP3
libraries.
WWW: http://www.libsdl.org/projects/SDL_mixer/index.html

View file

@ -0,0 +1,7 @@
include/SDL2/SDL_mixer.h
lib/libSDL2_mixer-2.0.so
lib/libSDL2_mixer-2.0.so.0
lib/libSDL2_mixer.a
lib/libSDL2_mixer.la
lib/libSDL2_mixer.so
libdata/pkgconfig/SDL2_mixer.pc

View file

@ -985,6 +985,8 @@
SUBDIR += scr2png
SUBDIR += scrot
SUBDIR += scwm-icons
SUBDIR += sdl2_image
SUBDIR += sdl2_ttf
SUBDIR += sdl_gfx
SUBDIR += sdl_image
SUBDIR += sdl_ttf

View file

@ -0,0 +1,27 @@
# $FreeBSD$
PORTNAME= sdl2_image
PORTVERSION= 2.0.p1
CATEGORIES= graphics
MASTER_SITES= http://www.libsdl.org/tmp/SDL_image/release/
DISTNAME= SDL2_image-2.0.0
MAINTAINER= mva@FreeBSD.org
COMMENT= A simple library to load images of various formats as SDL surfaces
LIB_DEPENDS= jpeg:${PORTSDIR}/graphics/jpeg \
png15:${PORTSDIR}/graphics/png \
tiff:${PORTSDIR}/graphics/tiff \
webp:${PORTSDIR}/graphics/webp
USES= pkgconfig:build pathfix
USE_AUTOTOOLS= libtool
USE_SDL= sdl2
USE_GMAKE= yes
GNU_CONFIGURE= yes
CPPFLAGS+= -I${LOCALBASE}/include
LDFLAGS+= -L${LOCALBASE}/lib -lm
USE_LDCONFIG= yes
MAKE_JOBS_SAFE= yes
.include <bsd.port.mk>

View file

@ -0,0 +1,2 @@
SHA256 (SDL2_image-2.0.0.tar.gz) = 9c14ab164ac4a9d9afad6f76ca65da0021cfc0108b0152771ca19926b426ab33
SIZE (SDL2_image-2.0.0.tar.gz) = 8397556

View file

@ -0,0 +1,18 @@
This is a simple library to load images of various formats as SDL surfaces.
This library supports BMP, PPM, PCX, GIF, JPEG, PNG, TGA, and TIFF formats.
API:
#include "SDL_image.h"
SDL_Surface *IMG_Load(const char *file);
or
SDL_Surface *IMG_Load_RW(SDL_RWops *src, int freesrc);
or
SDL_Surface *IMG_Load_RW(SDL_RWops *src, int freesrc, char *type);
where type is a string specifying the format (i.e. "PNG" or "pcx").
Note that IMG_Load_RW cannot load TGA images.
An example program 'showimage' is included, with source in showimage.c
WWW: http://www.libsdl.org/projects/SDL_image/

View file

@ -0,0 +1,7 @@
include/SDL2/SDL_image.h
lib/libSDL2_image-2.0.so
lib/libSDL2_image-2.0.so.0
lib/libSDL2_image.a
lib/libSDL2_image.la
lib/libSDL2_image.so
libdata/pkgconfig/SDL2_image.pc

View file

@ -0,0 +1,36 @@
# $FreeBSD$
PORTNAME= sdl2_ttf
PORTVERSION= 2.0.p1
CATEGORIES= graphics
MASTER_SITES= http://www.libsdl.org/tmp/SDL_ttf/release/
DISTNAME= SDL2_ttf-2.0.12
MAINTAINER= mva@FreeBSD.org
COMMENT= A library to use TrueType fonts to render text in SDL applications
LIB_DEPENDS= freetype:${PORTSDIR}/print/freetype2
USES= pkgconfig:build pathfix
USE_SDL= sdl2
USE_AUTOTOOLS= libtool
USE_GMAKE= yes
GNU_CONFIGURE= yes
CPPFLAGS+= -I${LOCALBASE}/include
LDFLAGS+= -L${LOCALBASE}/lib
USE_LDCONFIG= yes
MAKE_JOBS_SAFE= yes
OPTIONS_DEFINE= OPENGL
.include <bsd.port.options.mk>
.if ${PORT_OPTIONS:MOPENGL}
USE_GL= yes
.endif
post-install:
${INSTALL_PROGRAM} ${WRKSRC}/.libs/glfont ${PREFIX}/bin/sdl2-glfont
${INSTALL_PROGRAM} ${WRKSRC}/.libs/showfont ${PREFIX}/bin/sdl2-showfont
.include <bsd.port.mk>

View file

@ -0,0 +1,2 @@
SHA256 (SDL2_ttf-2.0.12.tar.gz) = ecb535c9735068cdef18a0f1f49faae4310273c0704d6cff85a1c0e0d3d5dcfb
SIZE (SDL2_ttf-2.0.12.tar.gz) = 5515661

View file

@ -0,0 +1,15 @@
This library is a wrapper around the excellent FreeType library.
WARNING: There may be patent issues with using the FreeType library. Check the
FreeType website for up-to-date details.
This library allows you to use TrueType fonts to render text in SDL
applications.
Be careful when including fonts with your application, as many of them are
copyrighted. The Microsoft fonts, for example, are not freely redistributable
and even the free "web" fonts they provide are only redistributable in their
special executable installer form (May 1998). There are plenty of freeware and
shareware fonts available on the Internet though, and may suit your purposes.
WWW: http://www.libsdl.org/projects/SDL_ttf/

View file

@ -0,0 +1,9 @@
bin/sdl2-glfont
bin/sdl2-showfont
include/SDL2/SDL_ttf.h
lib/libSDL2_ttf-2.0.so
lib/libSDL2_ttf-2.0.so.10
lib/libSDL2_ttf.a
lib/libSDL2_ttf.la
lib/libSDL2_ttf.so
libdata/pkgconfig/SDL2_ttf.pc

View file

@ -1074,6 +1074,7 @@
SUBDIR += scnc
SUBDIR += scr_ipfm
SUBDIR += scribe
SUBDIR += sdl2_net
SUBDIR += sdl_net
SUBDIR += seda
SUBDIR += sendemail

21
net/sdl2_net/Makefile Normal file
View file

@ -0,0 +1,21 @@
# $FreeBSD$
PORTNAME= sdl2_net
PORTVERSION= 2.0.p1
CATEGORIES= net
MASTER_SITES= http://www.libsdl.org/tmp/SDL_net/release/
DISTNAME= SDL2_net-2.0.0
MAINTAINER= mva@FreeBSD.org
COMMENT= A small sample cross-platform networking library
USE_AUTOTOOLS= libtool
USE_SDL= sdl2
USES= pathfix pkgconfig:build
USE_GMAKE= yes
GNU_CONFIGURE= yes
USE_LDCONFIG= yes
CONFIGURE_ARGS+=--disable-gui
.include <bsd.port.mk>

2
net/sdl2_net/distinfo Normal file
View file

@ -0,0 +1,2 @@
SHA256 (SDL2_net-2.0.0.tar.gz) = 28dac7dac4c91f432b025b86a2425047d42ee943be671c4e3c23e81f702f4547
SIZE (SDL2_net-2.0.0.tar.gz) = 345094

5
net/sdl2_net/pkg-descr Normal file
View file

@ -0,0 +1,5 @@
This is a small sample cross-platform networking library, with a sample chat
client and server application. The chat client uses the GUIlib GUI framework
library.
WWW: http://www.libsdl.org/projects/SDL_net/

7
net/sdl2_net/pkg-plist Normal file
View file

@ -0,0 +1,7 @@
include/SDL2/SDL_net.h
lib/libSDL2_net-2.0.so
lib/libSDL2_net-2.0.so.0
lib/libSDL2_net.a
lib/libSDL2_net.la
lib/libSDL2_net.so
libdata/pkgconfig/SDL2_net.pc