ports/106232: [PATCH] Add SDL sound support to games/freeciv*
Bartosz Fabianowski
freebsd at chillt.de
Sat Dec 2 21:00:24 UTC 2006
>Number: 106232
>Category: ports
>Synopsis: [PATCH] Add SDL sound support to games/freeciv*
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: change-request
>Submitter-Id: current-users
>Arrival-Date: Sat Dec 02 21:00:18 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator: Bartosz Fabianowski
>Release: 6.2-PRERELEASE
>Organization:
>Environment:
FreeBSD takahe.local 6.2-PRERELEASE FreeBSD 6.2-PRERELEASE #0: Mon Nov 27 19:22:17 GMT 2006 root at takahe.local:/usr/obj/usr/src/sys/TAKAHE i386
>Description:
Although freeciv is able to play sounds, the FreeBSD port does not enable this functionality. The following patch adds optional sound support and also installs the default sound theme (the only one available on the freeciv site).
Caveats:
* Freeciv supports both SDL and esound. Since I do not have esound installed and have no interest in it, this patch adds SDL support only. However, esound should be trivial to add as the sound theme installation code should work for it as well.
* This patch has only seen limited testing on a single 6.2-PRERELEASE i386 machine. Unfortunately, I do not have access to any other releases or architectures for testing purposes.
* There appears to be no information on the freeciv site regarding the licensing of the default sound theme. Before integrating this patch, the maintainer may want to contact the freeciv developers and clarify the licensing terms.
>How-To-Repeat:
>Fix:
diff -ruN freeciv.orig/Makefile freeciv/Makefile
--- freeciv.orig/Makefile Tue Sep 26 08:40:33 2006
+++ freeciv/Makefile Sat Dec 2 20:30:46 2006
@@ -7,16 +7,17 @@
PORTNAME= freeciv
PORTVERSION= 2.0.8
-PORTREVISION= 2
+PORTREVISION= 3
CATEGORIES= games
-MASTER_SITES= ftp://ftp.freeciv.org/pub/freeciv/stable/ SF
+MASTER_SITES= ftp://ftp.freeciv.org/pub/freeciv/stable/ SF \
+ ftp://ftp.freeciv.org/freeciv/contrib/sounds/sets/:freeciv_sounds
+DISTFILES+= ${DISTNAME}.tar.bz2 stdsounds3.tar.gz:freeciv_sounds
MAINTAINER= infofarmer at FreeBSD.org
COMMENT= Free turn-based multiplayer strategy
USE_GCC= 3.4+
USE_GETTEXT= yes
-USE_BZIP2= yes
USE_PYTHON= yes
GNU_CONFIGURE= yes
CONFIGURE_ENV= CPPFLAGS="-I${LOCALBASE}/include" \
@@ -29,12 +30,20 @@
png.5:${PORTSDIR}/graphics/png
USE_XPM= yes
WANT_GNOME= yes
-CONFIGURE_ENV+= SDL_CONFIG="${SDL_CONFIG}"
+WANT_SDL= mixer
PLIST_SUB+= X11=""
.endif
.include <bsd.port.pre.mk>
+.if !defined(WITHOUT_X11) && (defined(WITH_SDL) || ${HAVE_SDL:Mmixer}!="")
+USE_SDL= mixer
+SOUND= yes
+PLIST_SUB+= SOUND=""
+.else
+PLIST_SUB+= SOUND="@comment "
+.endif
+
.if !defined(WITH_GTK) && !defined(WITH_GTK12) && !defined(WITH_GTK2) && \
!defined(WITHOUT_GNOME) && !defined(WITHOUT_X11)
AUTO_DEPENDS= yes
@@ -84,9 +93,17 @@
.endif
post-patch:
- @${REINPLACE_CMD} -Ee '${CFG_PATCH}' ${WRKSRC}/configure
+ @${REINPLACE_CMD} -Ee '${CFG_PATCH}' -e 's/-lSDL_mixer /${PTHREAD_LIBS} -lSDL_mixer /g' ${WRKSRC}/configure
@${FIND} ${WRKSRC} -name Makefile.in | \
${XARGS} ${REINPLACE_CMD} -e 's/@program_transform_name@//'
+
+post-install:
+.ifdef SOUND
+ ${INSTALL_DATA} ${WRKDIR}/data/stdsounds.soundspec ${DATADIR}
+ ${MKDIR} ${DATADIR}/stdsounds
+ @cd ${WRKDIR}/data/stdsounds && \
+ ${FIND} * -type f -exec ${INSTALL_DATA} "{}" "${DATADIR}/stdsounds/{}" \;
+.endif
.if ${OSVERSION} < 500000
BROKEN= Does not build on 4.x
diff -ruN freeciv.orig/distinfo freeciv/distinfo
--- freeciv.orig/distinfo Sat Apr 29 22:40:45 2006
+++ freeciv/distinfo Sat Dec 2 20:30:46 2006
@@ -1,3 +1,6 @@
MD5 (freeciv-2.0.8.tar.bz2) = 9ebd5899c2c78362e0e2c68791673a88
SHA256 (freeciv-2.0.8.tar.bz2) = 85b396c86f977b85f03fa1309733d21f7cc953e005ff1475f9981b77fa9f28f3
SIZE (freeciv-2.0.8.tar.bz2) = 8535513
+MD5 (stdsounds3.tar.gz) = 77215914712f2f351092918f5e41e39e
+SHA256 (stdsounds3.tar.gz) = a3cc2be93c006c3a9492349aa4552bf059e45efc94135f09241877c221ae1bfa
+SIZE (stdsounds3.tar.gz) = 118278
diff -ruN freeciv.orig/pkg-plist freeciv/pkg-plist
--- freeciv.orig/pkg-plist Mon Sep 4 09:45:28 2006
+++ freeciv/pkg-plist Sat Dec 2 20:30:46 2006
@@ -297,6 +297,23 @@
%%X11%%%%DATADIR%%/isophex/terrain2.spec
%%X11%%%%DATADIR%%/isophex/tiles.png
%%X11%%%%DATADIR%%/isophex/tiles.spec
+%%SOUND%%%%DATADIR%%/stdsounds.soundspec
+%%SOUND%%%%DATADIR%%/stdsounds/LrgCan.ogg
+%%SOUND%%%%DATADIR%%/stdsounds/LrgExpl.ogg
+%%SOUND%%%%DATADIR%%/stdsounds/MedCan.ogg
+%%SOUND%%%%DATADIR%%/stdsounds/MgBar1.ogg
+%%SOUND%%%%DATADIR%%/stdsounds/MgBar2.ogg
+%%SOUND%%%%DATADIR%%/stdsounds/MgHeavy.ogg
+%%SOUND%%%%DATADIR%%/stdsounds/Mortar.ogg
+%%SOUND%%%%DATADIR%%/stdsounds/SmlExpl.ogg
+%%SOUND%%%%DATADIR%%/stdsounds/Splash.ogg
+%%SOUND%%%%DATADIR%%/stdsounds/THover.ogg
+%%SOUND%%%%DATADIR%%/stdsounds/Tread.ogg
+%%SOUND%%%%DATADIR%%/stdsounds/foot3.ogg
+%%SOUND%%%%DATADIR%%/stdsounds/inh2o.ogg
+%%SOUND%%%%DATADIR%%/stdsounds/metbrk.ogg
+%%SOUND%%%%DATADIR%%/stdsounds/wall01.ogg
+%%SOUND%%%%DATADIR%%/stdsounds/woodbrk.ogg
share/locale/da/LC_MESSAGES/freeciv.mo
share/locale/ca/LC_MESSAGES/freeciv.mo
share/locale/cs/LC_MESSAGES/freeciv.mo
@@ -341,6 +358,7 @@
@dirrmtry share/locale/sk
@dirrmtry share/locale/uk/LC_MESSAGES
@dirrmtry share/locale/uk
+%%SOUND%%@dirrm %%DATADIR%%/stdsounds
%%X11%%@dirrm %%DATADIR%%/trident
@dirrm %%DATADIR%%/scenario
@dirrm %%DATADIR%%/nation
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list