On 2012/12/31 01:50, Stefan Sperling wrote: > Perhaps mikmod should be updated but I'd rather just fix this for now.
updated to 3.2.0 here, some of the patches were rolled in, and I've added a comment in patches for the remaining ones where it's not obvious. Index: Makefile =================================================================== RCS file: /cvs/ports/audio/libmikmod/Makefile,v retrieving revision 1.23 diff -u -p -r1.23 Makefile --- Makefile 2 Jan 2013 15:13:02 -0000 1.23 +++ Makefile 10 Jan 2013 00:36:33 -0000 @@ -2,13 +2,11 @@ COMMENT= mikmod sound library -VERSION= 3.1.10 -DISTNAME= libmikmod-${VERSION} -REVISION= 10 -SHARED_LIBS += mikmod 2.4 # .2.4 -CATEGORIES= audio devel +DISTNAME= libmikmod-3.2.0 +SHARED_LIBS += mikmod 3.0 # .3.0 +CATEGORIES= audio devel -HOMEPAGE= http://mikmod.raphnet.net/ +HOMEPAGE= http://mikmod.shlomifish.org/ MAINTAINER= Peter Valchev <pvalc...@openbsd.org> @@ -17,15 +15,14 @@ PERMIT_PACKAGE_FTP= Yes PERMIT_DISTFILES_CDROM= Yes PERMIT_DISTFILES_FTP= Yes -MASTER_SITES= ${HOMEPAGE}/files/libmikmod/ \ - ${MASTER_SITE_SUNSITE:=apps/sound/libs/} +MASTER_SITES= ${HOMEPAGE}files/ -WANTLIB= sndio +WANTLIB= m sndio SEPARATE_BUILD= Yes CONFIGURE_STYLE= gnu USE_LIBTOOL= Yes -CFLAGS += -DDRV_SNDIO +CFLAGS += -DDRV_SNDIO CONFIGURE_ENV= LIBRARY_LIB="-lsndio" CONFIGURE_ARGS+= ${CONFIGURE_SHARED} CONFIGURE_ARGS+= --disable-dl \ Index: distinfo =================================================================== RCS file: /cvs/ports/audio/libmikmod/distinfo,v retrieving revision 1.3 diff -u -p -r1.3 distinfo --- distinfo 5 Apr 2007 15:37:43 -0000 1.3 +++ distinfo 10 Jan 2013 00:36:33 -0000 @@ -1,5 +1,2 @@ -MD5 (libmikmod-3.1.10.tar.gz) = FL8/GM8Bh/XatG5Co93ahA== -RMD160 (libmikmod-3.1.10.tar.gz) = lAqGyTHuyjhFYeruuIykSKgN7dA= -SHA1 (libmikmod-3.1.10.tar.gz) = jU2uxmsX5Vbol3ywd8QYYRGAjg0= -SHA256 (libmikmod-3.1.10.tar.gz) = bsVgmdzZcE53BANo+E50tpac5vKvxbSkvpAYrBwBdDg= -SIZE (libmikmod-3.1.10.tar.gz) = 528929 +SHA256 (libmikmod-3.2.0.tar.gz) = c0yEkLv5sMWHkguSQU3Po8ImeDigzfaY1fH7a7qPZh4= +SIZE (libmikmod-3.2.0.tar.gz) = 873258 Index: patches/patch-configure =================================================================== RCS file: /cvs/ports/audio/libmikmod/patches/patch-configure,v retrieving revision 1.1 diff -u -p -r1.1 patch-configure --- patches/patch-configure 11 Jan 2010 04:25:26 -0000 1.1 +++ patches/patch-configure 10 Jan 2013 00:36:33 -0000 @@ -1,12 +1,15 @@ -$OpenBSD: patch-configure,v 1.1 2010/01/11 04:25:26 jakemsr Exp $ ---- configure.orig Sat Dec 19 01:48:17 2009 -+++ configure Sat Dec 19 01:48:17 2009 -@@ -3682,7 +3682,7 @@ done +$OpenBSD$ + +sndio + +--- configure.orig Thu Jan 10 00:24:22 2013 ++++ configure Thu Jan 10 00:24:28 2013 +@@ -13343,7 +13343,7 @@ done libmikmod_driver_hp=yes fi ;; - NetBSD|OpenBSD) + NetBSD) - for ac_hdr in sys/audioio.h - do - ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` + for ac_header in sys/audioio.h + do : + ac_fn_c_check_header_mongrel "$LINENO" "sys/audioio.h" "ac_cv_header_sys_audioio_h" "$ac_includes_default" Index: patches/patch-drivers_drv_wav_c =================================================================== RCS file: patches/patch-drivers_drv_wav_c diff -N patches/patch-drivers_drv_wav_c --- patches/patch-drivers_drv_wav_c 16 Jun 2003 04:30:57 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,21 +0,0 @@ -$OpenBSD: patch-drivers_drv_wav_c,v 1.1 2003/06/16 04:30:57 pvalchev Exp $ ---- drivers/drv_wav.c.orig Sat Jan 12 18:00:14 2002 -+++ drivers/drv_wav.c Sun Jun 15 22:26:13 2003 -@@ -148,6 +148,17 @@ static void WAV_Update(void) - ULONG done; - - done=VC_WriteBytes(audiobuffer,BUFFERSIZE); -+#if BYTE_ORDER == BIG_ENDIAN -+ if (md_mode & DMODE_16BITS) { -+ ULONG i; -+ SWORD *w = audiobuffer; -+ -+ for (i = 0; i < done; i += 2) { -+ *w = ((*w & 0xff) << 8) | ((*w & 0xff00) >> 8); -+ w++; -+ } -+ } -+#endif - _mm_write_UBYTES(audiobuffer,done,wavout); - dumpsize+=done; - } Index: patches/patch-include_mikmod_h_in =================================================================== RCS file: /cvs/ports/audio/libmikmod/patches/patch-include_mikmod_h_in,v retrieving revision 1.2 diff -u -p -r1.2 patch-include_mikmod_h_in --- patches/patch-include_mikmod_h_in 11 Jan 2010 04:25:26 -0000 1.2 +++ patches/patch-include_mikmod_h_in 10 Jan 2013 00:36:33 -0000 @@ -1,16 +1,16 @@ -$OpenBSD: patch-include_mikmod_h_in,v 1.2 2010/01/11 04:25:26 jakemsr Exp $ ---- include/mikmod.h.in.orig Thu Jan 17 14:39:38 2002 -+++ include/mikmod.h.in Fri Dec 18 23:53:46 2009 +$OpenBSD$ +--- include/mikmod.h.in.orig Sat May 12 10:52:13 2012 ++++ include/mikmod.h.in Thu Jan 10 00:26:38 2013 @@ -85,7 +85,7 @@ typedef char CHAR; @DOES_NOT_HAVE_SIGNED@ --#if defined(__arch64__) || defined(__alpha) -+#if defined(__arch64__) || defined(__alpha) || defined(__LP64__) +-#if defined(__arch64__) || defined(__alpha) || defined(__x86_64) || defined(__powerpc64__) ++#if defined(__arch64__) || defined(__alpha) || defined(__x86_64) || defined(__powerpc64__) || defined(__LP64__) /* 64 bit architectures */ typedef signed char SBYTE; /* 1 byte, signed */ -@@ -669,6 +669,7 @@ MIKMODAPI extern struct MDRIVER drv_hp; /* HP-UX a +@@ -723,6 +723,7 @@ MIKMODAPI extern struct MDRIVER drv_nas; /* Network MIKMODAPI extern struct MDRIVER drv_oss; /* OpenSound System (Linux,FreeBSD...) */ MIKMODAPI extern struct MDRIVER drv_sgi; /* SGI audio library */ MIKMODAPI extern struct MDRIVER drv_sun; /* Sun/NetBSD/OpenBSD audio device */ Index: patches/patch-include_mikmod_internals_h =================================================================== RCS file: patches/patch-include_mikmod_internals_h diff -N patches/patch-include_mikmod_internals_h --- patches/patch-include_mikmod_internals_h 14 Sep 2004 22:42:30 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,12 +0,0 @@ -$OpenBSD: patch-include_mikmod_internals_h,v 1.1 2004/09/14 22:42:30 brad Exp $ ---- include/mikmod_internals.h.orig Wed Sep 1 15:32:26 2004 -+++ include/mikmod_internals.h Wed Sep 1 15:32:42 2004 -@@ -50,7 +50,7 @@ extern "C" { - /*========== More type definitions */ - - /* SLONGLONG: 64bit, signed */ --#if defined (__arch64__) || defined(__alpha) -+#if defined (__arch64__) || defined(__alpha) || defined(__LP64__) - typedef long SLONGLONG; - #define NATIVE_64BIT_INT - #elif defined(__WATCOMC__) Index: patches/patch-libmikmod_Makefile_in =================================================================== RCS file: /cvs/ports/audio/libmikmod/patches/patch-libmikmod_Makefile_in,v retrieving revision 1.3 diff -u -p -r1.3 patch-libmikmod_Makefile_in --- patches/patch-libmikmod_Makefile_in 11 Jan 2010 04:25:26 -0000 1.3 +++ patches/patch-libmikmod_Makefile_in 10 Jan 2013 00:36:33 -0000 @@ -1,6 +1,6 @@ -$OpenBSD: patch-libmikmod_Makefile_in,v 1.3 2010/01/11 04:25:26 jakemsr Exp $ ---- libmikmod/Makefile.in.orig Wed Jan 23 14:15:14 2002 -+++ libmikmod/Makefile.in Sat Dec 19 00:06:55 2009 +$OpenBSD$ +--- libmikmod/Makefile.in.orig Fri Jun 1 14:16:08 2012 ++++ libmikmod/Makefile.in Thu Jan 10 00:28:02 2013 @@ -30,13 +30,13 @@ MKINSTALLDIRS=${top_srcdir}/mkinstalldirs DEFS=@DEFS@ @@ -10,14 +10,14 @@ $OpenBSD: patch-libmikmod_Makefile_in,v LIB = libmikmod.la OBJ = $(LIBOBJS) $(DLOBJS) \ - drv_AF.lo drv_aix.lo drv_alsa.lo drv_esd.lo drv_hp.lo drv_nos.lo \ - drv_oss.lo drv_pipe.lo drv_raw.lo drv_sam9407.lo drv_sgi.lo \ + drv_AF.lo drv_aiff.lo drv_aix.lo drv_alsa.lo drv_esd.lo drv_hp.lo drv_nos.lo \ + drv_oss.lo drv_osx.lo drv_mac.lo drv_nas.lo drv_pipe.lo drv_raw.lo drv_sam9407.lo drv_sgi.lo \ - drv_stdout.lo drv_sun.lo drv_ultra.lo drv_wav.lo \ + drv_stdout.lo drv_sun.lo drv_sndio.lo drv_ultra.lo drv_wav.lo \ - load_669.lo load_amf.lo load_dsm.lo load_far.lo load_gdm.lo load_it.lo \ - load_imf.lo load_m15.lo load_med.lo load_mod.lo load_mtm.lo load_okt.lo \ - load_s3m.lo load_stm.lo load_stx.lo load_ult.lo load_uni.lo load_xm.lo \ -@@ -117,6 +117,9 @@ drv_stdout.lo: $(top_srcdir)/drivers/drv_stdout.c \ + load_669.lo load_amf.lo load_asy.lo load_dsm.lo load_far.lo \ + load_gdm.lo load_gt2.lo load_it.lo load_imf.lo load_m15.lo load_med.lo \ + load_mod.lo load_mtm.lo load_okt.lo \ +@@ -130,6 +130,9 @@ drv_stdout.lo: $(top_srcdir)/drivers/drv_stdout.c \ drv_sun.lo: $(top_srcdir)/drivers/drv_sun.c \ $(top_builddir)/include/mikmod.h $(top_srcdir)/include/mikmod_internals.h $(COMPILE) -c $(top_srcdir)/drivers/drv_sun.c Index: patches/patch-libmikmod_m4 =================================================================== RCS file: patches/patch-libmikmod_m4 diff -N patches/patch-libmikmod_m4 --- patches/patch-libmikmod_m4 22 Dec 2008 20:28:18 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,12 +0,0 @@ -$OpenBSD: patch-libmikmod_m4,v 1.1 2008/12/22 20:28:18 naddy Exp $ ---- libmikmod.m4.orig Mon Dec 22 21:02:20 2008 -+++ libmikmod.m4 Mon Dec 22 21:02:37 2008 -@@ -8,7 +8,7 @@ dnl AM_PATH_LIBMIKMOD([MINIMUM-VERSION, [ACTION-IF-FOU - dnl Test for libmikmod, and define LIBMIKMOD_CFLAGS, LIBMIKMOD_LIBS and - dnl LIBMIKMOD_LDADD - dnl --AC_DEFUN(AM_PATH_LIBMIKMOD, -+AC_DEFUN([AM_PATH_LIBMIKMOD], - [dnl - dnl Get the cflags and libraries from the libmikmod-config script - dnl Index: patches/patch-playercode_mdreg_c =================================================================== RCS file: /cvs/ports/audio/libmikmod/patches/patch-playercode_mdreg_c,v retrieving revision 1.1 diff -u -p -r1.1 patch-playercode_mdreg_c --- patches/patch-playercode_mdreg_c 11 Jan 2010 04:25:26 -0000 1.1 +++ patches/patch-playercode_mdreg_c 10 Jan 2013 00:36:33 -0000 @@ -1,7 +1,7 @@ -$OpenBSD: patch-playercode_mdreg_c,v 1.1 2010/01/11 04:25:26 jakemsr Exp $ ---- playercode/mdreg.c.orig Fri Dec 18 23:51:15 2009 -+++ playercode/mdreg.c Fri Dec 18 23:51:44 2009 -@@ -66,6 +66,9 @@ void _mm_registeralldrivers(void) +$OpenBSD$ +--- playercode/mdreg.c.orig Wed Mar 14 17:03:00 2012 ++++ playercode/mdreg.c Thu Jan 10 00:18:55 2013 +@@ -69,6 +69,9 @@ void _mm_registeralldrivers(void) #ifdef DRV_SUN _mm_registerdriver(&drv_sun); #endif Index: patches/patch-playercode_mloader_c =================================================================== RCS file: patches/patch-playercode_mloader_c diff -N patches/patch-playercode_mloader_c --- patches/patch-playercode_mloader_c 2 Jan 2013 15:13:02 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,21 +0,0 @@ -$OpenBSD: patch-playercode_mloader_c,v 1.1 2013/01/02 15:13:02 stsp Exp $ -Fix a NULL dereference triggered by the games/ri-li port. ---- playercode/mloader.c.orig Mon Dec 31 01:30:02 2012 -+++ playercode/mloader.c Mon Dec 31 01:30:54 2012 -@@ -450,10 +450,12 @@ MODULE* Player_LoadGeneric_internal(MREADER *reader,in - if (!l->Init || l->Init()) { - _mm_rewind(modreader); - ok = l->Load(curious); -- /* propagate inflags=flags for in-module samples */ -- for (t = 0; t < of.numsmp; t++) -- if (of.samples[t].inflags == 0) -- of.samples[t].inflags = of.samples[t].flags; -+ if (ok) { -+ /* propagate inflags=flags for in-module samples */ -+ for (t = 0; t < of.numsmp; t++) -+ if (of.samples[t].inflags == 0) -+ of.samples[t].inflags = of.samples[t].flags; -+ } - } else - ok = 0; - Index: patches/patch-playercode_mplayer_c =================================================================== RCS file: /cvs/ports/audio/libmikmod/patches/patch-playercode_mplayer_c,v retrieving revision 1.5 diff -u -p -r1.5 patch-playercode_mplayer_c --- patches/patch-playercode_mplayer_c 23 Oct 2008 22:06:28 -0000 1.5 +++ patches/patch-playercode_mplayer_c 10 Jan 2013 00:36:33 -0000 @@ -1,16 +1,10 @@ -$OpenBSD: patch-playercode_mplayer_c,v 1.5 2008/10/23 22:06:28 miod Exp $ ---- playercode/mplayer.c.orig Mon Jan 21 21:23:56 2002 -+++ playercode/mplayer.c Wed Oct 22 19:56:49 2008 -@@ -254,7 +254,7 @@ static int MP_FindEmptyChannel(MODULE *mod) - Voice_Stopped_internal(t)) - return t; - -- tvol=0xffffffUL;t=0;a=mod->voice; -+ tvol=0xffffffUL;t=-1;a=mod->voice; - for (k=0;k<md_sngchn;k++,a++) { - /* allow us to take over a nonexisting sample */ - if (!a->main.s) -@@ -367,9 +367,9 @@ static SWORD StartEnvelope(ENVPR *t,UBYTE flg,UBYTE pt +$OpenBSD$ + +Avoid setting envelope cursors to negative values. + +--- playercode/mplayer.c.orig Thu Jan 10 00:29:05 2013 ++++ playercode/mplayer.c Thu Jan 10 00:31:08 2013 +@@ -365,9 +365,9 @@ static SWORD StartEnvelope(ENVPR *t,UBYTE flg,UBYTE pt } /* Fit in the envelope, still */ @@ -22,36 +16,3 @@ $OpenBSD: patch-playercode_mplayer_c,v 1 t->b = t->pts-1; return t->env[t->a].val; -@@ -442,24 +442,22 @@ static SWORD ProcessEnvelope(MP_VOICE *aout, ENVPR *t, - } else - /* - * Non looping situations. -- * Start to fade if the volume envelope is finished. - */ -- if (p > t->env[t->pts - 1].pos) { -+ if (a != b) -+ v = InterpolateEnv(p, &t->env[a], &t->env[b]); -+ else - v = t->env[a].val; -+ -+ /* -+ * Start to fade if the volume envelope is finished. -+ */ -+ if (p >= t->env[t->pts - 1].pos) { - if (t->flg & EF_VOLENV) { - aout->main.keyoff |= KEY_FADE; - if (!v) - aout->main.fadevol = 0; - } - } else { -- /* -- * Regular processing : compute value, progress one step. -- */ -- if (a != b) -- v = InterpolateEnv(p, &t->env[a], &t->env[b]); -- else -- v = t->env[a].val; -- - p++; - /* did pointer reach point b? */ - if (p >= t->env[b].pos)