SecBSD's official ports repository

This commit is contained in:
purplerain 2023-08-16 22:26:55 +00:00
commit 2c0afcbbf3
Signed by: purplerain
GPG key ID: F42C07F07E2E35B7
64331 changed files with 5339189 additions and 0 deletions

33
devel/sdl-sound/Makefile Normal file
View file

@ -0,0 +1,33 @@
COMMENT= library that handles the decoding of sound file formats
DISTNAME= SDL_sound-1.0.3
PKGNAME= ${DISTNAME:L:S/_/-/}
REVISION= 3
CATEGORIES= devel audio
MASTER_SITES= http://offload1.icculus.org/SDL_sound/downloads/
SHARED_LIBS= SDL_sound 2.0
HOMEPAGE= http://icculus.org/SDL_sound/
# LGPLv2.1+
PERMIT_PACKAGE= Yes
WANTLIB= FLAC SDL c iconv m mikmod ogg pthread physfs smpeg speex \
sndio usbhid vorbis vorbisfile z
LIB_DEPENDS+= audio/flac \
audio/libmikmod \
audio/libvorbis \
audio/speex \
devel/physfs \
devel/sdl \
devel/smpeg
CONFIGURE_STYLE= autoconf
AUTOCONF_VERSION= 2.61
CONFIGURE_ARGS+=--disable-modplug
CONFIGURE_ENV+= CPPFLAGS="-I${LOCALBASE}/include/smpeg -I${LOCALBASE}/include" \
LDFLAGS="-L${LOCALBASE}/lib"
.include <bsd.port.mk>

2
devel/sdl-sound/distinfo Normal file
View file

@ -0,0 +1,2 @@
SHA256 (SDL_sound-1.0.3.tar.gz) = OZn9C7tIUomlK+FLL2i1ccuE44DMQzh+rfd49kx55t8=
SIZE (SDL_sound-1.0.3.tar.gz) = 1127100

View file

@ -0,0 +1,10 @@
--- Makefile.in.orig Sun Apr 20 16:33:52 2008
+++ Makefile.in Fri Jul 9 18:19:28 2010
@@ -251,7 +251,6 @@ libSDL_sound_la_SOURCES = \
@USE_MPGLIB_FALSE@MPGLIB_LIB =
@USE_MPGLIB_TRUE@MPGLIB_LIB = decoders/mpglib/libmpglib.la
libSDL_sound_la_LDFLAGS = \
- -release $(LT_RELEASE) \
-version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
libSDL_sound_la_LIBADD = \

View file

