summaryrefslogtreecommitdiff
path: root/audio/csound5
diff options
context:
space:
mode:
authorben <ben@pkgsrc.org>2006-05-21 22:46:22 +0000
committerben <ben@pkgsrc.org>2006-05-21 22:46:22 +0000
commitfc888c69cd4a185b1778d9f203404a152cea919b (patch)
tree8ffa95e498386fc7bdcb77bd49bd66ca8715faf3 /audio/csound5
parent126104cdd70e228f19ba45f4d9c107434c83513d (diff)
downloadpkgsrc-fc888c69cd4a185b1778d9f203404a152cea919b.tar.gz
Initial import of csound5 version 5.01, a software synthesizer and
sequencer. Csound is a software synthesis package in the tradition of so-called music-N languages, among which the best-known is Music V. It consists of an orchestra- and score-driven executable, written in C for portability. Since Csound is a computational language, it is highly flexible and efficient; complexity is gained only at the expense of computation time. To do: - fix pthread issues in csound5 (is breaking realtime audio) - use options.mk framework for various modules - enable portaudio module (requires audio/portaudio-devel) - port portmidi to netbsd
Diffstat (limited to 'audio/csound5')
-rw-r--r--audio/csound5/DESCR8
-rw-r--r--audio/csound5/Makefile40
-rw-r--r--audio/csound5/PLIST69
-rw-r--r--audio/csound5/distinfo18
-rw-r--r--audio/csound5/patches/patch-ac172
-rw-r--r--audio/csound5/patches/patch-ad13
-rw-r--r--audio/csound5/patches/patch-ae13
-rw-r--r--audio/csound5/patches/patch-af31
-rw-r--r--audio/csound5/patches/patch-ag13
-rw-r--r--audio/csound5/patches/patch-ah13
-rw-r--r--audio/csound5/patches/patch-ai22
-rw-r--r--audio/csound5/patches/patch-aj13
-rw-r--r--audio/csound5/patches/patch-ak13
-rw-r--r--audio/csound5/patches/patch-al22
-rw-r--r--audio/csound5/patches/patch-am52
-rw-r--r--audio/csound5/patches/patch-an40
-rw-r--r--audio/csound5/patches/patch-ao13
17 files changed, 565 insertions, 0 deletions
diff --git a/audio/csound5/DESCR b/audio/csound5/DESCR
new file mode 100644
index 00000000000..909beaee389
--- /dev/null
+++ b/audio/csound5/DESCR
@@ -0,0 +1,8 @@
+Csound is a software synthesis package in the tradition of so-called
+music-N languages, among which the best-known is Music V. It consists
+of an orchestra- and score-driven executable, written in C for
+portability. Since Csound is a computational language, it is highly
+flexible and efficient; complexity is gained only at the expense of
+computation time. Basically Csound reads some files and creates the
+result as a file on disk or, on faster machines, through a DAC in real
+time.
diff --git a/audio/csound5/Makefile b/audio/csound5/Makefile
new file mode 100644
index 00000000000..f895999fa47
--- /dev/null
+++ b/audio/csound5/Makefile
@@ -0,0 +1,40 @@
+# $NetBSD: Makefile,v 1.1.1.1 2006/05/21 22:46:22 ben Exp $
+#
+
+DISTNAME= Csound${CSOUND_VERSION}_src
+PKGNAME= csound5-${CSOUND_VERSION}
+CATEGORIES= audio
+MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=csound/}
+WRKSRC= ${WRKDIR}/Csound${CSOUND_VERSION}
+
+MAINTAINER= ben@NetBSD.org
+HOMEPAGE= http://sourceforge.net/projects/csound/
+COMMENT= Software synthesizer and sequencer
+
+CSOUND_VERSION= 5.01
+USE_LANGUAGES= c c++
+CFLAGS+= -g -D__PKGSRC_PREFIX__=${PREFIX}/ -DBETA
+BUILD_DEPENDS+= scons>=0.96:../../devel/scons
+NOT_FOR_PLATFORM= *-*-alpha *-*-sparc64 # Severe LP64 problems
+SCONS= ${PREFIX}/bin/scons
+SCONS_ARGS= -C ${WRKSRC} prefix=${PREFIX}
+SCONS_ARGS+= buildDSSI=0 buildLoris=0 buildRelease=1
+SCONS_ARGS+= useALSA=0 useJack=0 useOSC=0 usePortMIDI=0
+SCONS_ARGS+= usePortAudio=0
+
+do-build:
+ cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${SCONS} ${SCONS_ARGS}
+
+do-install:
+ cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${SCONS} ${SCONS_ARGS} install
+ cd ${PREFIX} && ${LN} -s ../lib/csound5/csound bin/csound5
+
+.include "../../audio/fluidsynth/buildlink3.mk"
+.include "../../audio/libsndfile/buildlink3.mk"
+.include "../../devel/swig/buildlink3.mk"
+.include "../../graphics/jpeg/buildlink3.mk"
+.include "../../graphics/png/buildlink3.mk"
+.include "../../lang/python24/buildlink3.mk"
+.include "../../x11/fltk/buildlink3.mk"
+.include "../../mk/pthread.buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/audio/csound5/PLIST b/audio/csound5/PLIST
new file mode 100644
index 00000000000..51978aa5b8c
--- /dev/null
+++ b/audio/csound5/PLIST
@@ -0,0 +1,69 @@
+@comment $NetBSD: PLIST,v 1.1.1.1 2006/05/21 22:46:22 ben Exp $
+bin/csound5
+include/csound5/CppSound.hpp
+include/csound5/CsoundFile.hpp
+include/csound5/OpcodeBase.hpp
+include/csound5/cfgvar.h
+include/csound5/cscore.h
+include/csound5/csdl.h
+include/csound5/csound.h
+include/csound5/csound.hpp
+include/csound5/csoundCore.h
+include/csound5/cwindow.h
+include/csound5/filebuilding.h
+include/csound5/msg_attr.h
+include/csound5/pstream.h
+include/csound5/pvfileio.h
+include/csound5/soundio.h
+include/csound5/sysdep.h
+include/csound5/text.h
+include/csound5/version.h
+lib/csound5/cs
+lib/csound5/csb64enc
+lib/csound5/csound
+lib/csound5/cvanal
+lib/csound5/dnoise
+lib/csound5/envext
+lib/csound5/extract
+lib/csound5/extractor
+lib/csound5/het_export
+lib/csound5/het_import
+lib/csound5/hetro
+lib/csound5/lpanal
+lib/csound5/lpc_export
+lib/csound5/lpc_import
+lib/csound5/makecsd
+lib/csound5/mixer
+lib/csound5/pvanal
+lib/csound5/pvlook
+lib/csound5/scale
+lib/csound5/scot
+lib/csound5/scsort
+lib/csound5/sndinfo
+lib/csound5/srconv
+lib/csound5/csnd.py
+lib/csound5/plugins/libbabo.so
+lib/csound5/plugins/libbarmodel.so
+lib/csound5/plugins/libfluidOpcodes.so
+lib/csound5/plugins/libftest.so
+lib/csound5/plugins/libgrain4.so
+lib/csound5/plugins/libhrtferX.so
+lib/csound5/plugins/libminmax.so
+lib/csound5/plugins/libmixer.so
+lib/csound5/plugins/libmodal4.so
+lib/csound5/plugins/libphisem.so
+lib/csound5/plugins/libphysmod.so
+lib/csound5/plugins/libpitch.so
+@comment -- portaudio module -- lib/csound5/plugins/librtpa.so
+lib/csound5/plugins/libscansyn.so
+lib/csound5/plugins/libsfont.so
+lib/csound5/plugins/libstdopcod.so
+lib/csound5/plugins/libstdutil.so
+lib/csound5/plugins/libvbap.so
+lib/csound5/plugins/libwidgets.so
+lib/csound5/plugins/opcodes.dir
+lib/csound5/lib_csnd.so
+lib/csound5/libcsound.a
+@dirrm include/csound5
+@dirrm lib/csound5/plugins
+@dirrm lib/csound5
diff --git a/audio/csound5/distinfo b/audio/csound5/distinfo
new file mode 100644
index 00000000000..3ff8f2a1617
--- /dev/null
+++ b/audio/csound5/distinfo
@@ -0,0 +1,18 @@
+$NetBSD: distinfo,v 1.1.1.1 2006/05/21 22:46:22 ben Exp $
+
+SHA1 (Csound5.01_src.tar.gz) = b387da9b6c24961397e89ddcedd1229cdfebffe7
+RMD160 (Csound5.01_src.tar.gz) = 24652f8f650464d886f6d537ae991654f475ad4a
+Size (Csound5.01_src.tar.gz) = 2031426 bytes
+SHA1 (patch-ac) = 12c410532ece80a9f226ffcb4c986eaaa84e2006
+SHA1 (patch-ad) = 756308bc40378738794469fca72c3e249b314150
+SHA1 (patch-ae) = 8878e9927811b4c46deb473724a4e19631e326e9
+SHA1 (patch-af) = 7d885796ee6794ff88fb4b22aee7fe8b3084864c
+SHA1 (patch-ag) = 76a7283a2da202a866ef416f4cac4d581dca39ec
+SHA1 (patch-ah) = 9ecda7d9a8b4ff41dd84ce826a0d0ede0c09b15d
+SHA1 (patch-ai) = 10571cb1d5e579d36f7c60e0651cfde71fc5498e
+SHA1 (patch-aj) = e2661124db32cf3831c23f128e6d8edc628cafbc
+SHA1 (patch-ak) = 5837eb03a8950ea0d6fc6718f99070bdda015a86
+SHA1 (patch-al) = accb874d07de58b075e909efb7578d3f59372b6b
+SHA1 (patch-am) = 3e981f6e15fea1d94f4d87276b4c7840ed381ee7
+SHA1 (patch-an) = 5131a8e880bdb1cd4996c75e9579b591e2925c97
+SHA1 (patch-ao) = 22c845f281e1cacdda7c2334100c7ca54771cdc3
diff --git a/audio/csound5/patches/patch-ac b/audio/csound5/patches/patch-ac
new file mode 100644
index 00000000000..a35211bba5b
--- /dev/null
+++ b/audio/csound5/patches/patch-ac
@@ -0,0 +1,172 @@
+$NetBSD: patch-ac,v 1.1.1.1 2006/05/21 22:46:22 ben Exp $
+
+--- SConstruct.orig 2006-03-15 07:22:43.000000000 -0800
++++ SConstruct
+@@ -50,6 +50,8 @@ def today():
+ def getPlatform():
+ if sys.platform[:5] == 'linux':
+ return 'linux'
++ elif sys.platform[:6] == 'netbsd':
++ return 'netbsd'
+ elif sys.platform[:3] == 'win':
+ return 'mingw'
+ elif sys.platform[:6] == 'darwin':
+@@ -335,6 +337,15 @@ elif getPlatform() == 'mingw':
+ pythonLinkFlags = []
+ pythonLibraryPath = []
+ pythonLibs = ['python%s' % commonEnvironment['pythonVersion'].replace('.', '')]
++elif getPlatform() == 'netbsd':
++ commonEnvironment.Append(CCFLAGS = Split(os.environ['CFLAGS']))
++ commonEnvironment.Append(CXXFLAGS = Split(os.environ['CXXFLAGS']))
++ commonEnvironment.Append(LINKFLAGS = Split(os.environ['LDFLAGS']))
++ pythonIncludePath = []
++ pythonLinkFlags = []
++ pythonLibraryPath = []
++ pythonLibs = []
++ SConsignFile("/dev/null")
+
+ # Check for prerequisites.
+ # We check only for headers; checking for libs may fail
+@@ -485,7 +496,7 @@ def buildzip(env, target, source):
+ # library version is CS_VERSION.CS_APIVERSION
+ csoundLibraryVersion = '5.1'
+ csoundLibraryName = 'csound'
+-if getPlatform() == 'linux' and commonEnvironment['useDouble'] != '0':
++if (getPlatform() == 'linux' or getPlatform() == 'netbsd') and commonEnvironment['useDouble'] != '0':
+ csoundLibraryName += '64'
+ # flags for linking with the Csound library
+ libCsoundLinkFlags = []
+@@ -526,6 +537,12 @@ if commonEnvironment['buildRelease'] !=
+ tmp += '64'
+ s = '-DCS_DEFAULT_PLUGINDIR=\\"%s\\"' % tmp
+ csoundLibraryEnvironment.Append(CPPFLAGS = [s])
++ if getPlatform() == 'netbsd':
++ tmp = '%s/lib/csound5/plugins' % commonEnvironment['prefix']
++ if commonEnvironment['useDouble'] != '0':
++ tmp += '64'
++ s = '-DCS_DEFAULT_PLUGINDIR=\\"%s\\"' % tmp
++ csoundLibraryEnvironment.Append(CPPFLAGS = [s])
+ csoundDynamicLibraryEnvironment = csoundLibraryEnvironment.Copy()
+ csoundDynamicLibraryEnvironment.Append(LIBS = ['sndfile'])
+ if getPlatform() == 'mingw':
+@@ -550,6 +567,8 @@ if getPlatform() == 'mingw':
+ csoundDynamicLibraryEnvironment['ENV']['PATH'] = os.environ['PATH']
+ elif getPlatform() == 'linux':
+ csoundDynamicLibraryEnvironment.Append(LIBS = ['dl', 'm', 'pthread'])
++elif getPlatform() == 'netbsd':
++ csoundDynamicLibraryEnvironment.Append(LIBS = ['m', 'pthread'])
+ csoundInterfacesEnvironment = csoundDynamicLibraryEnvironment.Copy()
+
+ if buildOSXFramework:
+@@ -989,7 +1008,7 @@ makePlugin(pluginEnvironment, 'stdopcod'
+ pluginLibraries.append('opcodes.dir')
+ MacOSX_InstallPlugin('opcodes.dir')
+
+-if getPlatform() == 'linux' or getPlatform() == 'darwin':
++if getPlatform() == 'linux' or getPlatform() == 'darwin' or getPlatform == 'netbsd':
+ makePlugin(pluginEnvironment, 'control', ['Opcodes/control.c'])
+ makePlugin(pluginEnvironment, 'ftest', ['Opcodes/ftest.c'])
+ makePlugin(pluginEnvironment, 'mixer', ['Opcodes/mixer.cpp'])
+@@ -1042,6 +1061,9 @@ else:
+ -framework Carbon -framework CoreAudio -framework CoreMidi
+ -framework ApplicationServices
+ '''))
++ elif getPlatform() == 'netbsd':
++ widgetsEnvironment.ParseConfig('fltk-config --use-images --cflags --cxxflags --ldflags')
++ widgetsEnvironment.Append(LIBS = ['stdc++', 'pthread', 'm'])
+ makePlugin(widgetsEnvironment, 'widgets',
+ ['InOut/FL_graph.cpp', 'InOut/winFLTK.c', 'InOut/widgets.cpp'])
+
+@@ -1082,6 +1104,8 @@ else:
+ elif getPlatform() == 'mingw':
+ portaudioEnvironment.Append(LIBS = ['winmm', 'dsound'])
+ portaudioEnvironment.Append(LIBS = csoundWindowsLibraries)
++ elif getPlatform() == 'netbsd':
++ portaudioEnvironment.ParseConfig('pkg-config --cflags --libs portaudio-2.0')
+ makePlugin(portaudioEnvironment, 'rtpa', ['InOut/rtpa.c'])
+
+ if not (commonEnvironment['useJack'] == '1' and jackFound):
+@@ -1118,7 +1142,7 @@ else:
+ fluidEnvironment.Append(CPPFLAGS = ['-DFLUIDSYNTH_NOT_A_DLL'])
+ fluidEnvironment.Append(LIBS = ['winmm', 'dsound'])
+ fluidEnvironment.Append(LIBS = csoundWindowsLibraries)
+- elif getPlatform() == 'linux' or getPlatform() == 'darwin':
++ elif getPlatform() == 'linux' or getPlatform() == 'darwin' or getPlatform() == 'netbsd':
+ fluidEnvironment.Append(LIBS = ['pthread'])
+ makePlugin(fluidEnvironment, 'fluidOpcodes',
+ ['Opcodes/fluidOpcodes/fluidOpcodes.c'])
+@@ -1237,6 +1261,13 @@ else:
+ guiProgramEnvironment.Prepend(LINKFLAGS = ['-mwindows'])
+ vstEnvironment.Append(LIBS = ['fltk_images', 'fltk'])
+ guiProgramEnvironment.Append(LINKFLAGS = '-mwindows')
++ elif getPlatform() == 'netbsd':
++ vstEnvironment.Append(LIBS = ['m'])
++ vstEnvironment.Append(SHLINKFLAGS = '--no-export-all-symbols')
++ vstEnvironment.Append(LINKFLAGS = ['-Wl,-rpath-link,.'])
++ guiProgramEnvironment.Prepend(LINKFLAGS = ['-Wl,-rpath-link,.'])
++ os.spawnvp(os.P_WAIT, 'rm', ['rm', '-f', '_CsoundVST.so'])
++ os.symlink('lib_CsoundVST.so', '_CsoundVST.so')
+ guiProgramEnvironment.Prepend(LIBS = ['_CsoundVST'])
+ for option in vstEnvironment['CCFLAGS']:
+ if string.find(option, '-D') == 0:
+@@ -1420,7 +1451,7 @@ else:
+ stkEnvironment.Append(LIBS = ['stdc++'])
+ if getPlatform() == 'mingw':
+ stkEnvironment.Append(LIBS = csoundWindowsLibraries)
+- elif getPlatform() == 'linux' or getPlatform() == 'darwin':
++ elif getPlatform() == 'linux' or getPlatform() == 'darwin' or getPlatform() == 'netbsd':
+ stkEnvironment.Append(LIBS = ['pthread'])
+ # This is the one that actually defines the opcodes.
+ # They are straight wrappers, as simple as possible.
+@@ -1443,6 +1474,8 @@ else:
+ elif getPlatform() == 'mingw':
+ pyEnvironment['ENV']['PATH'] = os.environ['PATH']
+ pyEnvironment.Append(SHLINKFLAGS = '--no-export-all-symbols')
++ elif getPlatform() == 'netbsd':
++ pyEnvironment.Append(LIBS = ['m'])
+ pythonOpcodes = makePlugin(pyEnvironment, 'py',
+ ['Opcodes/py/pythonopcodes.c'])
+ if getPlatform() == 'mingw' and pythonLibs[0] < 'python24':
+@@ -1461,7 +1494,7 @@ if commonEnvironment['buildPDClass']=='1
+ pdClass = pdClassEnvironment.Program(
+ 'csoundapi~.pd_darwin',
+ 'frontends/csoundapi_tilde/csoundapi_tilde.c')
+- elif getPlatform() == 'linux':
++ elif getPlatform() == 'linux' or getPlatform() == 'netbsd':
+ pdClass = pdClassEnvironment.SharedLibrary(
+ 'csoundapi~.pd_linux',
+ 'frontends/csoundapi_tilde/csoundapi_tilde.c',
+@@ -1493,6 +1526,8 @@ if commonEnvironment['buildTclcsound'] =
+ '''))
+ elif getPlatform() == 'linux':
+ csTclEnvironment.Append(LIBS = ['tcl8.4', 'tk8.4', 'dl', 'pthread'])
++ elif getPlatform() == 'netbsd':
++ csTclEnvironment.Append(LIBS = ['tcl8.4', 'tk8.4', 'pthread'])
+ elif getPlatform() == 'mingw':
+ csTclEnvironment.Append(LIBS = ['tcl84', 'tk84'])
+ csTclEnvironment.Append(LIBS = csoundWindowsLibraries)
+@@ -1591,18 +1626,18 @@ else:
+
+ PREFIX = commonEnvironment['prefix']
+
+-BIN_DIR = PREFIX + "/bin"
+-INCLUDE_DIR = PREFIX + "/include/csound"
++BIN_DIR = PREFIX + "/lib/csound5"
++INCLUDE_DIR = PREFIX + "/include/csound5"
+
+ if (commonEnvironment['Word64'] == '1'):
+- LIB_DIR = PREFIX + "/lib64"
++ LIB_DIR = PREFIX + "/lib64/csound5"
+ else:
+- LIB_DIR = PREFIX + "/lib"
++ LIB_DIR = PREFIX + "/lib/csound5"
+
+ if commonEnvironment['useDouble'] == '0':
+- PLUGIN_DIR = LIB_DIR + "/csound/plugins"
++ PLUGIN_DIR = LIB_DIR + "/plugins"
+ else:
+- PLUGIN_DIR = LIB_DIR + "/csound/plugins64"
++ PLUGIN_DIR = LIB_DIR + "/plugins"
+
+ if commonEnvironment['install'] == '1':
+ installExecutables = Alias('install-executables',
diff --git a/audio/csound5/patches/patch-ad b/audio/csound5/patches/patch-ad
new file mode 100644
index 00000000000..0999916fc77
--- /dev/null
+++ b/audio/csound5/patches/patch-ad
@@ -0,0 +1,13 @@
+$NetBSD: patch-ad,v 1.1.1.1 2006/05/21 22:46:22 ben Exp $
+
+--- Top/csound.c.orig 2006-03-10 08:37:48.000000000 -0800
++++ Top/csound.c
+@@ -613,7 +613,7 @@ static const CSOUND cenviron_ = {
+ csound_free_string_database();
+ }
+
+-#if !defined(LINUX) && !defined(SGI) && !defined(__BEOS__) && !defined(__MACH__)
++#if !defined(__NetBSD__) && !defined(LINUX) && !defined(SGI) && !defined(__BEOS__) && !defined(__MACH__)
+ static char *signal_to_string(int sig)
+ {
+ switch(sig) {
diff --git a/audio/csound5/patches/patch-ae b/audio/csound5/patches/patch-ae
new file mode 100644
index 00000000000..c03db006e2f
--- /dev/null
+++ b/audio/csound5/patches/patch-ae
@@ -0,0 +1,13 @@
+$NetBSD: patch-ae,v 1.1.1.1 2006/05/21 22:46:22 ben Exp $
+
+--- Engine/linevent.c.orig 2005-12-06 14:58:54.000000000 -0800
++++ Engine/linevent.c
+@@ -30,7 +30,7 @@
+ #include "linevent.h"
+
+ #ifdef PIPES
+-# if defined(SGI) || defined(LINUX) || defined(NeXT) || defined(__MACH__)
++# if defined(SGI) || defined(LINUX) || defined(NeXT) || defined(__MACH__) || defined(__NetBSD__)
+ # define _popen popen
+ # define _pclose pclose
+ # elif defined(__BEOS__) || defined(__MACH__)
diff --git a/audio/csound5/patches/patch-af b/audio/csound5/patches/patch-af
new file mode 100644
index 00000000000..ece8db801a7
--- /dev/null
+++ b/audio/csound5/patches/patch-af
@@ -0,0 +1,31 @@
+$NetBSD: patch-af,v 1.1.1.1 2006/05/21 22:46:22 ben Exp $
+
+--- Engine/namedins.c.orig 2006-03-11 08:30:35.000000000 -0800
++++ Engine/namedins.c
+@@ -1342,7 +1342,7 @@ PUBLIC int csoundGetControlChannelParams
+
+ int csoundCheckOpcodePluginFile(CSOUND *csound, const char *fname)
+ {
+-#if !(defined(LINUX) || defined(__unix__) || defined(__MACH__))
++#if !(defined(LINUX) || defined(__unix__) || defined(__MACH__) || defined(__NetBSD__))
+ char buf[512];
+ size_t i;
+ #endif
+@@ -1352,7 +1352,7 @@ int csoundCheckOpcodePluginFile(CSOUND *
+
+ if (fname == NULL || fname[0] == (char) 0)
+ return 0;
+-#if !(defined(LINUX) || defined(__unix__) || defined(__MACH__))
++#if !(defined(LINUX) || defined(__unix__) || defined(__MACH__) || defined(__NetBSD__))
+ /* on some platforms, file names are case insensitive */
+ i = (size_t) 0;
+ do {
+@@ -1502,7 +1502,7 @@ int csoundLoadOpcodeDB(CSOUND *csound, c
+ }
+ opcodeCnt++;
+ }
+-#if !(defined(LINUX) || defined(__unix__) || defined(__MACH__))
++#if !(defined(LINUX) || defined(__unix__) || defined(__MACH__) || defined(__NetBSD__))
+ else {
+ size_t j;
+ /* on some platforms, file names are case insensitive */
diff --git a/audio/csound5/patches/patch-ag b/audio/csound5/patches/patch-ag
new file mode 100644
index 00000000000..a16a5436d2a
--- /dev/null
+++ b/audio/csound5/patches/patch-ag
@@ -0,0 +1,13 @@
+$NetBSD: patch-ag,v 1.1.1.1 2006/05/21 22:46:22 ben Exp $
+
+--- frontends/CsoundVST/System.cpp.orig 2005-12-22 09:06:21.000000000 -0800
++++ frontends/CsoundVST/System.cpp
+@@ -468,7 +468,7 @@ namespace csound
+ Beep(880, 1000);
+ }
+
+-#elif defined(LINUX) || defined(MACOSX)
++#elif defined(LINUX) || defined(MACOSX) || defined(__NetBSD__)
+
+ #include <dlfcn.h>
+ #include <dirent.h>
diff --git a/audio/csound5/patches/patch-ah b/audio/csound5/patches/patch-ah
new file mode 100644
index 00000000000..b6685d3eee1
--- /dev/null
+++ b/audio/csound5/patches/patch-ah
@@ -0,0 +1,13 @@
+$NetBSD: patch-ah,v 1.1.1.1 2006/05/21 22:46:22 ben Exp $
+
+--- frontends/CsoundVST/CsoundVSTMain.cpp.orig 2005-09-02 07:30:33.000000000 -0700
++++ frontends/CsoundVST/CsoundVSTMain.cpp
+@@ -36,7 +36,7 @@ bool oome = false;
+ #if defined(__GNUC__) && defined(WIN32)
+ #define main main_plugin
+ extern "C" __declspec(dllexport) AEffect *main_plugin (audioMasterCallback audioMaster)
+-#elif defined(LINUX) || defined(MACOSX)
++#elif defined(LINUX) || defined(MACOSX) || defined(__NetBSD__)
+ AEffect *main_plugin (audioMasterCallback audioMaster)
+ #else
+ AEffect *main(audioMasterCallback audioMaster)
diff --git a/audio/csound5/patches/patch-ai b/audio/csound5/patches/patch-ai
new file mode 100644
index 00000000000..637fd652abe
--- /dev/null
+++ b/audio/csound5/patches/patch-ai
@@ -0,0 +1,22 @@
+$NetBSD: patch-ai,v 1.1.1.1 2006/05/21 22:46:22 ben Exp $
+
+--- InOut/widgets.cpp.orig 2006-02-15 10:25:55.000000000 -0800
++++ InOut/widgets.cpp
+@@ -29,7 +29,7 @@
+ # include <windows.h>
+ #endif /* defined(WIN32) */
+
+-#if defined(LINUX)
++#if defined(LINUX) || defined(__NetBSD__)
+ # include <pthread.h>
+ # include <sched.h>
+ # include <sys/time.h>
+@@ -1722,7 +1722,7 @@ static uintptr_t fltkRun(void *userdata)
+
+ p = (widgetsGlobals_t*) csound->QueryGlobalVariable(csound,
+ "_widgets_globals");
+-#ifdef LINUX
++#if defined(LINUX) || defined(__NetBSD__)
+ {
+ struct sched_param sp;
+ // IV - Aug 27 2002: widget thread is always run with normal priority
diff --git a/audio/csound5/patches/patch-aj b/audio/csound5/patches/patch-aj
new file mode 100644
index 00000000000..018f965753b
--- /dev/null
+++ b/audio/csound5/patches/patch-aj
@@ -0,0 +1,13 @@
+$NetBSD: patch-aj,v 1.1.1.1 2006/05/21 22:46:22 ben Exp $
+
+--- InOut/libsnd.c.orig 2006-02-13 09:05:46.000000000 -0800
++++ InOut/libsnd.c
+@@ -47,7 +47,7 @@ typedef struct {
+
+ #ifdef PIPES
+ # if defined(SGI) || defined(LINUX) || defined(__BEOS__) || defined(NeXT) || \
+- defined(__MACH__)
++ defined(__MACH__) || defined(__NetBSD__)
+ # define _popen popen
+ # define _pclose pclose
+ # endif
diff --git a/audio/csound5/patches/patch-ak b/audio/csound5/patches/patch-ak
new file mode 100644
index 00000000000..1558bbcd64a
--- /dev/null
+++ b/audio/csound5/patches/patch-ak
@@ -0,0 +1,13 @@
+$NetBSD: patch-ak,v 1.1.1.1 2006/05/21 22:46:22 ben Exp $
+
+--- InOut/winEPS.c.orig 2005-12-29 05:49:04.000000000 -0800
++++ InOut/winEPS.c
+@@ -146,7 +146,7 @@ void PS_MakeGraph(CSOUND *csound, WINDAT
+ * Get the current time and date
+ */
+ lt = time(NULL);
+-#ifndef LINUX
++#if !defined(LINUX) && !defined(__NetBSD__)
+ {
+ struct tm *date_ptr;
+ char *date;
diff --git a/audio/csound5/patches/patch-al b/audio/csound5/patches/patch-al
new file mode 100644
index 00000000000..720d1c646d6
--- /dev/null
+++ b/audio/csound5/patches/patch-al
@@ -0,0 +1,22 @@
+$NetBSD: patch-al,v 1.1.1.1 2006/05/21 22:46:22 ben Exp $
+
+--- InOut/winFLTK.c.orig 2005-12-30 07:21:18.000000000 -0800
++++ InOut/winFLTK.c
+@@ -29,7 +29,7 @@
+ #include <stdio.h>
+ #include "cwindow.h"
+
+-#ifdef LINUX
++#if defined(LINUX) || defined(__NetBSD__)
+ #include <X11/Xlib.h>
+ #endif
+
+@@ -54,7 +54,7 @@ static void KillGraph_FLTK(CSOUND *csoun
+
+ void set_display_callbacks(CSOUND *csound)
+ {
+-#ifdef LINUX
++#if defined(LINUX) || defined(__NetBSD__)
+ Display *dpy = XOpenDisplay(NULL);
+ if (dpy == NULL)
+ return;
diff --git a/audio/csound5/patches/patch-am b/audio/csound5/patches/patch-am
new file mode 100644
index 00000000000..6559f7a484e
--- /dev/null
+++ b/audio/csound5/patches/patch-am
@@ -0,0 +1,52 @@
+$NetBSD: patch-am,v 1.1.1.1 2006/05/21 22:46:22 ben Exp $
+
+--- Top/csmodule.c.orig 2006-03-08 15:13:15.000000000 -0800
++++ Top/csmodule.c
+@@ -78,7 +78,7 @@
+ #include "csoundCore.h"
+ #include "csmodule.h"
+
+-#if defined(LINUX)
++#if defined(LINUX) || defined(__NetBSD__)
+ #include <dlfcn.h>
+ #elif defined(WIN32)
+ #include <windows.h>
+@@ -121,7 +121,7 @@ static const char *plugindir_envva
+ static const char *plugindir64_envvar = "OPCODEDIR64";
+
+ /* default directory to load plugins from if environment variable is not set */
+-#if !(defined(_CSOUND_RELEASE_) && (defined(LINUX) || defined(__MACH__)))
++#if !(defined(_CSOUND_RELEASE_) && (defined(LINUX) || defined(__MACH__) || defined(__NetBSD__)))
+ # define ENABLE_OPCODEDIR_WARNINGS 1
+ # ifdef CS_DEFAULT_PLUGINDIR
+ # undef CS_DEFAULT_PLUGINDIR
+@@ -131,9 +131,9 @@ static const char *plugindir64_env
+ # define ENABLE_OPCODEDIR_WARNINGS 0
+ # ifndef CS_DEFAULT_PLUGINDIR
+ # ifndef USE_DOUBLE
+-# define CS_DEFAULT_PLUGINDIR "/usr/local/lib/csound/plugins"
++# define CS_DEFAULT_PLUGINDIR __PKGSRC_PREFIX__ "lib/csound5/plugins"
+ # else
+-# define CS_DEFAULT_PLUGINDIR "/usr/local/lib/csound/plugins64"
++# define CS_DEFAULT_PLUGINDIR __PKGSRC_PREFIX__ "lib/csound5/plugins64"
+ # endif
+ # endif
+ #endif
+@@ -225,7 +225,7 @@ static CS_NOINLINE int csoundLoadExterna
+ /* load library */
+ err = csound->OpenLibrary(&h, libraryPath);
+ if (err) {
+-#if defined(BETA) && defined(LINUX)
++#if defined(BETA) && (defined(LINUX) || defined(__NetBSD__))
+ csound->Warning(csound, "%s", dlerror());
+ #endif
+ csound->Warning(csound, Str("could not open library '%s' (%d)"),
+@@ -591,7 +591,7 @@ PUBLIC void *csoundGetLibrarySymbol(void
+ return (void*) GetProcAddress((HMODULE) library, procedureName);
+ }
+
+-#elif defined(LINUX)
++#elif defined(LINUX) || defined(__NetBSD__)
+
+ PUBLIC int csoundOpenLibrary(void **library, const char *libraryPath)
+ {
diff --git a/audio/csound5/patches/patch-an b/audio/csound5/patches/patch-an
new file mode 100644
index 00000000000..a87451362ab
--- /dev/null
+++ b/audio/csound5/patches/patch-an
@@ -0,0 +1,40 @@
+$NetBSD: patch-an,v 1.1.1.1 2006/05/21 22:46:22 ben Exp $
+
+--- Top/one_file.c.orig 2006-01-11 03:47:55.000000000 -0800
++++ Top/one_file.c
+@@ -24,7 +24,7 @@
+ #include "csoundCore.h"
+ #include <ctype.h>
+ #include <errno.h>
+-#if defined(LINUX) || defined(__MACH__) || defined(WIN32)
++#if defined(LINUX) || defined(__MACH__) || defined(WIN32) || defined(__NetBSD__)
+ # include <sys/types.h>
+ # include <sys/stat.h>
+ #endif
+@@ -66,7 +66,7 @@ CS_NOINLINE char *csoundTmpFileName(CSOU
+ buf = csound->Malloc(csound, nBytes);
+ }
+ {
+-#if defined(LINUX) || defined(__MACH__)
++#if defined(LINUX) || defined(__MACH__) || defined(__NetBSD__)
+ struct stat tmp;
+ do {
+ #elif defined(WIN32)
+@@ -89,7 +89,7 @@ CS_NOINLINE char *csoundTmpFileName(CSOU
+ }
+ #endif
+ if (ext != NULL && ext[0] != (char) 0) {
+-#if !defined(LINUX) && !defined(__MACH__) && !defined(WIN32)
++#if !defined(LINUX) && !defined(__MACH__) && !defined(WIN32) && !defined(__NetBSD__)
+ char *p;
+ /* remove original extension (does not work on OS X */
+ /* and may be a bad idea) */
+@@ -109,7 +109,7 @@ CS_NOINLINE char *csoundTmpFileName(CSOU
+ } while (buf[i] != (char) 0);
+ }
+ #endif
+-#if defined(LINUX) || defined(__MACH__)
++#if defined(LINUX) || defined(__MACH__) || defined(__NetBSD__)
+ /* if the file already exists, try again */
+ } while (stat(buf, &tmp) == 0);
+ #elif defined(WIN32)
diff --git a/audio/csound5/patches/patch-ao b/audio/csound5/patches/patch-ao
new file mode 100644
index 00000000000..8cc3f76a0ba
--- /dev/null
+++ b/audio/csound5/patches/patch-ao
@@ -0,0 +1,13 @@
+$NetBSD: patch-ao,v 1.1.1.1 2006/05/21 22:46:22 ben Exp $
+
+--- Top/threads.c.orig 2005-12-26 09:27:07.000000000 -0800
++++ Top/threads.c
+@@ -109,7 +109,7 @@ PUBLIC void csoundSleep(size_t milliseco
+ Sleep((DWORD) milliseconds);
+ }
+
+-#elif defined(LINUX) || defined(__MACH__)
++#elif defined(LINUX) || defined(__MACH__) || defined(__NetBSD__)
+
+ #include <pthread.h>
+ #include <time.h>