summaryrefslogtreecommitdiff
path: root/audio/timidity/files
diff options
context:
space:
mode:
Diffstat (limited to 'audio/timidity/files')
-rw-r--r--audio/timidity/files/patch-Makefile (renamed from audio/timidity/files/patch-ab)0
-rw-r--r--audio/timidity/files/patch-aa32
-rw-r--r--audio/timidity/files/patch-ae177
-rw-r--r--audio/timidity/files/patch-af27
-rw-r--r--audio/timidity/files/patch-ag87
-rw-r--r--audio/timidity/files/patch-common.c11
-rw-r--r--audio/timidity/files/patch-config.h25
-rw-r--r--audio/timidity/files/patch-dumb_c.c4
-rw-r--r--audio/timidity/files/patch-instrum.c11
-rw-r--r--audio/timidity/files/patch-linux_a.c139
-rw-r--r--audio/timidity/files/patch-mix.c14
-rw-r--r--audio/timidity/files/patch-playmidi.c11
-rw-r--r--audio/timidity/files/patch-raw_a.c10
-rw-r--r--audio/timidity/files/patch-readmidi.c11
-rw-r--r--audio/timidity/files/patch-resample.c14
-rw-r--r--audio/timidity/files/patch-timidity.c11
-rw-r--r--audio/timidity/files/patch-timidity.cfg (renamed from audio/timidity/files/patch-ac)16
-rw-r--r--audio/timidity/files/patch-wav2pat.c11
-rw-r--r--audio/timidity/files/patch-wave_a.c10
19 files changed, 292 insertions, 329 deletions
diff --git a/audio/timidity/files/patch-ab b/audio/timidity/files/patch-Makefile
index d1c7db256a70..d1c7db256a70 100644
--- a/audio/timidity/files/patch-ab
+++ b/audio/timidity/files/patch-Makefile
diff --git a/audio/timidity/files/patch-aa b/audio/timidity/files/patch-aa
deleted file mode 100644
index c6f1c4dc1d23..000000000000
--- a/audio/timidity/files/patch-aa
+++ /dev/null
@@ -1,32 +0,0 @@
-*** mix.c.orig Mon May 20 17:09:46 1996
---- mix.c Sun Nov 17 10:01:36 1996
-***************
-*** 23,29 ****
---- 23,33 ----
-
- #include <math.h>
- #include <stdio.h>
-+ #ifdef __FreeBSD__
-+ #include <stdlib.h>
-+ #else
- #include <malloc.h>
-+ #endif
-
- #include "config.h"
- #include "common.h"
-*** resample.c.orig Mon May 20 17:09:47 1996
---- resample.c Sun Nov 17 09:59:29 1996
-***************
-*** 22,28 ****
---- 22,32 ----
-
- #include <math.h>
- #include <stdio.h>
-+ #ifdef __FreeBSD__
-+ #include <stdlib.h>
-+ #else
- #include <malloc.h>
-+ #endif
-
- #include "config.h"
- #include "common.h"
diff --git a/audio/timidity/files/patch-ae b/audio/timidity/files/patch-ae
deleted file mode 100644
index bc2666e7cfc4..000000000000
--- a/audio/timidity/files/patch-ae
+++ /dev/null
@@ -1,177 +0,0 @@
-*** linux_a.c.orig Mon May 20 17:09:46 1996
---- linux_a.c Tue Jun 16 21:40:17 1998
-***************
-*** 71,82 ****
- then 8-bit unsigned if it fails. If you have a sound device that
- can't handle either, let me know. */
-
- static int open_output(void)
- {
- int fd, tmp, i, warnings=0;
-
- /* Open the audio device */
-! fd=open(dpm.name, O_RDWR | O_NDELAY);
- if (fd<0)
- {
- ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "%s: %s",
---- 71,85 ----
- then 8-bit unsigned if it fails. If you have a sound device that
- can't handle either, let me know. */
-
-+ /* Flag for Luigi Rizzo new sound driver (as opposed to VoxWare) */
-+ static int luigi_driver = 0;
-+
- static int open_output(void)
- {
- int fd, tmp, i, warnings=0;
-
- /* Open the audio device */
-! fd=open(dpm.name, O_RDWR);
- if (fd<0)
- {
- ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "%s: %s",
-***************
-*** 84,89 ****
---- 87,109 ----
- return -1;
- }
-
-+ /* Figure out if we're running with the Luigi driver or
-+ the original VoxWare driver, with code based on dburr/luigi
-+ in ports/5607. It'd be great if we could do this before
-+ opening the audio device, but oh well... */
-+ #if defined(AIOGFMT) /* only defined in Luigi driver */
-+ {
-+ snd_chan_param s;
-+ int i;
-+ i = ioctl(fd, AIOGFMT, &s);
-+ if (i != -1)
-+ luigi_driver = 1;
-+ }
-+ #endif
-+
-+ ctl->cmsg(CMSG_INFO, VERB_VERBOSE, "Using %s sound driver",
-+ luigi_driver ? "luigi" : "VoxWare");
-+
- /* They can't mean these */
- dpm.encoding &= ~(PE_ULAW|PE_BYTESWAP);
-
-***************
-*** 92,97 ****
---- 112,140 ----
- the other one. */
-
- i=tmp=(dpm.encoding & PE_16BIT) ? 16 : 8;
-+ if (luigi_driver)
-+ {
-+ if (dpm.encoding & PE_16BIT) {
-+ int fmt = AFMT_S16_LE ;
-+
-+ if (ioctl(fd, SNDCTL_DSP_SETFMT, &fmt) < 0 || fmt != AFMT_S16_LE) {
-+ fmt = AFMT_U8 ;
-+ if (ioctl(fd, SNDCTL_DSP_SETFMT, &fmt) < 0 || fmt != AFMT_U8) {
-+ ctl->cmsg(CMSG_ERROR, VERB_NORMAL,
-+ "%s doesn't support 16- or 8-bit sample width",
-+ dpm.name);
-+ close(fd);
-+ return -1;
-+ }
-+ ctl->cmsg(CMSG_WARNING, VERB_VERBOSE,
-+ "Sample width adjusted to %d bits", tmp);
-+ dpm.encoding ^= PE_16BIT;
-+ warnings = 1;
-+ }
-+ }
-+ }
-+ else
-+ {
- if (ioctl(fd, SNDCTL_DSP_SAMPLESIZE, &tmp)<0 || tmp!=i)
- {
- /* Try the other one */
-***************
-*** 109,114 ****
---- 152,158 ----
- dpm.encoding ^= PE_16BIT;
- warnings=1;
- }
-+ }
- if (dpm.encoding & PE_16BIT)
- dpm.encoding |= PE_SIGNED;
- else
-***************
-*** 163,168 ****
---- 207,214 ----
- /* Set buffer fragments (in extra_param[0]) */
-
- tmp=AUDIO_BUFFER_BITS;
-+ if (luigi_driver)
-+ tmp += 2;
- if (!(dpm.encoding & PE_MONO)) tmp++;
- if (dpm.encoding & PE_16BIT) tmp++;
- tmp |= (dpm.extra_param[0]<<16);
-***************
-*** 189,216 ****
- return warnings;
- }
-
- static void output_data(int32 *buf, int32 count)
- {
- if (!(dpm.encoding & PE_MONO)) count*=2; /* Stereo samples */
-
-! if (dpm.encoding & PE_16BIT)
-! {
- /* Convert data to signed 16-bit PCM */
- s32tos16(buf, count);
-!
-! /* Write the data out. Linux likes to give an EINTR if you suspend
-! a program while waiting on a write, so we may need to retry. */
-! while ((-1==write(dpm.fd, buf, count * 2)) && errno==EINTR)
-! ;
-! }
-! else
-! {
- /* Convert to 8-bit unsigned and write out. */
- s32tou8(buf, count);
-!
-! while ((-1==write(dpm.fd, buf, count)) && errno==EINTR)
-! ;
- }
- }
-
- static void close_output(void)
---- 235,269 ----
- return warnings;
- }
-
-+ /* output_data comes from Luigi's linux_a.c. This version seems to allow
-+ for partial writes to the sound device, where as the original version
-+ doesn't. */
- static void output_data(int32 *buf, int32 count)
- {
-+ char *p;
-+ int res, l;
-+
- if (!(dpm.encoding & PE_MONO)) count*=2; /* Stereo samples */
-
-! if (dpm.encoding & PE_16BIT) {
- /* Convert data to signed 16-bit PCM */
- s32tos16(buf, count);
-! res = count*2;
-! } else {
- /* Convert to 8-bit unsigned and write out. */
- s32tou8(buf, count);
-! res = count;
-! }
-! for (p = (char *) buf; res > 0; res -= l) {
-! again:
-! l = write(dpm.fd, p, res);
-! if (l < 0) {
-! if (errno == EINTR)
-! goto again;
-! return;
- }
-+ p += l;
-+ }
- }
-
- static void close_output(void)
diff --git a/audio/timidity/files/patch-af b/audio/timidity/files/patch-af
deleted file mode 100644
index dad932efd2fc..000000000000
--- a/audio/timidity/files/patch-af
+++ /dev/null
@@ -1,27 +0,0 @@
-*** config.h.orig Sat Jun 1 07:54:49 1996
---- config.h Sat Sep 18 15:32:38 1999
-***************
-*** 217,222 ****
---- 217,238 ----
- # endif
- #endif /* linux */
-
-+ #ifdef __FreeBSD__
-+ #include <errno.h>
-+ #include <machine/endian.h>
-+ #if BYTE_ORDER == LITTLE_ENDIAN
-+ #undef BIG_ENDIAN
-+ #undef PDP_ENDIAN
-+ #elif BYTE_ORDER == BIG_ENDIAN
-+ #undef LITTLE_ENDIAN
-+ #undef PDP_ENDIAN
-+ #else
-+ # error No valid byte sex defined
-+ #endif
-+ #define USE_LDEXP
-+ #define PI M_PI
-+ #endif
-+
- /* Win32 on Intel machines */
- #ifdef __WIN32__
- # define LITTLE_ENDIAN
diff --git a/audio/timidity/files/patch-ag b/audio/timidity/files/patch-ag
deleted file mode 100644
index 2d24e035ec23..000000000000
--- a/audio/timidity/files/patch-ag
+++ /dev/null
@@ -1,87 +0,0 @@
---- common.c 2003/02/08 01:42:31 1.1
-+++ common.c 2003/02/08 01:53:36
-@@ -24,7 +24,7 @@
- #include <stdio.h>
- #include <stdlib.h>
-
--#if defined(SOLARIS) || defined(__WIN32__)
-+#if defined(SOLARIS) || defined(__WIN32__) || defined(__FreeBSD__)
- #include <string.h>
- #else
- #include <strings.h>
---- instrum.c 2003/02/08 01:42:31 1.1
-+++ instrum.c 2003/02/08 01:53:50
-@@ -25,7 +25,7 @@
-
- #include <stdio.h>
-
--#if defined(SOLARIS) || defined(__WIN32__)
-+#if defined(SOLARIS) || defined(__WIN32__) || defined(__FreeBSD__)
- #include <string.h>
- #else
- #include <strings.h>
---- playmidi.c 2003/02/08 01:42:31 1.1
-+++ playmidi.c 2003/02/08 01:54:18
-@@ -27,7 +27,7 @@
- #endif
- #include <stdlib.h>
-
--#if defined(SOLARIS) || defined(__WIN32__)
-+#if defined(SOLARIS) || defined(__WIN32__) || defined(__FreeBSD__)
- # include <string.h>
- #else
- #include <strings.h>
---- raw_a.c 2003/02/08 01:42:31 1.1
-+++ raw_a.c 2003/02/08 01:54:38
-@@ -35,6 +35,7 @@
-
- #ifdef __FreeBSD__
- #include <stdio.h>
-+#include <string.h>
- #endif
-
- #include "config.h"
---- readmidi.c 2003/02/08 01:42:31 1.1
-+++ readmidi.c 2003/02/08 01:53:19
-@@ -23,7 +23,7 @@
- #include <stdlib.h>
- #include <errno.h>
-
--#if defined(SOLARIS) | defined(__WIN32__)
-+#if defined(SOLARIS) || defined(__WIN32__) || defined(__FreeBSD__)
- # include <string.h>
- #else
- #include <strings.h>
---- timidity.c 2003/02/08 01:42:31 1.1
-+++ timidity.c 2003/02/08 01:54:51
-@@ -21,7 +21,7 @@
- #include <stdio.h>
- #include <stdlib.h>
-
--#if defined(SOLARIS) || defined(__WIN32__)
-+#if defined(SOLARIS) || defined(__WIN32__) || defined(__FreeBSD__)
- #include <string.h>
- #else
- #include <strings.h>
---- wav2pat.c 2003/02/08 01:42:31 1.1
-+++ wav2pat.c 2003/02/08 01:55:29
-@@ -28,7 +28,7 @@
- #include <unistd.h>
- #include <fcntl.h>
-
--#ifdef SOLARIS
-+#if defined(SOLARIS) || defined(__FreeBSD__)
- #include <string.h>
- #else
- #include <strings.h>
---- wave_a.c 2003/02/08 01:42:31 1.1
-+++ wave_a.c 2003/02/08 01:55:45
-@@ -35,6 +35,7 @@
-
- #ifdef __FreeBSD__
- #include <stdio.h>
-+#include <string.h>
- #endif
-
- #include "config.h"
-
diff --git a/audio/timidity/files/patch-common.c b/audio/timidity/files/patch-common.c
new file mode 100644
index 000000000000..62f92114a610
--- /dev/null
+++ b/audio/timidity/files/patch-common.c
@@ -0,0 +1,11 @@
+--- ./common.c.orig 1996-06-01 07:20:19.000000000 -0500
++++ ./common.c 2013-04-21 10:18:23.000000000 -0500
+@@ -24,7 +24,7 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+
+-#if defined(SOLARIS) || defined(__WIN32__)
++#if defined(SOLARIS) || defined(__WIN32__) || defined(__FreeBSD__)
+ #include <string.h>
+ #else
+ #include <strings.h>
diff --git a/audio/timidity/files/patch-config.h b/audio/timidity/files/patch-config.h
new file mode 100644
index 000000000000..9330b30fb8e4
--- /dev/null
+++ b/audio/timidity/files/patch-config.h
@@ -0,0 +1,25 @@
+--- ./config.h.orig 1996-06-01 07:54:49.000000000 -0500
++++ ./config.h 2013-04-21 10:18:23.000000000 -0500
+@@ -217,6 +217,22 @@
+ # endif
+ #endif /* linux */
+
++#ifdef __FreeBSD__
++#include <errno.h>
++#include <machine/endian.h>
++#if BYTE_ORDER == LITTLE_ENDIAN
++#undef BIG_ENDIAN
++#undef PDP_ENDIAN
++#elif BYTE_ORDER == BIG_ENDIAN
++#undef LITTLE_ENDIAN
++#undef PDP_ENDIAN
++#else
++# error No valid byte sex defined
++#endif
++#define USE_LDEXP
++#define PI M_PI
++#endif
++
+ /* Win32 on Intel machines */
+ #ifdef __WIN32__
+ # define LITTLE_ENDIAN
diff --git a/audio/timidity/files/patch-dumb_c.c b/audio/timidity/files/patch-dumb_c.c
index d143d75c04da..2b740bd6aa96 100644
--- a/audio/timidity/files/patch-dumb_c.c
+++ b/audio/timidity/files/patch-dumb_c.c
@@ -1,5 +1,5 @@
---- dumb_c.c.orig Mon May 20 16:01:17 1996
-+++ dumb_c.c Tue Dec 4 23:45:01 2001
+--- ./dumb_c.c.orig 1996-05-20 09:01:17.000000000 -0500
++++ ./dumb_c.c 2013-04-21 10:18:23.000000000 -0500
@@ -66,10 +66,12 @@
ctl_expression, ctl_panning, ctl_sustain, ctl_pitch_bend
};
diff --git a/audio/timidity/files/patch-instrum.c b/audio/timidity/files/patch-instrum.c
new file mode 100644
index 000000000000..33d53c6241d5
--- /dev/null
+++ b/audio/timidity/files/patch-instrum.c
@@ -0,0 +1,11 @@
+--- ./instrum.c.orig 1996-05-20 08:15:10.000000000 -0500
++++ ./instrum.c 2013-04-21 10:18:23.000000000 -0500
+@@ -25,7 +25,7 @@
+
+ #include <stdio.h>
+
+-#if defined(SOLARIS) || defined(__WIN32__)
++#if defined(SOLARIS) || defined(__WIN32__) || defined(__FreeBSD__)
+ #include <string.h>
+ #else
+ #include <strings.h>
diff --git a/audio/timidity/files/patch-linux_a.c b/audio/timidity/files/patch-linux_a.c
new file mode 100644
index 000000000000..0d383938cdc0
--- /dev/null
+++ b/audio/timidity/files/patch-linux_a.c
@@ -0,0 +1,139 @@
+--- ./linux_a.c.orig 1996-05-20 08:09:46.000000000 -0500
++++ ./linux_a.c 2013-04-21 10:18:23.000000000 -0500
+@@ -71,12 +71,15 @@
+ then 8-bit unsigned if it fails. If you have a sound device that
+ can't handle either, let me know. */
+
++/* Flag for Luigi Rizzo new sound driver (as opposed to VoxWare) */
++static int luigi_driver = 0;
++
+ static int open_output(void)
+ {
+ int fd, tmp, i, warnings=0;
+
+ /* Open the audio device */
+- fd=open(dpm.name, O_RDWR | O_NDELAY);
++ fd=open(dpm.name, O_RDWR);
+ if (fd<0)
+ {
+ ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "%s: %s",
+@@ -84,6 +87,23 @@
+ return -1;
+ }
+
++ /* Figure out if we're running with the Luigi driver or
++ the original VoxWare driver, with code based on dburr/luigi
++ in ports/5607. It'd be great if we could do this before
++ opening the audio device, but oh well... */
++#if defined(AIOGFMT) /* only defined in Luigi driver */
++ {
++ snd_chan_param s;
++ int i;
++ i = ioctl(fd, AIOGFMT, &s);
++ if (i != -1)
++ luigi_driver = 1;
++ }
++#endif
++
++ ctl->cmsg(CMSG_INFO, VERB_VERBOSE, "Using %s sound driver",
++ luigi_driver ? "luigi" : "VoxWare");
++
+ /* They can't mean these */
+ dpm.encoding &= ~(PE_ULAW|PE_BYTESWAP);
+
+@@ -92,6 +112,29 @@
+ the other one. */
+
+ i=tmp=(dpm.encoding & PE_16BIT) ? 16 : 8;
++ if (luigi_driver)
++ {
++ if (dpm.encoding & PE_16BIT) {
++ int fmt = AFMT_S16_LE ;
++
++ if (ioctl(fd, SNDCTL_DSP_SETFMT, &fmt) < 0 || fmt != AFMT_S16_LE) {
++ fmt = AFMT_U8 ;
++ if (ioctl(fd, SNDCTL_DSP_SETFMT, &fmt) < 0 || fmt != AFMT_U8) {
++ ctl->cmsg(CMSG_ERROR, VERB_NORMAL,
++ "%s doesn't support 16- or 8-bit sample width",
++ dpm.name);
++ close(fd);
++ return -1;
++ }
++ ctl->cmsg(CMSG_WARNING, VERB_VERBOSE,
++ "Sample width adjusted to %d bits", tmp);
++ dpm.encoding ^= PE_16BIT;
++ warnings = 1;
++ }
++ }
++ }
++ else
++ {
+ if (ioctl(fd, SNDCTL_DSP_SAMPLESIZE, &tmp)<0 || tmp!=i)
+ {
+ /* Try the other one */
+@@ -109,6 +152,7 @@
+ dpm.encoding ^= PE_16BIT;
+ warnings=1;
+ }
++ }
+ if (dpm.encoding & PE_16BIT)
+ dpm.encoding |= PE_SIGNED;
+ else
+@@ -163,6 +207,8 @@
+ /* Set buffer fragments (in extra_param[0]) */
+
+ tmp=AUDIO_BUFFER_BITS;
++ if (luigi_driver)
++ tmp += 2;
+ if (!(dpm.encoding & PE_MONO)) tmp++;
+ if (dpm.encoding & PE_16BIT) tmp++;
+ tmp |= (dpm.extra_param[0]<<16);
+@@ -189,28 +235,35 @@
+ return warnings;
+ }
+
++/* output_data comes from Luigi's linux_a.c. This version seems to allow
++ for partial writes to the sound device, where as the original version
++ doesn't. */
+ static void output_data(int32 *buf, int32 count)
+ {
++ char *p;
++ int res, l;
++
+ if (!(dpm.encoding & PE_MONO)) count*=2; /* Stereo samples */
+
+- if (dpm.encoding & PE_16BIT)
+- {
++ if (dpm.encoding & PE_16BIT) {
+ /* Convert data to signed 16-bit PCM */
+ s32tos16(buf, count);
+-
+- /* Write the data out. Linux likes to give an EINTR if you suspend
+- a program while waiting on a write, so we may need to retry. */
+- while ((-1==write(dpm.fd, buf, count * 2)) && errno==EINTR)
+- ;
+- }
+- else
+- {
++ res = count*2;
++ } else {
+ /* Convert to 8-bit unsigned and write out. */
+ s32tou8(buf, count);
+-
+- while ((-1==write(dpm.fd, buf, count)) && errno==EINTR)
+- ;
++ res = count;
++ }
++ for (p = (char *) buf; res > 0; res -= l) {
++again:
++ l = write(dpm.fd, p, res);
++ if (l < 0) {
++ if (errno == EINTR)
++ goto again;
++ return;
+ }
++ p += l;
++ }
+ }
+
+ static void close_output(void)
diff --git a/audio/timidity/files/patch-mix.c b/audio/timidity/files/patch-mix.c
new file mode 100644
index 000000000000..44b50f10c021
--- /dev/null
+++ b/audio/timidity/files/patch-mix.c
@@ -0,0 +1,14 @@
+--- ./mix.c.orig 1996-05-20 08:09:46.000000000 -0500
++++ ./mix.c 2013-04-21 10:18:23.000000000 -0500
+@@ -23,7 +23,11 @@
+
+ #include <math.h>
+ #include <stdio.h>
++#ifdef __FreeBSD__
++#include <stdlib.h>
++#else
+ #include <malloc.h>
++#endif
+
+ #include "config.h"
+ #include "common.h"
diff --git a/audio/timidity/files/patch-playmidi.c b/audio/timidity/files/patch-playmidi.c
new file mode 100644
index 000000000000..4d313ea223e5
--- /dev/null
+++ b/audio/timidity/files/patch-playmidi.c
@@ -0,0 +1,11 @@
+--- ./playmidi.c.orig 1996-05-20 08:09:46.000000000 -0500
++++ ./playmidi.c 2013-04-21 10:18:23.000000000 -0500
+@@ -27,7 +27,7 @@
+ #endif
+ #include <stdlib.h>
+
+-#if defined(SOLARIS) || defined(__WIN32__)
++#if defined(SOLARIS) || defined(__WIN32__) || defined(__FreeBSD__)
+ # include <string.h>
+ #else
+ #include <strings.h>
diff --git a/audio/timidity/files/patch-raw_a.c b/audio/timidity/files/patch-raw_a.c
new file mode 100644
index 000000000000..35dc2e936265
--- /dev/null
+++ b/audio/timidity/files/patch-raw_a.c
@@ -0,0 +1,10 @@
+--- ./raw_a.c.orig 1996-05-20 08:09:47.000000000 -0500
++++ ./raw_a.c 2013-04-21 10:18:23.000000000 -0500
+@@ -35,6 +35,7 @@
+
+ #ifdef __FreeBSD__
+ #include <stdio.h>
++#include <string.h>
+ #endif
+
+ #include "config.h"
diff --git a/audio/timidity/files/patch-readmidi.c b/audio/timidity/files/patch-readmidi.c
new file mode 100644
index 000000000000..3282b42d223a
--- /dev/null
+++ b/audio/timidity/files/patch-readmidi.c
@@ -0,0 +1,11 @@
+--- ./readmidi.c.orig 1996-05-20 08:09:47.000000000 -0500
++++ ./readmidi.c 2013-04-21 10:18:23.000000000 -0500
+@@ -23,7 +23,7 @@
+ #include <stdlib.h>
+ #include <errno.h>
+
+-#if defined(SOLARIS) | defined(__WIN32__)
++#if defined(SOLARIS) || defined(__WIN32__) || defined(__FreeBSD__)
+ # include <string.h>
+ #else
+ #include <strings.h>
diff --git a/audio/timidity/files/patch-resample.c b/audio/timidity/files/patch-resample.c
new file mode 100644
index 000000000000..254f5bbd294f
--- /dev/null
+++ b/audio/timidity/files/patch-resample.c
@@ -0,0 +1,14 @@
+--- ./resample.c.orig 1996-05-20 08:09:47.000000000 -0500
++++ ./resample.c 2013-04-21 10:18:23.000000000 -0500
+@@ -22,7 +22,11 @@
+
+ #include <math.h>
+ #include <stdio.h>
++#ifdef __FreeBSD__
++#include <stdlib.h>
++#else
+ #include <malloc.h>
++#endif
+
+ #include "config.h"
+ #include "common.h"
diff --git a/audio/timidity/files/patch-timidity.c b/audio/timidity/files/patch-timidity.c
new file mode 100644
index 000000000000..db44a7a11ea7
--- /dev/null
+++ b/audio/timidity/files/patch-timidity.c
@@ -0,0 +1,11 @@
+--- ./timidity.c.orig 1996-05-21 14:16:20.000000000 -0500
++++ ./timidity.c 2013-04-21 10:18:23.000000000 -0500
+@@ -21,7 +21,7 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+
+-#if defined(SOLARIS) || defined(__WIN32__)
++#if defined(SOLARIS) || defined(__WIN32__) || defined(__FreeBSD__)
+ #include <string.h>
+ #else
+ #include <strings.h>
diff --git a/audio/timidity/files/patch-ac b/audio/timidity/files/patch-timidity.cfg
index 76b2da1f5441..7d6b7fe47fe1 100644
--- a/audio/timidity/files/patch-ac
+++ b/audio/timidity/files/patch-timidity.cfg
@@ -1,6 +1,14 @@
---- timidity.cfg.orig Mon May 22 02:40:27 1995
-+++ timidity.cfg Mon Jan 4 03:55:42 1999
-@@ -34,9 +34,9 @@
+--- ./timidity.cfg.orig 1995-05-21 17:40:27.000000000 -0500
++++ ./timidity.cfg 2013-04-21 10:18:23.000000000 -0500
+@@ -27,16 +27,16 @@
+ # If you've moved things around since compiling, uncomment and edit this to
+ # point to the library directory:
+ #
+-#dir /usr/local/lib/timidity
++dir %%TDIR%%
+ #
+
+ ##############################################################################
# This sets up the default patches in the TiMidity support package
# "timidity-lib-0.1.tar.gz":
@@ -17,7 +25,7 @@
#source midia.cfg
#
-+source goemon.cfg
++source %%TCONFIG%%
##############################################################################
# End of configuration file
diff --git a/audio/timidity/files/patch-wav2pat.c b/audio/timidity/files/patch-wav2pat.c
new file mode 100644
index 000000000000..ccecf7f127d4
--- /dev/null
+++ b/audio/timidity/files/patch-wav2pat.c
@@ -0,0 +1,11 @@
+--- ./wav2pat.c.orig 1996-05-20 08:09:47.000000000 -0500
++++ ./wav2pat.c 2013-04-21 10:18:23.000000000 -0500
+@@ -28,7 +28,7 @@
+ #include <unistd.h>
+ #include <fcntl.h>
+
+-#ifdef SOLARIS
++#if defined(SOLARIS) || defined(__FreeBSD__)
+ #include <string.h>
+ #else
+ #include <strings.h>
diff --git a/audio/timidity/files/patch-wave_a.c b/audio/timidity/files/patch-wave_a.c
new file mode 100644
index 000000000000..89b6121d813f
--- /dev/null
+++ b/audio/timidity/files/patch-wave_a.c
@@ -0,0 +1,10 @@
+--- ./wave_a.c.orig 1996-05-20 08:10:15.000000000 -0500
++++ ./wave_a.c 2013-04-21 10:18:23.000000000 -0500
+@@ -35,6 +35,7 @@
+
+ #ifdef __FreeBSD__
+ #include <stdio.h>
++#include <string.h>
+ #endif
+
+ #include "config.h"