@ -0,0 +1,13 @@
Clean up symbol visibility.
--- SDL_sound.h.orig Fri Jun 1 02:52:00 2012
+++ SDL_sound.h Fri Jun 1 02:52:38 2012
@@ -79,6 +79,8 @@ extern "C" {
#ifdef SDL_SOUND_DLL_EXPORTS
# define SNDDECLSPEC __declspec(dllexport)
+#elif (__GNUC__ >= 3)
+# define SNDDECLSPEC __attribute__((visibility("default")))
#else
# define SNDDECLSPEC
#endif

View file

@ -0,0 +1,56 @@
Clean up symbol visibility.
--- configure.in.orig Sun Apr 20 16:33:43 2008
+++ configure.in Fri Jun 1 02:53:20 2012
@@ -58,6 +58,30 @@ AM_PROG_LIBTOOL
dnl ---------------------------------------------------------------------
+dnl Have GCC's -fvisibility option?
+dnl ---------------------------------------------------------------------
+AC_MSG_CHECKING(for GCC -fvisibility=hidden option)
+have_gcc_fvisibility=no
+visibility_CFLAGS="-fvisibility=hidden"
+save_CFLAGS="$CFLAGS"
+CFLAGS="$save_CFLAGS $visibility_CFLAGS"
+AC_TRY_COMPILE([
+#if !defined(__GNUC__) || __GNUC__ < 4
+#error SDL only uses visibility attributes in GCC 4 or newer
+#endif
+],[
+],[
+have_gcc_fvisibility=yes
+])
+AC_MSG_RESULT($have_gcc_fvisibility)
+CFLAGS="$save_CFLAGS"
+
+if test x$have_gcc_fvisibility = xyes; then
+ CFLAGS="$CFLAGS $visibility_CFLAGS"
+fi
+
+
+dnl ---------------------------------------------------------------------
dnl Debug mode?
dnl ---------------------------------------------------------------------
@@ -222,9 +246,9 @@ AC_ARG_ENABLE(ogg,
, enable_ogg=yes)
if test x$enable_ogg = xyes; then
AC_CHECK_HEADER(vorbis/codec.h, have_vorbis_hdr=yes)
- AC_CHECK_LIB(vorbis, vorbis_info_init, have_vorbis_lib=yes)
+ AC_CHECK_LIB(vorbis, vorbis_info_init, have_vorbis_lib=yes,,[-logg])
AC_CHECK_HEADER(vorbis/vorbisfile.h, have_vorbisfile_hdr=yes)
- AC_CHECK_LIB(vorbisfile, ov_open_callbacks, have_vorbisfile_lib=yes)
+ AC_CHECK_LIB(vorbisfile, ov_open_callbacks, have_vorbisfile_lib=yes,,[-lvorbis -logg])
have_vorbis=no
if test x$have_ogg = xyes; then
if test x$have_vorbis_hdr = xyes -a x$have_vorbis_lib = xyes; then
@@ -259,7 +283,7 @@ AC_ARG_ENABLE(flac,
, enable_flac=yes)
if test x$enable_flac = xyes; then
AC_CHECK_HEADER(FLAC/stream_decoder.h, have_flac_hdr=yes)
- AC_CHECK_LIB(FLAC, $flcsym, have_flac_lib=yes)
+ AC_CHECK_LIB(FLAC, $flcsym, have_flac_lib=yes,,[-logg])
if test x$have_ogg = xyes; then
if test x$have_flac_hdr = xyes -a x$have_flac_lib = xyes; then
LIBS="$LIBS -lFLAC -logg"

View file

@ -0,0 +1,12 @@
Disable reverb flag in modplug decoder. It's producing trash in some cases.
--- decoders/modplug.c.orig Fri Jun 1 02:57:54 2012
+++ decoders/modplug.c Fri Jun 1 02:58:05 2012
@@ -128,7 +128,6 @@ static int MODPLUG_init(void)
#ifndef _WIN32_WCE
settings.mFlags |= MODPLUG_ENABLE_NOISE_REDUCTION |
- MODPLUG_ENABLE_REVERB |
MODPLUG_ENABLE_MEGABASS |
MODPLUG_ENABLE_SURROUND;

View file

@ -0,0 +1,28 @@
Clean up symbol visibility.
--- decoders/timidity/instrum_dls.c.orig Fri Jun 1 02:53:52 2012
+++ decoders/timidity/instrum_dls.c Fri Jun 1 02:54:37 2012
@@ -51,9 +51,9 @@ typedef struct _RIFF_Chunk {
struct _RIFF_Chunk *next;
} RIFF_Chunk;
-extern DECLSPEC RIFF_Chunk* SDLCALL LoadRIFF(SDL_RWops *src);
-extern DECLSPEC void SDLCALL FreeRIFF(RIFF_Chunk *chunk);
-extern DECLSPEC void SDLCALL PrintRIFF(RIFF_Chunk *chunk, int level);
+extern RIFF_Chunk* LoadRIFF(SDL_RWops *src);
+extern void FreeRIFF(RIFF_Chunk *chunk);
+extern void PrintRIFF(RIFF_Chunk *chunk, int level);
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*-------------------------------------------------------------------------*/
@@ -353,8 +353,8 @@ typedef struct _DLS_Data {
const char *comments;
} DLS_Data;
-extern DECLSPEC DLS_Data* SDLCALL LoadDLS(SDL_RWops *src);
-extern DECLSPEC void SDLCALL FreeDLS(DLS_Data *chunk);
+extern DLS_Data* LoadDLS(SDL_RWops *src);
+extern void FreeDLS(DLS_Data *chunk);
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/*-------------------------------------------------------------------------*/

View file

@ -0,0 +1,212 @@
- Don't underflow array when parsing timidity config file.
- Fix read_config_file() not closing the file when there is an error.
- Honor the return code from recursive read_config_file() call.
- Reset some state on shutdown to prevent crash when reinitializing.
--- decoders/timidity/timidity.c.orig Fri Jun 1 02:58:25 2012
+++ decoders/timidity/timidity.c Fri Jun 1 03:05:53 2012
@@ -99,13 +99,18 @@ static int read_config_file(char *name)
while (RWgets(rw, tmp, sizeof(tmp)))
{
line++;
- w[words=0]=strtok(tmp, " \t\240");
+ words=0;
+ w[0]=strtok(tmp, " \t\240");
if (!w[0]) continue;
/* Originally the TiMidity++ extensions were prefixed like this */
if (strcmp(w[0], "#extension") == 0)
- words = -1;
- else if (*w[0] == '#')
+ {
+ w[0]=strtok(0, " \t\240");
+ if (!w[0]) continue;
+ }
+
+ if (*w[0] == '#')
continue;
while (w[words] && *w[words] != '#' && (words < MAXWORDS))
@@ -208,7 +213,7 @@ static int read_config_file(char *name)
if (words < 2)
{
SNDDBG(("%s: line %d: No directory given\n", name, line));
- return -2;
+ goto fail;
}
for (i=1; i<words; i++)
add_to_pathlist(w[i]);
@@ -218,13 +223,18 @@ static int read_config_file(char *name)
if (words < 2)
{
SNDDBG(("%s: line %d: No file name given\n", name, line));
- return -2;
+ goto fail;
}
for (i=1; i<words; i++)
{
+ int status;
rcf_count++;
- read_config_file(w[i]);
+ status = read_config_file(w[i]);
rcf_count--;
+ if (status != 0) {
+ SDL_RWclose(rw);
+ return status;
+ }
}
}
else if (!strcmp(w[0], "default"))
@@ -233,7 +243,7 @@ static int read_config_file(char *name)
{
SNDDBG(("%s: line %d: Must specify exactly one patch name\n",
name, line));
- return -2;
+ goto fail;
}
strncpy(def_instr_name, w[1], 255);
def_instr_name[255]='\0';
@@ -243,14 +253,14 @@ static int read_config_file(char *name)
if (words < 2)
{
SNDDBG(("%s: line %d: No drum set number given\n", name, line));
- return -2;
+ goto fail;
}
i=atoi(w[1]);
if (i<0 || i>127)
{
SNDDBG(("%s: line %d: Drum set must be between 0 and 127\n",
name, line));
- return -2;
+ goto fail;
}
if (!master_drumset[i])
{
@@ -266,14 +276,14 @@ static int read_config_file(char *name)
if (words < 2)
{
SNDDBG(("%s: line %d: No bank number given\n", name, line));
- return -2;
+ goto fail;
}
i=atoi(w[1]);
if (i<0 || i>127)
{
SNDDBG(("%s: line %d: Tone bank must be between 0 and 127\n",
name, line));
- return -2;
+ goto fail;
}
if (!master_tonebank[i])
{
@@ -289,20 +299,20 @@ static int read_config_file(char *name)
if ((words < 2) || (*w[0] < '0' || *w[0] > '9'))
{
SNDDBG(("%s: line %d: syntax error\n", name, line));
- return -2;
+ goto fail;
}
i=atoi(w[0]);
if (i<0 || i>127)
{
SNDDBG(("%s: line %d: Program must be between 0 and 127\n",
name, line));
- return -2;
+ goto fail;
}
if (!bank)
{
SNDDBG(("%s: line %d: Must specify tone bank or drum set before assignment\n",
name, line));
- return -2;
+ goto fail;
}
if (bank->tone[i].name)
free(bank->tone[i].name);
@@ -316,7 +326,7 @@ static int read_config_file(char *name)
if (!(cp=strchr(w[j], '=')))
{
SNDDBG(("%s: line %d: bad patch option %s\n", name, line, w[j]));
- return -2;
+ goto fail;
}
*cp++=0;
if (!strcmp(w[j], "amp"))
@@ -326,7 +336,7 @@ static int read_config_file(char *name)
{
SNDDBG(("%s: line %d: amplification must be between 0 and %d\n",
name, line, MAX_AMPLIFICATION));
- return -2;
+ goto fail;
}
bank->tone[i].amp=k;
}
@@ -337,7 +347,7 @@ static int read_config_file(char *name)
{
SNDDBG(("%s: line %d: note must be between 0 and 127\n",
name, line));
- return -2;
+ goto fail;
}
bank->tone[i].note=k;
}
@@ -355,7 +365,7 @@ static int read_config_file(char *name)
{
SNDDBG(("%s: line %d: panning must be left, right, center, or between -100 and 100\n",
name, line));
- return -2;
+ goto fail;
}
bank->tone[i].pan=k;
}
@@ -368,7 +378,7 @@ static int read_config_file(char *name)
else
{
SNDDBG(("%s: line %d: keep must be env or loop\n", name, line));
- return -2;
+ goto fail;
}
}
else if (!strcmp(w[j], "strip"))
@@ -383,19 +393,22 @@ static int read_config_file(char *name)
{
SNDDBG(("%s: line %d: strip must be env, loop, or tail\n",
name, line));
- return -2;
+ goto fail;
}
}
else
{
SNDDBG(("%s: line %d: bad patch option %s\n", name, line, w[j]));
- return -2;
+ goto fail;
}
}
}
}
SDL_RWclose(rw);
return 0;
+fail:
+ SDL_RWclose(rw);
+ return -2;
}
int Timidity_Init_NoConfig()
@@ -581,6 +594,7 @@ void Timidity_Exit(void)
free(e);
}
free(master_tonebank[i]);
+ master_tonebank[i] = NULL;
}
if (master_drumset[i])
{
@@ -595,6 +609,7 @@ void Timidity_Exit(void)
free(e);
}
free(master_drumset[i]);
+ master_drumset[i] = NULL;
}
}

