aboutsummaryrefslogtreecommitdiff
path: root/audio/pd
diff options
context:
space:
mode:
authorMartin Wilke <miwi@FreeBSD.org>2007-03-27 12:23:05 +0000
committerMartin Wilke <miwi@FreeBSD.org>2007-03-27 12:23:05 +0000
commit5080fa145c5b5e6490612b3438c8ac1e49a75328 (patch)
tree6c0bc70213ed294a7546642bd1a2627cc222169c /audio/pd
parent95d5d1d071c29fcd2f4987ed1ef3cfd0ab204aa6 (diff)
downloadports-5080fa145c5b5e6490612b3438c8ac1e49a75328.tar.gz
ports-5080fa145c5b5e6490612b3438c8ac1e49a75328.zip
Notes
Diffstat (limited to 'audio/pd')
-rw-r--r--audio/pd/Makefile27
-rw-r--r--audio/pd/distinfo6
-rw-r--r--audio/pd/files/patch-extra_sigmund_sigmundtilde.c11
-rw-r--r--audio/pd/files/patch-src_configure.in125
-rw-r--r--audio/pd/files/patch-src_m_conf.c2
-rw-r--r--audio/pd/files/patch-src_m_glob.c34
-rw-r--r--audio/pd/files/patch-src_m_sched.c54
-rw-r--r--audio/pd/files/patch-src_s_file.c39
-rw-r--r--audio/pd/files/patch-src_s_inter.c45
-rw-r--r--audio/pd/files/patch-src_s_main.c62
-rw-r--r--audio/pd/files/patch-src_t_main.c17
-rw-r--r--audio/pd/files/patch-src_t_tkcmd.c13
-rw-r--r--audio/pd/files/patch-src_u_main.tk45
-rw-r--r--audio/pd/files/patch-src_x_list.c12
14 files changed, 373 insertions, 119 deletions
diff --git a/audio/pd/Makefile b/audio/pd/Makefile
index 82a3acc901a7..e8d2bc134f8f 100644
--- a/audio/pd/Makefile
+++ b/audio/pd/Makefile
@@ -6,28 +6,28 @@
#
PORTNAME= pd
-PORTVERSION= 0.39
+DISTVERSION= 0.40-2
+DISTVERSIONSUFFIX= .src
CATEGORIES= audio
MASTER_SITES= http://www-crca.ucsd.edu/~msp/Software/
-DISTNAME= pd-0.37-1test1.src
MAINTAINER= ports@FreeBSD.org
COMMENT= Pure Data, a MIDI-capable real-time audio processor/synthesizer
-LIB_DEPENDS= tcl84:${PORTSDIR}/lang/tcl84 \
- tk84:${PORTSDIR}/x11-toolkits/tk84
-
+WRKSRC= ${WRKDIR}/${DISTNAME:S;.src;/src;}
GNU_CONFIGURE= yes
-CONFIGURE_ENV= CFLAGS="${CFLAGS} ${PTHREAD_CFLAGS}" \
- LIBS="${PTHREAD_LIBS} -L${LOCALBASE}/lib -ltk84 -ltcl84"
+CONFIGURE_ENV= CFLAGS="${CFLAGS} ${PTHREAD_CFLAGS} -I${X11BASE}/include -I${TCL_INCLUDEDIR} -I${TK_INCLUDEDIR}" \
+ LIBS="${PTHREAD_LIBS} -L${LOCALBASE}/lib"
MAKEFILE= makefile
MAN1= pd.1 pdreceive.1 pdsend.1
PATCH_WRKSRC= ${WRKSRC}/..
PLIST= ${WRKDIR}/pkg-plist
USE_GMAKE= yes
-USE_X_PREFIX= yes
USE_AUTOTOOLS= autoconf:259
-WRKSRC= ${WRKDIR}/pd-0.37-1test1/src
+USE_TCL= yes
+USE_TK= yes
+USE_TCL_BUILD= yes
+USE_TK_BUILD= yes
.include <bsd.port.pre.mk>
@@ -40,12 +40,9 @@ pre-patch:
post-configure:
${MV} ${WRKSRC}/makefile ${WRKSRC}/makefile.orig
- ${SED} -e "s:^INCLUDE = :INCLUDE = -I${LOCALBASE}/include/tk8.4 \
- -I${LOCALBASE}/include/tcl8.4 -I${X11BASE}/include :g; \
- s:^LIB =:LIB =${PTHREAD_LIBS}:g; \
- s:GFLAGS = :GFLAGS = -DUSEAPI_OSS :g; \
- s:x_midi.c ::g; s:s_midi.c ::g; \
- s:^CFLAGS =:CFLAGS+=${PTHREAD_CFLAGS}:g" \
+ ${SED} -e "s:^LIB =:LIB =${PTHREAD_LIBS}:g; \
+ s:^pddocdir = .*:pddocdir = ${PREFIX}/share/doc/pd:g; \
+ s:x_midi.c ::g; s:s_midi.c ::g;" \
< ${WRKSRC}/makefile.orig > ${WRKSRC}/makefile
pre-install:
diff --git a/audio/pd/distinfo b/audio/pd/distinfo
index ff062af43431..80a47a4bae47 100644
--- a/audio/pd/distinfo
+++ b/audio/pd/distinfo
@@ -1,3 +1,3 @@
-MD5 (pd-0.37-1test1.src.tar.gz) = 6f1f24d17b32bdd566fd5090a09c77f4
-SHA256 (pd-0.37-1test1.src.tar.gz) = d653a7c0be72cb7cc1c82887dd8e6c5a3c3251581ed0e25c90b315ad29f90bfe
-SIZE (pd-0.37-1test1.src.tar.gz) = 1895995
+MD5 (pd-0.40-2.src.tar.gz) = 2622e12b6fa0bd69db9732972e953afb
+SHA256 (pd-0.40-2.src.tar.gz) = a9e0bf841c6411cd301888e0afdb6f50aafcf6868a3f7b8a369f7ae744666c95
+SIZE (pd-0.40-2.src.tar.gz) = 2158886
diff --git a/audio/pd/files/patch-extra_sigmund_sigmundtilde.c b/audio/pd/files/patch-extra_sigmund_sigmundtilde.c
new file mode 100644
index 000000000000..90baaeda5439
--- /dev/null
+++ b/audio/pd/files/patch-extra_sigmund_sigmundtilde.c
@@ -0,0 +1,11 @@
+--- extra/sigmund~/sigmund~.c.orig Sun Mar 25 12:22:47 2007
++++ extra/sigmund~/sigmund~.c Sun Mar 25 12:22:50 2007
+@@ -16,7 +16,7 @@
+ #ifdef MSW
+ #include <malloc.h>
+ #else
+-#include <alloca.h>
++//#include <alloca.h>
+ #endif
+ #include <stdlib.h>
+ #ifdef NT
diff --git a/audio/pd/files/patch-src_configure.in b/audio/pd/files/patch-src_configure.in
index 51458a9f3edb..c5b3bfa7449b 100644
--- a/audio/pd/files/patch-src_configure.in
+++ b/audio/pd/files/patch-src_configure.in
@@ -1,21 +1,121 @@
-$FreeBSD$
-
---- src/configure.in.orig Fri Sep 26 21:40:18 2003
-+++ src/configure.in Tue Nov 11 23:53:26 2003
-@@ -136,6 +136,38 @@
- AC_CHECK_LIB(tk8.0, main,,echo no tk library found || exit 1)))))))
+--- src/configure.in.orig Sat Oct 28 21:13:24 2006
++++ src/configure.in Sun Mar 25 13:28:57 2007
+@@ -22,6 +22,9 @@
+ AC_SUBST(EXTERNTARGET)
+ dnl other defaults
++dnl respect upstream CFLAGS
++GUIFLAGS="$CFLAGS $GUIFLAGS"
++echo Base GUIFLAGS=$GUIFLAGS
+ dnl check for features
+
+@@ -83,7 +86,7 @@
+ echo "pthreads required" || exit 1)
+
+ dnl Check for fftw package
+-if test x$fftw == "xyes";
++if test x$fftw = "xyes";
+ then
+ AC_CHECK_LIB(fftw, fftw_one,PDLIB="$PDLIB -lfftw",
+ echo "fftw package not found - using built-in FFT"; fftw=no)
+@@ -92,62 +95,96 @@
+ dnl look for tcl 8.x... do I really have to go through all this!?
+
+ foundit=no
+-if test $foundit == "no";
++if test x$foundit = "xno";
+ then
+ AC_CHECK_HEADER(tcl.h,foundit=yes,)
+ fi
+-if test $foundit == "no";
++if test x$foundit = "xno";
+ then
+ AC_CHECK_HEADER(tcl8.7/tcl.h,
+ GUIFLAGS="$GUIFLAGS -I/usr/include/tcl8.7";foundit=yes,)
+ fi
+-if test $foundit == "no";
++if test x$foundit = "xno";
+ then
+ AC_CHECK_HEADER(tcl8.6/tcl.h,
+ GUIFLAGS="$GUIFLAGS -I/usr/include/tcl8.6";foundit=yes,)
+ fi
+-if test $foundit == "no";
++if test x$foundit = "xno";
+ then
+ AC_CHECK_HEADER(tcl8.5/tcl.h,
+ GUIFLAGS="$GUIFLAGS -I/usr/include/tcl8.5";foundit=yes,)
+ fi
+-if test $foundit == "no";
++if test x$foundit = "xno";
+ then
+ AC_CHECK_HEADER(tcl8.4/tcl.h,
+ GUIFLAGS="$GUIFLAGS -I/usr/include/tcl8.4";foundit=yes,)
+ fi
+-if test $foundit == "no";
++if test x$foundit = "xno";
+ then
+ AC_CHECK_HEADER(tcl8.3/tcl.h,
+ GUIFLAGS="$GUIFLAGS -I/usr/include/tcl8.3";foundit=yes,)
+ fi
+-if test $foundit == "no";
++if test x$foundit = "xno";
+ then
+ AC_CHECK_HEADER(tcl8.2/tcl.h,
+ GUIFLAGS="$GUIFLAGS -I/usr/include/tcl8.2";foundit=yes,)
+ fi
+-if test $foundit == "no";
++if test x$foundit = "xno";
+ then
+ echo no tcl header found
+ exit -1
+ fi
+
+-AC_CHECK_LIB(tcl8.7, main,,
+- AC_CHECK_LIB(tcl8.6, main,,
+- AC_CHECK_LIB(tcl8.5, main,,
+- AC_CHECK_LIB(tcl8.4, main,,
+- AC_CHECK_LIB(tcl8.3, main,,
+- AC_CHECK_LIB(tcl8.2, main,,
+- AC_CHECK_LIB(tcl8.0, main,,echo no tcl library found || exit 1)))))))
+-
+-AC_CHECK_LIB(tk8.7, main,,
+- AC_CHECK_LIB(tk8.6, main,,
+- AC_CHECK_LIB(tk8.5, main,,
+- AC_CHECK_LIB(tk8.4, main,,
+- AC_CHECK_LIB(tk8.3, main,,
+- AC_CHECK_LIB(tk8.2, main,,
+- AC_CHECK_LIB(tk8.0, main,,echo no tk library found || exit 1)))))))
+-
++AC_CHECK_LIB(tcl87, main,,
++ AC_CHECK_LIB(tcl86, main,,
++ AC_CHECK_LIB(tcl85, main,,
++ AC_CHECK_LIB(tcl84, main,,
++ AC_CHECK_LIB(tcl83, main,,
++ AC_CHECK_LIB(tcl82, main,,
++ AC_CHECK_LIB(tcl80, main,,echo no tcl library found || exit 1)))))))
++
++AC_CHECK_LIB(tk87, main,,
++ AC_CHECK_LIB(tk86, main,,
++ AC_CHECK_LIB(tk85, main,,
++ AC_CHECK_LIB(tk84, main,,
++ AC_CHECK_LIB(tk83, main,,
++ AC_CHECK_LIB(tk82, main,,
++ AC_CHECK_LIB(tk80, main,,echo no tk library found || exit 1)))))))
++
++
+if test `uname -s` = FreeBSD;
+then
+ EXT=pd_freebsd
-+ MORECFLAGS="-DPA_USE_OSS -DPA_LITTLE_ENDIAN \
-+ -DUSEAPI_OSS \
-+ -I../portaudio/pa_common \
-+ -I../portaudio/pablio -I../portaudio/portmidi-macosx \
++ CPPFLAGS="-DDL_OPEN -DPA_USE_OSS -DUNIX -DUNISTD\
++ -DUSEAPI_OSS \
++ -I../portaudio/pa_common -I../portaudio/pablio \
++ -I../portmidi/pm_common \
++ -I../portmidi/pm_linux \
+ -Werror -fno-strict-aliasing"
++ LDFLAGS="-Wl,-export-dynamic"
+ SYSSRC="s_audio_oss.c"
-+ if test x$portaudio == "xyes";
++ if test x$portaudio = "xyes";
+ then
+ MORECFLAGS="-DUSEAPI_PORTAUDIO "$MORECFLAGS
+ SYSSRC="s_audio_pa.c \
@@ -37,7 +137,6 @@ $FreeBSD$
+ GUINAME="pd-gui"
+ OSNUMBER=0
+fi
-+
+
if test `uname -s` = Linux;
then
- dnl Ckecking for ALSA
diff --git a/audio/pd/files/patch-src_m_conf.c b/audio/pd/files/patch-src_m_conf.c
index 5c7946cb966a..49e17cdbe38e 100644
--- a/audio/pd/files/patch-src_m_conf.c
+++ b/audio/pd/files/patch-src_m_conf.c
@@ -11,7 +11,7 @@ $FreeBSD$
void x_misc_setup(void);
void x_net_setup(void);
void x_qlist_setup(void);
-@@ -78,7 +78,7 @@ void conf_init(void)
+@@ -79,7 +79,7 @@ void conf_init(void)
x_connective_setup();
x_time_setup();
x_arithmetic_setup();
diff --git a/audio/pd/files/patch-src_m_glob.c b/audio/pd/files/patch-src_m_glob.c
index e9c38711ee13..4860dfa6c5f0 100644
--- a/audio/pd/files/patch-src_m_glob.c
+++ b/audio/pd/files/patch-src_m_glob.c
@@ -1,30 +1,36 @@
$FreeBSD$
---- src/m_glob.c.orig Thu Jul 31 20:48:15 2003
-+++ src/m_glob.c Tue Nov 11 22:43:27 2003
-@@ -21,8 +21,8 @@ void glob_finderror(t_pd *dummy);
+--- src/m_glob.c.orig Sun Mar 25 00:37:25 2007
++++ src/m_glob.c Sun Mar 25 00:38:40 2007
+@@ -21,9 +21,9 @@
void glob_audio_properties(t_pd *dummy, t_floatarg flongform);
void glob_audio_dialog(t_pd *dummy, t_symbol *s, int argc, t_atom *argv);
void glob_audio_setapi(t_pd *dummy, t_floatarg f);
-void glob_midi_properties(t_pd *dummy, t_floatarg flongform);
-void glob_midi_dialog(t_pd *dummy, t_symbol *s, int argc, t_atom *argv);
+-void glob_midi_setapi(t_pd *dummy, t_floatarg f);
+//void glob_midi_properties(t_pd *dummy, t_floatarg flongform);
+//void glob_midi_dialog(t_pd *dummy, t_symbol *s, int argc, t_atom *argv);
++//void glob_midi_setapi(t_pd *dummy, t_floatarg f);
void glob_start_path_dialog(t_pd *dummy, t_floatarg flongform);
void glob_path_dialog(t_pd *dummy, t_symbol *s, int argc, t_atom *argv);
- void glob_ping(t_pd *dummy);
-@@ -89,10 +89,10 @@ void glob_init(void)
- gensym("audio-dialog"), A_GIMME, 0);
+ void glob_start_startup_dialog(t_pd *dummy, t_floatarg flongform);
+@@ -96,12 +96,12 @@
+ gensym("audio-dialog"), A_GIMME, 0);
class_addmethod(glob_pdobject, (t_method)glob_audio_setapi,
- gensym("audio-setapi"), A_FLOAT, 0);
+ gensym("audio-setapi"), A_FLOAT, 0);
+- class_addmethod(glob_pdobject, (t_method)glob_midi_setapi,
+- gensym("midi-setapi"), A_FLOAT, 0);
- class_addmethod(glob_pdobject, (t_method)glob_midi_properties,
-- gensym("midi-properties"), A_DEFFLOAT, 0);
+- gensym("midi-properties"), A_DEFFLOAT, 0);
- class_addmethod(glob_pdobject, (t_method)glob_midi_dialog,
-- gensym("midi-dialog"), A_GIMME, 0);
-+// class_addmethod(glob_pdobject, (t_method)glob_midi_properties,
-+// gensym("midi-properties"), A_DEFFLOAT, 0);
-+// class_addmethod(glob_pdobject, (t_method)glob_midi_dialog,
-+// gensym("midi-dialog"), A_GIMME, 0);
+- gensym("midi-dialog"), A_GIMME, 0);
++ // class_addmethod(glob_pdobject, (t_method)glob_midi_setapi,
++ // gensym("midi-setapi"), A_FLOAT, 0);
++ // class_addmethod(glob_pdobject, (t_method)glob_midi_properties,
++ // gensym("midi-properties"), A_DEFFLOAT, 0);
++ // class_addmethod(glob_pdobject, (t_method)glob_midi_dialog,
++ // gensym("midi-dialog"), A_GIMME, 0);
class_addmethod(glob_pdobject, (t_method)glob_start_path_dialog,
- gensym("start-path-dialog"), A_DEFFLOAT, 0);
+ gensym("start-path-dialog"), 0);
class_addmethod(glob_pdobject, (t_method)glob_path_dialog,
diff --git a/audio/pd/files/patch-src_m_sched.c b/audio/pd/files/patch-src_m_sched.c
index b730945e2124..b8b7f33e5402 100644
--- a/audio/pd/files/patch-src_m_sched.c
+++ b/audio/pd/files/patch-src_m_sched.c
@@ -1,8 +1,8 @@
$FreeBSD$
---- src/m_sched.c.orig Wed Aug 27 18:02:19 2003
-+++ src/m_sched.c Tue Nov 11 22:45:18 2003
-@@ -377,8 +377,8 @@ call. This call returns true if samples
+--- src/m_sched.c.orig Wed May 18 04:49:44 2005
++++ src/m_sched.c Sun Mar 25 00:50:04 2007
+@@ -377,8 +377,8 @@
the audio I/O system is still busy with previous transfers.
*/
@@ -11,32 +11,32 @@ $FreeBSD$
+//void sys_pollmidiqueue( void);
+//void sys_initmidiqueue( void);
- int m_scheduler( void)
- {
-@@ -398,7 +398,7 @@ int m_scheduler( void)
- sys_sleepgrain = 100;
+ /* sys_idlehook is a hook the user can fill in to grab idle time. Return
+ nonzero if you actually used the time; otherwise we're really really idle and
+@@ -402,7 +402,7 @@
+ sys_sleepgrain = 100;
else if (sys_sleepgrain > 5000)
- sys_sleepgrain = 5000;
+ sys_sleepgrain = 5000;
- sys_initmidiqueue();
+// sys_initmidiqueue();
- while (1)
+ while (!sys_quit)
{
- int didsomething = 0;
-@@ -440,7 +440,7 @@ int m_scheduler( void)
- timeforward = SENDDACS_YES;
- else timeforward = SENDDACS_NO;
- }
-- sys_setmiditimediff(0, 1e-6 * sys_schedadvance);
-+// sys_setmiditimediff(0, 1e-6 * sys_schedadvance);
- sys_addhist(1);
- if (timeforward != SENDDACS_NO)
- sched_tick(sys_time + sys_time_per_dsp_tick);
-@@ -448,7 +448,7 @@ int m_scheduler( void)
- didsomething = 1;
+ int didsomething = 0;
+@@ -454,7 +454,7 @@
+ timeforward = SENDDACS_YES;
+ else timeforward = SENDDACS_NO;
+ }
+- sys_setmiditimediff(0, 1e-6 * sys_schedadvance);
++// sys_setmiditimediff(0, 1e-6 * sys_schedadvance);
+ sys_addhist(1);
+ if (timeforward != SENDDACS_NO)
+ sched_tick(sys_time + sys_time_per_dsp_tick);
+@@ -462,7 +462,7 @@
+ didsomething = 1;
- sys_addhist(2);
-- sys_pollmidiqueue();
-+// sys_pollmidiqueue();
- if (sys_pollgui())
- {
- if (!didsomething)
+ sys_addhist(2);
+- sys_pollmidiqueue();
++// sys_pollmidiqueue();
+ if (sys_pollgui())
+ {
+ if (!didsomething)
diff --git a/audio/pd/files/patch-src_s_file.c b/audio/pd/files/patch-src_s_file.c
new file mode 100644
index 000000000000..2af6bb91d9f3
--- /dev/null
+++ b/audio/pd/files/patch-src_s_file.c
@@ -0,0 +1,39 @@
+--- src/s_file.c.orig Sat Dec 31 21:08:37 2005
++++ src/s_file.c Sun Mar 25 01:47:57 2007
+@@ -339,7 +339,7 @@
+ break;
+ nmidioutdev++;
+ }
+- sys_open_midi(nmidiindev, midiindev, nmidioutdev, midioutdev, 0);
++// sys_open_midi(nmidiindev, midiindev, nmidioutdev, midioutdev, 0);
+
+ /* search path */
+ if (sys_getpreference("npath", prefbuf, MAXPDSTRING))
+@@ -397,8 +397,8 @@
+ int naudiooutdev, audiooutdev[MAXAUDIOOUTDEV], choutdev[MAXAUDIOOUTDEV];
+ int i, rate, advance;
+ char buf1[MAXPDSTRING], buf2[MAXPDSTRING];
+- int nmidiindev, midiindev[MAXMIDIINDEV];
+- int nmidioutdev, midioutdev[MAXMIDIOUTDEV];
++// int nmidiindev, midiindev[MAXMIDIINDEV];
++// int nmidioutdev, midioutdev[MAXMIDIOUTDEV];
+
+ sys_initsavepreferences();
+
+@@ -431,7 +431,7 @@
+ sprintf(buf1, "%d", rate);
+ sys_putpreference("rate", buf1);
+
+- /* MIDI settings */
++ /* MIDI settings
+ sys_get_midi_params(&nmidiindev, midiindev, &nmidioutdev, midioutdev);
+ sys_putpreference("nomidiin", (nmidiindev <= 0 ? "True" : "False"));
+ for (i = 0; i < nmidiindev; i++)
+@@ -447,6 +447,7 @@
+ sprintf(buf2, "%d", midioutdev[i]);
+ sys_putpreference(buf1, buf2);
+ }
++ */
+ /* file search path */
+
+ for (i = 0; 1; i++)
diff --git a/audio/pd/files/patch-src_s_inter.c b/audio/pd/files/patch-src_s_inter.c
index 4fb62ac68d02..bbf839d3c38f 100644
--- a/audio/pd/files/patch-src_s_inter.c
+++ b/audio/pd/files/patch-src_s_inter.c
@@ -1,15 +1,32 @@
-$FreeBSD$
-
---- src/s_inter.c.orig Mon Jul 28 16:49:04 2003
-+++ src/s_inter.c Tue Nov 11 22:46:26 2003
-@@ -893,8 +893,8 @@ void sys_bail(int n)
- #ifndef __linux /* sys_close_audio() hangs if you're in a signal? */
- fprintf(stderr, "closing audio...\n");
- sys_close_audio();
-- fprintf(stderr, "closing MIDI...\n");
-- sys_close_midi();
-+// fprintf(stderr, "closing MIDI...\n");
-+// sys_close_midi();
- fprintf(stderr, "... done.\n");
+--- src/s_inter.c.orig Tue Aug 15 07:03:09 2006
++++ src/s_inter.c Sun Mar 25 13:03:16 2007
+@@ -831,7 +831,7 @@
+
+ static int sys_watchfd;
+
+-#ifdef __linux__
++#if defined(__linux__) || defined(__FreeBSD__)
+ void glob_watchdog(t_pd *dummy)
+ {
+ if (write(sys_watchfd, "\n", 1) < 1)
+@@ -1247,7 +1247,8 @@
+ sys_gui("pdtk_watchdog\n");
#endif
- exit(1);
+ sys_get_audio_apis(buf);
+- sys_get_midi_apis(buf2);
++// sys_get_midi_apis(buf2);
++ strcpy(buf2, "{}");
+ sys_vgui("pdtk_pd_startup {%s} %s %s {%s}\n", pd_version, buf, buf2,
+ sys_font);
+ }
+@@ -1269,8 +1270,8 @@
+ #ifndef __linux__ /* sys_close_audio() hangs if you're in a signal? */
+ fprintf(stderr, "closing audio...\n");
+ sys_close_audio();
+- fprintf(stderr, "closing MIDI...\n");
+- sys_close_midi();
++// fprintf(stderr, "closing MIDI...\n");
++// sys_close_midi();
+ fprintf(stderr, "... done.\n");
+ #endif
+ exit(n);
diff --git a/audio/pd/files/patch-src_s_main.c b/audio/pd/files/patch-src_s_main.c
index 081c0fd98d4a..357adac3e0e9 100644
--- a/audio/pd/files/patch-src_s_main.c
+++ b/audio/pd/files/patch-src_s_main.c
@@ -1,15 +1,47 @@
-$FreeBSD$
-
---- src/s_main.c.orig Wed Oct 29 20:38:54 2003
-+++ src/s_main.c Tue Nov 11 22:45:46 2003
-@@ -253,8 +253,8 @@ int sys_main(int argc, char **argv)
- if (sys_startgui(sys_guidir->s_name)) /* start the gui */
- return(1);
- /* open audio and MIDI */
-- sys_open_midi(sys_nmidiin, sys_midiindevlist,
-- sys_nmidiout, sys_midioutdevlist);
-+// sys_open_midi(sys_nmidiin, sys_midiindevlist,
-+// sys_nmidiout, sys_midioutdevlist);
- sys_open_audio(sys_nsoundin, sys_soundindevlist, sys_nchin, sys_chinlist,
- sys_nsoundout, sys_soundoutdevlist, sys_nchout, sys_choutlist,
- sys_main_srate, sys_main_advance, 1);
+--- src/s_main.c.orig Wed Sep 27 19:22:35 2006
++++ src/s_main.c Sun Mar 25 19:47:12 2007
+@@ -310,7 +310,7 @@
+ else
+ {
+ /* open audio and MIDI */
+- sys_reopen_midi();
++// sys_reopen_midi();
+ sys_reopen_audio();
+ /* run scheduler until it quits */
+ return (m_scheduler());
+@@ -635,7 +635,7 @@
+ }
+ else if (!strcmp(*argv, "-alsamidi"))
+ {
+- sys_set_midi_api(API_ALSA);
++// sys_set_midi_api(API_ALSA);
+ argc--; argv++;
+ }
+ #endif
+@@ -904,7 +904,7 @@
+ /* add "doc/5.reference" library to helppath */
+ strncpy(sbuf, sys_libdir->s_name, MAXPDSTRING-30);
+ sbuf[MAXPDSTRING-30] = 0;
+- strcat(sbuf, "/doc/5.reference");
++ strcat(sbuf, "/share/doc/pd/5.reference");
+ sys_helppath = namelist_append_files(sys_helppath, sbuf);
+ /* correct to make audio and MIDI device lists zero based. On
+ MMIO, however, "1" really means the second device (the first one
+@@ -957,7 +957,7 @@
+ for (i = 0; i < naudiooutdev; i++)
+ audiooutdev[i] = sys_soundoutdevlist[i];
+ }
+- sys_get_midi_params(&nmidiindev, midiindev, &nmidioutdev, midioutdev);
++// sys_get_midi_params(&nmidiindev, midiindev, &nmidioutdev, midioutdev);
+ if (sys_nmidiin >= 0)
+ {
+ post("sys_nmidiin %d, nmidiindev %d", sys_nmidiin, nmidiindev);
+@@ -977,7 +977,7 @@
+ rate = sys_main_srate;
+ sys_open_audio(naudioindev, audioindev, nchindev, chindev,
+ naudiooutdev, audiooutdev, nchoutdev, choutdev, rate, advance, 0);
+- sys_open_midi(nmidiindev, midiindev, nmidioutdev, midioutdev, 0);
++// sys_open_midi(nmidiindev, midiindev, nmidioutdev, midioutdev, 0);
+ }
+
+ static void sys_addreferencepath(void)
diff --git a/audio/pd/files/patch-src_t_main.c b/audio/pd/files/patch-src_t_main.c
deleted file mode 100644
index cbc0e71138f1..000000000000
--- a/audio/pd/files/patch-src_t_main.c
+++ /dev/null
@@ -1,17 +0,0 @@
---- src/t_main.c.orig Sun Feb 13 00:32:01 2005
-+++ src/t_main.c Sun Feb 13 00:32:11 2005
-@@ -19,14 +19,6 @@
- #include <stdlib.h>
-
- /*
-- * The following variable is a special hack that is needed in order for
-- * Sun shared libraries to be used for Tcl.
-- */
--
--extern int matherr(void);
--int *tclDummyMathPtr = (int *) matherr;
--
--/*
- *----------------------------------------------------------------------
- *
- * main --
diff --git a/audio/pd/files/patch-src_t_tkcmd.c b/audio/pd/files/patch-src_t_tkcmd.c
new file mode 100644
index 000000000000..660552825eb8
--- /dev/null
+++ b/audio/pd/files/patch-src_t_tkcmd.c
@@ -0,0 +1,13 @@
+--- src/t_tkcmd.c.orig Sat Dec 31 21:08:37 2005
++++ src/t_tkcmd.c Sun Mar 25 12:12:15 2007
+@@ -50,6 +50,10 @@
+ #define STARTGUI
+ #endif
+
++#ifdef __FreeBSD__
++#define STARTGUI
++#endif
++
+ #define FIRSTPORTNUM 5600
+
+ void tcl_mess(char *s);
diff --git a/audio/pd/files/patch-src_u_main.tk b/audio/pd/files/patch-src_u_main.tk
new file mode 100644
index 000000000000..35d5b1077b8c
--- /dev/null
+++ b/audio/pd/files/patch-src_u_main.tk
@@ -0,0 +1,45 @@
+--- src/u_main.tk.orig Sun Oct 8 20:04:07 2006
++++ src/u_main.tk Sun Mar 25 22:15:29 2007
+@@ -91,7 +91,7 @@
+
+ set pd_deffont {courier 12 bold}
+
+-set help_top_directory $pd_guidir/doc
++set help_top_directory $pd_guidir/share/doc/pd
+
+ # it's unfortunate but we seem to have to turn off global bindings
+ # for Text objects to get control-s and control-t to do what we want for
+@@ -513,9 +513,9 @@
+ }
+
+ $mbar.audio add command -label {Test Audio and MIDI} \
+- -command {menu_doc_open doc/7.stuff/tools testtone.pd}
++ -command {menu_doc_open share/doc/pd/7.stuff/tools testtone.pd}
+ $mbar.audio add command -label {Load Meter} \
+- -command {menu_doc_open doc/7.stuff/tools load-meter.pd}
++ -command {menu_doc_open share/doc/pd/7.stuff/tools load-meter.pd}
+
+ # the MacOS X app menu
+
+@@ -526,7 +526,7 @@
+ # See SPECIAL MENUS IN MENUBARS http://www.tcl.tk/man/tcl8.4/TkCmd/menu.htm
+ if {$pd_nt == 2} {
+ $mbar.apple add command -label "About Pd..." -command \
+- {menu_doc_open doc/1.manual 1.introduction.txt}
++ {menu_doc_open share/doc/pd/1.manual 1.introduction.txt}
+ menu $mbar.apple.preferences -tearoff 0
+ $mbar.apple add cascade -label "Preferences" -menu $mbar.apple.preferences
+ $mbar.apple.preferences add command -label "Path..." \
+@@ -543,10 +543,10 @@
+ # the "Help" menu
+ if {$pd_nt != 2} {
+ $mbar.help add command -label {About Pd} \
+- -command {menu_doc_open doc/1.manual 1.introduction.txt}
++ -command {menu_doc_open share/doc/pd/1.manual 1.introduction.txt}
+ }
+ $mbar.help add command -label {Html ...} \
+- -command {menu_doc_open doc/1.manual index.htm}
++ -command {menu_doc_open share/doc/pd/1.manual index.htm}
+ $mbar.help add command -label {Browser ...} \
+ -command {menu_doc_browser $help_top_directory}
+ }
diff --git a/audio/pd/files/patch-src_x_list.c b/audio/pd/files/patch-src_x_list.c
new file mode 100644
index 000000000000..7e25a51b8b89
--- /dev/null
+++ b/audio/pd/files/patch-src_x_list.c
@@ -0,0 +1,12 @@
+--- src/x_list.c.orig Fri Nov 3 05:22:20 2006
++++ src/x_list.c Sun Mar 25 01:34:15 2007
+@@ -7,7 +7,8 @@
+ #ifdef MSW
+ #include <malloc.h>
+ #else
+-#include <alloca.h>
++#include <stdlib.h>
++/*#include <alloca.h>*/
+ #endif
+
+ extern t_pd *newest;