View file

@ -0,0 +1,13 @@
Index: playsound/physfsrwops.h
--- playsound/physfsrwops.h.orig
+++ playsound/physfsrwops.h
@@ -29,6 +29,9 @@
extern "C" {
#endif
+#ifndef __EXPORT__
+#define __EXPORT__ __attribute__((visibility("default")))
+#endif
/**
* Open a platform-independent filename for reading, and make it accessible
* via an SDL_RWops structure. The file will be closed in PhysicsFS when the

View file

@ -0,0 +1,48 @@
Don't force quit in signal handler, since we might double-free things.
--- playsound/playsound.c.orig Fri Jun 1 02:55:31 2012
+++ playsound/playsound.c Fri Jun 1 02:57:26 2012
@@ -312,22 +312,11 @@ void sigint_catcher(int signum)
Uint32 ticks = SDL_GetTicks();
assert(signum == SIGINT);
+ if (done_flag < 0)
+ return; /* mashing CTRL-C, we get it already. */
- if ((last_sigint != 0) && (ticks - last_sigint < 500))
- {
- SDL_PauseAudio(1);
- SDL_CloseAudio();
- Sound_Quit();
- SDL_Quit();
- deinit_archive();
- exit(1);
- } /* if */
-
- else
- {
- last_sigint = ticks;
- done_flag = 1;
- } /* else */
+ done_flag = ((last_sigint != 0) && (ticks - last_sigint < 500)) ? -1 : 1;
+ last_sigint = ticks;
} /* sigint_catcher */
#endif
@@ -1050,12 +1039,15 @@ int main(int argc, char **argv)
Sound_FreeSample(sample);
close_archive(filename);
+
+ if (done_flag < 0)
+ break;
} /* for */
Sound_Quit();
SDL_Quit();
deinit_archive();
- return(0);
+ return((done_flag < 0) ? 1 : 0);
} /* main */
/* end of playsound.c ... */

10
devel/sdl-sound/pkg/DESCR Normal file
View file

@ -0,0 +1,10 @@
SDL_sound is a library that handles the decoding of several popular
sound file formats, such as .WAV and .MP3. It is meant to make the
programmer's sound playback tasks simpler. The programmer gives
SDL_sound a filename, or feeds it data directly from one of many
sources, and then reads the decoded waveform data back at their leisure.
If resource constraints are a concern, SDL_sound can process sound data
in programmer-specified blocks. Alternately, SDL_sound can decode a
whole sound file and hand back a single pointer to the whole waveform.
SDL_sound can also handle sample rate, audio format, and channel
conversion on-the-fly and behind-the-scenes, if the programmer desires.

View file

@ -0,0 +1,7 @@
@bin bin/playsound
@bin bin/playsound_simple
include/SDL/
include/SDL/SDL_sound.h
lib/libSDL_sound.a
lib/libSDL_sound.la
@lib lib/libSDL_sound.so.${LIBSDL_sound_VERSION}