summaryrefslogtreecommitdiff
path: root/audio/csound6
diff options
context:
space:
mode:
authormrg <mrg@pkgsrc.org>2014-03-06 10:16:53 +0000
committermrg <mrg@pkgsrc.org>2014-03-06 10:16:53 +0000
commit9dd2957c3786854fb1800a4fb7e24d12568abf2d (patch)
tree42b5501b27f71c8c98e482d3df504a22ad3f991d /audio/csound6
parentd28f5a7a90ecd950fe07d5ec165658d421556b33 (diff)
downloadpkgsrc-9dd2957c3786854fb1800a4fb7e24d12568abf2d.tar.gz
add packages for csound6 and its manual.
Diffstat (limited to 'audio/csound6')
-rw-r--r--audio/csound6/DESCR8
-rw-r--r--audio/csound6/Makefile50
-rw-r--r--audio/csound6/PLIST92
-rw-r--r--audio/csound6/distinfo18
-rw-r--r--audio/csound6/patches/patch-CMakeLists.txt61
-rw-r--r--audio/csound6/patches/patch-Engine_linevent.c13
-rw-r--r--audio/csound6/patches/patch-InOut_libsnd.c12
-rw-r--r--audio/csound6/patches/patch-InOut_widgets.cpp32
-rw-r--r--audio/csound6/patches/patch-InOut_winEPS.c13
-rw-r--r--audio/csound6/patches/patch-InOut_winFLTK.c31
-rw-r--r--audio/csound6/patches/patch-Opcodes_cpumeter.c15
-rw-r--r--audio/csound6/patches/patch-Opcodes_wavegde.h16
-rw-r--r--audio/csound6/patches/patch-Top_csmodule.c52
-rw-r--r--audio/csound6/patches/patch-Top_csound.c23
-rw-r--r--audio/csound6/patches/patch-Top_one_file.c40
-rw-r--r--audio/csound6/patches/patch-Top_threads.c22
-rw-r--r--audio/csound6/patches/patch-frontends_CsoundVST_ScoreGeneratorVstMain.cpp13
17 files changed, 511 insertions, 0 deletions
diff --git a/audio/csound6/DESCR b/audio/csound6/DESCR
new file mode 100644
index 00000000000..909beaee389
--- /dev/null
+++ b/audio/csound6/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/csound6/Makefile b/audio/csound6/Makefile
new file mode 100644
index 00000000000..0b942537b4b
--- /dev/null
+++ b/audio/csound6/Makefile
@@ -0,0 +1,50 @@
+# $NetBSD: Makefile,v 1.1 2014/03/06 10:16:53 mrg Exp $
+
+DISTNAME= Csound${CSOUND_VERSION}
+PKGNAME= csound6-${CSOUND_VERSION}
+CATEGORIES= audio
+MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=csound/csound6/Csound6.02/}
+WRKSRC= ${WRKDIR}/Csound${CSOUND_VERSION}
+
+MAINTAINER= mrg@eterna.com.au
+HOMEPAGE= http://sourceforge.net/projects/csound/
+COMMENT= Software synthesizer and sequencer
+LICENSE= gnu-lgpl-v2.1 # or later
+
+CSOUND_VERSION= 6.02
+USE_LANGUAGES= c c++
+CFLAGS+= -g -D__PKGSRC_PREFIX__=\"${PREFIX}/\" -DBETA
+USE_CMAKE= yes
+CMAKE_ARGS+= -DUSE_PORTAUDIO:BOOL=OFF
+CMAKE_ARGS+= -DBUILD_RELEASE=1 -DCMAKE_BUILD_TYPE=Release
+# CMAKE_INSTALL_RPATH doesn't work for some reason, so do it here.
+LDFLAGS+= ${COMPILER_RPATH_FLAG}${PREFIX}/lib/csound6
+
+# Has long files our tar doesn't understand.
+EXTRACT_USING= gtar
+
+PYTHON_VERSIONS_INCOMPATIBLE= 33 # not yet ported as of 5.01
+
+INSTALLATION_DIRS= bin
+
+CHECK_PORTABILITY_SKIP+= installer/misc/makedeb.sh \
+ installer/macosx/release-build-10.8.sh \
+ frontends/max_csound_tilde/installer/build-installer.sh
+
+.include "../../mk/bsd.prefs.mk"
+
+post-install:
+ cd ${DESTDIR}${PREFIX} && ${LN} -s ../lib/csound6/csound bin/csound6
+
+.include "../../audio/fluidsynth/buildlink3.mk"
+.include "../../audio/libsndfile/buildlink3.mk"
+.include "../../audio/portaudio/buildlink3.mk"
+.include "../../mk/jpeg.buildlink3.mk"
+.include "../../devel/boost-libs/buildlink3.mk"
+.include "../../graphics/png/buildlink3.mk"
+PYTHON_FOR_BUILD_ONLY= yes
+.include "../../lang/python/application.mk"
+.include "../../x11/fltk/buildlink3.mk"
+.include "../../www/curl/buildlink3.mk"
+.include "../../mk/pthread.buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/audio/csound6/PLIST b/audio/csound6/PLIST
new file mode 100644
index 00000000000..8c2b736e6ec
--- /dev/null
+++ b/audio/csound6/PLIST
@@ -0,0 +1,92 @@
+@comment $NetBSD: PLIST,v 1.1 2014/03/06 10:16:53 mrg Exp $
+bin/csound6
+include/csound6/CppSound.hpp
+include/csound6/CsoundFile.hpp
+include/csound6/OpcodeBase.hpp
+include/csound6/cfgvar.h
+include/csound6/csPerfThread.hpp
+include/csound6/cs_par_structs.h
+include/csound6/cscore.h
+include/csound6/csdl.h
+include/csound6/csound.h
+include/csound6/csound.hpp
+include/csound6/csoundCore.h
+include/csound6/csound_data_structures.h
+include/csound6/csound_standard_types.h
+include/csound6/csound_type_system.h
+include/csound6/cwindow.h
+include/csound6/filebuilding.h
+include/csound6/float-version-double.h
+include/csound6/float-version.h
+include/csound6/interlocks.h
+include/csound6/msg_attr.h
+include/csound6/pools.h
+include/csound6/pstream.h
+include/csound6/pvfileio.h
+include/csound6/soundio.h
+include/csound6/sysdep.h
+include/csound6/text.h
+include/csound6/version.h
+lib/csound6/atsa
+lib/csound6/cs
+lib/csound6/csanalyze
+lib/csound6/csb64enc
+lib/csound6/csbeats
+lib/csound6/csound
+lib/csound6/cvanal
+lib/csound6/dnoise
+lib/csound6/envext
+lib/csound6/extract
+lib/csound6/extractor
+lib/csound6/het_export
+lib/csound6/het_import
+lib/csound6/hetro
+lib/csound6/libcsnd6.so
+lib/csound6/libcsnd6.so.6.0
+lib/csound6/libcsound64.so
+lib/csound6/libcsound64.so.6.0
+lib/csound6/lpanal
+lib/csound6/lpc_export
+lib/csound6/lpc_import
+lib/csound6/makecsd
+lib/csound6/mixer
+lib/csound6/plugins-6.0/csladspa.so
+lib/csound6/plugins-6.0/libampmidid.so
+lib/csound6/plugins-6.0/libcellular.so
+lib/csound6/plugins-6.0/libchua.so
+lib/csound6/plugins-6.0/libcontrol.so
+lib/csound6/plugins-6.0/libcs_date.so
+lib/csound6/plugins-6.0/libdoppler.so
+lib/csound6/plugins-6.0/libfareygen.so
+lib/csound6/plugins-6.0/libfluidOpcodes.so
+lib/csound6/plugins-6.0/libfractalnoise.so
+lib/csound6/plugins-6.0/libimage.so
+lib/csound6/plugins-6.0/libipmidi.so
+lib/csound6/plugins-6.0/libmixer.so
+lib/csound6/plugins-6.0/libplaterev.so
+lib/csound6/plugins-6.0/libpy.so
+lib/csound6/plugins-6.0/libscansyn.so
+lib/csound6/plugins-6.0/libserial.so
+lib/csound6/plugins-6.0/libsignalflowgraph.so
+lib/csound6/plugins-6.0/libstdutil.so
+lib/csound6/plugins-6.0/libsystem_call.so
+lib/csound6/plugins-6.0/libvirtual.so
+lib/csound6/plugins-6.0/libwidgets.so
+lib/csound6/pv_export
+lib/csound6/pv_import
+lib/csound6/pvanal
+lib/csound6/pvlook
+lib/csound6/scale
+lib/csound6/scope
+lib/csound6/scot
+lib/csound6/scsort
+lib/csound6/sdif2ad
+lib/csound6/sndinfo
+lib/csound6/srconv
+share/locale/de/LC_MESSAGES/csound6.mo
+share/locale/en_US/LC_MESSAGES/csound6.mo
+share/locale/es_CO/LC_MESSAGES/csound6.mo
+share/locale/fr/LC_MESSAGES/csound6.mo
+share/locale/it/LC_MESSAGES/csound6.mo
+share/locale/ro/LC_MESSAGES/csound6.mo
+share/locale/ru/LC_MESSAGES/csound6.mo
diff --git a/audio/csound6/distinfo b/audio/csound6/distinfo
new file mode 100644
index 00000000000..ac3a24a27dd
--- /dev/null
+++ b/audio/csound6/distinfo
@@ -0,0 +1,18 @@
+$NetBSD: distinfo,v 1.1 2014/03/06 10:16:53 mrg Exp $
+
+SHA1 (Csound6.02.tar.gz) = 9903dd2825d533d08fa333adb85bb39a2ef3da77
+RMD160 (Csound6.02.tar.gz) = a2a6b0436a1988bcfd4b24b4dc2e0e78f56cb7c1
+Size (Csound6.02.tar.gz) = 23459796 bytes
+SHA1 (patch-CMakeLists.txt) = dab8132921ea5d0eecea0950d465772e65c04a48
+SHA1 (patch-Engine_linevent.c) = e77671774437438f80a38e3bfe4fa3cb847cbd20
+SHA1 (patch-InOut_libsnd.c) = a944d30531fe85c98368dfdc1c5bf7cab7c8af8c
+SHA1 (patch-InOut_widgets.cpp) = c34237c579f90b093a39d79e11a40cd4edafa81c
+SHA1 (patch-InOut_winEPS.c) = 1f3a7ec113a5185a81fe219d99061afb025bc13b
+SHA1 (patch-InOut_winFLTK.c) = 77e82625a8db39814d5f7e2c36ad16b122eb2754
+SHA1 (patch-Opcodes_cpumeter.c) = d6eca4f22dd6d6d51ae3bb1e65f0a6c5b6faa039
+SHA1 (patch-Opcodes_wavegde.h) = e1a6d742b28dd9b6b129a993102baf7218efa57c
+SHA1 (patch-Top_csmodule.c) = dae30ae850925a05df0f9e383425ab1e1c42dec1
+SHA1 (patch-Top_csound.c) = b1477eac05aefe6ddd5b94b52246f18ce6148914
+SHA1 (patch-Top_one_file.c) = 24b9b9d51843f2f79336e95e65a2c6011f31b754
+SHA1 (patch-Top_threads.c) = 9ea7a8f1923f25cc7b2192582711cff143386bda
+SHA1 (patch-frontends_CsoundVST_ScoreGeneratorVstMain.cpp) = 229fc00e122288ea16ebf07f081869965cab9365
diff --git a/audio/csound6/patches/patch-CMakeLists.txt b/audio/csound6/patches/patch-CMakeLists.txt
new file mode 100644
index 00000000000..d92a3b2157e
--- /dev/null
+++ b/audio/csound6/patches/patch-CMakeLists.txt
@@ -0,0 +1,61 @@
+$NetBSD: patch-CMakeLists.txt,v 1.1 2014/03/06 10:16:53 mrg Exp $
+
+--- CMakeLists.txt.orig 2014-01-07 08:54:20.000000000 -0800
++++ CMakeLists.txt 2014-02-14 16:31:43.000000000 -0800
+@@ -13,26 +13,26 @@
+ set(APIVERSION "6.0")
+
+ # Relative install paths
+-set(EXECUTABLE_INSTALL_DIR "bin")
++set(EXECUTABLE_INSTALL_DIR "lib/csound6")
+
+ option(USE_LIB64 "Set to on to set installation directory for libraries to lib64" OFF)
+ if(USE_LIB64)
+- set(LIBRARY_INSTALL_DIR "lib64")
++ set(LIBRARY_INSTALL_DIR "lib64/csound6")
+ else()
+- set(LIBRARY_INSTALL_DIR "lib")
++ set(LIBRARY_INSTALL_DIR "lib/csound6")
+ endif()
+ message(STATUS "LIBRARY INSTALL DIR: ${LIBRARY_INSTALL_DIR}")
+
+ if(USE_DOUBLE)
+- set(PLUGIN_INSTALL_DIR "${LIBRARY_INSTALL_DIR}/csound/plugins64-${APIVERSION}")
++ set(PLUGIN_INSTALL_DIR "${LIBRARY_INSTALL_DIR}/plugins-${APIVERSION}")
+ else()
+- set(PLUGIN_INSTALL_DIR "${LIBRARY_INSTALL_DIR}/csound/plugins-${APIVERSION}")
++ set(PLUGIN_INSTALL_DIR "${LIBRARY_INSTALL_DIR}/plugins-${APIVERSION}")
+ endif()
+ set(PYTHON_MODULE_INSTALL_DIR ${LIBRARY_INSTALL_DIR})
+ set(JAVA_MODULE_INSTALL_DIR ${LIBRARY_INSTALL_DIR})
+ set(LUA_MODULE_INSTALL_DIR ${LIBRARY_INSTALL_DIR})
+ set(LOCALE_INSTALL_DIR "share/locale")
+-set(HEADER_INSTALL_DIR "include/csound")
++set(HEADER_INSTALL_DIR "include/csound6")
+
+ set(CS_FRAMEWORK_DEST "~/Library/Frameworks")
+ include(TestBigEndian)
+@@ -239,6 +239,12 @@
+ set(LINUX NO)
+ endif()
+
++if(CMAKE_SYSTEM_NAME MATCHES "NetBSD")
++ set(NETBSD YES)
++else()
++ set(NETBSD NO)
++endif()
++
+ ## USER OPTIONS ##
+
+ option(USE_DOUBLE "Set to use double-precision floating point for audio samples." ON)
+@@ -326,6 +332,10 @@
+
+ endif()
+
++if(NETBSD)
++ add_definitions("-DCS_DEFAULT_PLUGINDIR=\"${CMAKE_INSTALL_PREFIX}/${PLUGIN_INSTALL_DIR}\"")
++endif()
++
+ if(BUILD_RELEASE)
+ add_definitions("-D_CSOUND_RELEASE_")
+ if(LINUX)
diff --git a/audio/csound6/patches/patch-Engine_linevent.c b/audio/csound6/patches/patch-Engine_linevent.c
new file mode 100644
index 00000000000..825cfbb44ba
--- /dev/null
+++ b/audio/csound6/patches/patch-Engine_linevent.c
@@ -0,0 +1,13 @@
+$NetBSD: patch-Engine_linevent.c,v 1.1 2014/03/06 10:16:53 mrg Exp $
+
+--- Engine/linevent.c.orig 2014-01-07 08:54:20.000000000 -0800
++++ Engine/linevent.c 2014-02-12 23:45:21.000000000 -0800
+@@ -27,7 +27,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__) || defined(__DragonFly__)
+ # define _popen popen
+ # define _pclose pclose
+ # elif defined(__BEOS__) || defined(__MACH__)
diff --git a/audio/csound6/patches/patch-InOut_libsnd.c b/audio/csound6/patches/patch-InOut_libsnd.c
new file mode 100644
index 00000000000..96d33b93c9c
--- /dev/null
+++ b/audio/csound6/patches/patch-InOut_libsnd.c
@@ -0,0 +1,12 @@
+$NetBSD: patch-InOut_libsnd.c,v 1.1 2014/03/06 10:16:53 mrg Exp $
+
+--- InOut/libsnd.c.orig 2014-01-07 08:53:47.000000000 -0800
++++ InOut/libsnd.c 2014-02-12 23:47:56.000000000 -0800
+@@ -31,6 +31,7 @@
+ #ifdef PIPES
+ # if defined(SGI) || defined(LINUX) || defined(__BEOS__) || defined(NeXT) || \
+ defined(__MACH__)
++ defined(__MACH__) || defined(__NetBSD__) || defined(__DragonFly__)
+ # define _popen popen
+ # define _pclose pclose
+ # endif
diff --git a/audio/csound6/patches/patch-InOut_widgets.cpp b/audio/csound6/patches/patch-InOut_widgets.cpp
new file mode 100644
index 00000000000..3b6e4fb442f
--- /dev/null
+++ b/audio/csound6/patches/patch-InOut_widgets.cpp
@@ -0,0 +1,32 @@
+$NetBSD: patch-InOut_widgets.cpp,v 1.1 2014/03/06 10:16:53 mrg Exp $
+
+--- InOut/widgets.cpp.orig 2014-01-07 08:53:47.000000000 -0800
++++ InOut/widgets.cpp 2014-02-12 23:46:20.000000000 -0800
+@@ -2107,7 +2107,7 @@
+ (WIDGET_GLOBALS *)csound->QueryGlobalVariable(csound, "WIDGET_GLOBALS");
+ p = (widgetsGlobals_t*) csound->QueryGlobalVariable(csound,
+ "_widgets_globals");
+-#ifdef LINUX
++#if defined(LINUX) || defined(__NetBSD__) || defined(__DragonFly__)
+ {
+ struct sched_param sp;
+ // IV - Aug 27 2002: widget thread is always run with normal priority
+@@ -2127,7 +2127,7 @@
+ #ifdef WIN32
+ HWND xid = fl_xid(ST(fl_windows)[panelNum].panel);
+ ST(VSTplugEditors)[k]->SetEditWindow(xid);
+-#elif defined (LINUX) || defined(MACOSX)
++#elif defined (LINUX) || defined(MACOSX) || defined(__NetBSD__) || defined(__DragonFly__)
+ // put some appropriate alternative code here
+ Fl_Window * xid = fl_find(fl_xid(ST(fl_windows)[panelNum].panel));
+ ST(VSTplugEditors)[k]->SetEditWindow(xid);
+@@ -2258,8 +2258,7 @@
+ CSOUND *csound = p->csound;
+ char *command = (char *)csound->Malloc(csound, strlen(p->commandString) + 1);
+
+-#if defined(LINUX) || defined (MACOSX)
+-
++#if defined(LINUX) || defined (MACOSX) || defined(__NetBSD__) || defined(__DragonFly__)
+
+ pid_t pId = vfork();
+ if (pId == 0) {
diff --git a/audio/csound6/patches/patch-InOut_winEPS.c b/audio/csound6/patches/patch-InOut_winEPS.c
new file mode 100644
index 00000000000..6f0919adb25
--- /dev/null
+++ b/audio/csound6/patches/patch-InOut_winEPS.c
@@ -0,0 +1,13 @@
+$NetBSD: patch-InOut_winEPS.c,v 1.1 2014/03/06 10:16:53 mrg 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__) && !defined(__DragonFly__)
+ {
+ struct tm *date_ptr;
+ char *date;
diff --git a/audio/csound6/patches/patch-InOut_winFLTK.c b/audio/csound6/patches/patch-InOut_winFLTK.c
new file mode 100644
index 00000000000..0fd6626c7b5
--- /dev/null
+++ b/audio/csound6/patches/patch-InOut_winFLTK.c
@@ -0,0 +1,31 @@
+$NetBSD: patch-InOut_winFLTK.c,v 1.1 2014/03/06 10:16:53 mrg Exp $
+
+--- InOut/winFLTK.c.orig 2014-01-07 08:53:47.000000000 -0800
++++ InOut/winFLTK.c 2014-02-12 23:47:05.000000000 -0800
+@@ -29,7 +29,7 @@
+ #include <stdio.h>
+ #include "cwindow.h"
+
+-#ifdef LINUX
++#if defined(LINUX) || defined(__NetBSD__) || defined(__DragonFly__)
+ #include <X11/Xlib.h>
+ #endif
+
+@@ -83,7 +83,7 @@
+ fltkFlags = getFLTKFlagsPtr(csound);
+ if (((*fltkFlags) & 2) == 0 &&
+ !(oparms.graphsoff || oparms.postscript)) {
+-#ifdef LINUX
++#if defined(LINUX) || defined(__NetBSD__) || defined(__DragonFly__)
+ Display *dpy = XOpenDisplay(NULL);
+ if (dpy != NULL) {
+ XCloseDisplay(dpy);
+@@ -104,7 +104,7 @@
+ csound->Message(csound, "graph init \n");
+
+ }
+-#ifdef LINUX
++#if defined(LINUX) || defined(__NetBSD__) || defined(__DragonFly__)
+ }
+ #endif
+ }
diff --git a/audio/csound6/patches/patch-Opcodes_cpumeter.c b/audio/csound6/patches/patch-Opcodes_cpumeter.c
new file mode 100644
index 00000000000..cd278fba6d8
--- /dev/null
+++ b/audio/csound6/patches/patch-Opcodes_cpumeter.c
@@ -0,0 +1,15 @@
+$NetBSD: patch-Opcodes_cpumeter.c,v 1.1 2014/03/06 10:16:53 mrg Exp $
+
+be best to patch this to use eg, getloadavg() or something not /proc.
+
+--- Opcodes/cpumeter.c.orig 2014-01-07 08:53:48.000000000 -0800
++++ Opcodes/cpumeter.c 2014-02-12 23:36:40.000000000 -0800
+@@ -16,7 +16,7 @@
+ *
+ */
+
+-#if defined(__MACH__) || defined(LINUX)
++#if defined(__MACH__) || defined(LINUX) || defined(__NetBSD__) || defined(__DragonFly__)
+
+ #include "csoundCore.h"
+ #include <sys/resource.h>
diff --git a/audio/csound6/patches/patch-Opcodes_wavegde.h b/audio/csound6/patches/patch-Opcodes_wavegde.h
new file mode 100644
index 00000000000..4bddb789c7e
--- /dev/null
+++ b/audio/csound6/patches/patch-Opcodes_wavegde.h
@@ -0,0 +1,16 @@
+$NetBSD: patch-Opcodes_wavegde.h,v 1.1 2014/03/06 10:16:53 mrg Exp $
+
+Use native len_t on SunOS.
+
+--- Opcodes/wavegde.h.orig 2005-09-05 17:27:44.000000000 +0000
++++ Opcodes/wavegde.h
+@@ -43,7 +43,9 @@
+ #endif
+
+ /* TYPEDEFS */
++#ifndef __sun
+ typedef long len_t; /* length type */
++#endif
+
+ /* CLASS DEFINITIONS */
+
diff --git a/audio/csound6/patches/patch-Top_csmodule.c b/audio/csound6/patches/patch-Top_csmodule.c
new file mode 100644
index 00000000000..646365609e5
--- /dev/null
+++ b/audio/csound6/patches/patch-Top_csmodule.c
@@ -0,0 +1,52 @@
+$NetBSD: patch-Top_csmodule.c,v 1.1 2014/03/06 10:16:53 mrg Exp $
+
+--- Top/csmodule.c.orig 2014-01-07 08:54:20.000000000 -0800
++++ Top/csmodule.c 2014-02-13 02:01:01.000000000 -0800
+@@ -89,7 +89,7 @@
+ #endif
+
+ #if !(defined (NACL))
+-#if defined(LINUX) || defined(NEW_MACH_CODE)
++#if defined(LINUX) || defined(NEW_MACH_CODE) || defined(__NetBSD__) || defined(__DragonFly__)
+ #include <dlfcn.h>
+ #elif defined(WIN32)
+ #include <windows.h>
+@@ -132,7 +132,7 @@
+
+ /* default directory to load plugins from if environment variable is not set */
+ #if !(defined (NACL))
+-#if !(defined(_CSOUND_RELEASE_) && (defined(LINUX) || defined(__MACH__)))
++#if !(defined(_CSOUND_RELEASE_) && (defined(LINUX) || defined(__MACH__) || defined(__NetBSD__) || defined(__DragonFly__)))
+ # define ENABLE_OPCODEDIR_WARNINGS 1
+ # ifdef CS_DEFAULT_PLUGINDIR
+ # undef CS_DEFAULT_PLUGINDIR
+@@ -142,9 +142,9 @@
+ # 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/csound6/plugins-6.0"
+ # else
+-# define CS_DEFAULT_PLUGINDIR "/usr/local/lib/csound/plugins64"
++# define CS_DEFAULT_PLUGINDIR __PKGSRC_PREFIX__ "lib/csound6/plugins-6.0"
+ # endif
+ # endif
+ #endif
+@@ -247,7 +247,7 @@
+ err = csoundOpenLibrary(&h, libraryPath);
+ if (UNLIKELY(err)) {
+ char ERRSTR[256];
+-#if !(defined(NACL)) && defined(LINUX)
++#if !(defined(NACL)) && (defined(LINUX) || defined(__NetBSD__) || defined(__DragonFly__))
+ sprintf(ERRSTR, Str("could not open library '%s' (%s)"),
+ libraryPath, dlerror());
+ #else
+@@ -684,7 +684,7 @@
+ return (void*) GetProcAddress((HMODULE) library, procedureName);
+ }
+
+-#elif !(defined(NACL)) && (defined(LINUX) || defined (NEW_MACH_CODE))
++#elif !(defined(NACL)) && (defined(LINUX) || defined (NEW_MACH_CODE) || defined(__NetBSD__) || defined(__DragonFly__))
+
+ PUBLIC int csoundOpenLibrary(void **library, const char *libraryPath)
+ {
diff --git a/audio/csound6/patches/patch-Top_csound.c b/audio/csound6/patches/patch-Top_csound.c
new file mode 100644
index 00000000000..17ef522915a
--- /dev/null
+++ b/audio/csound6/patches/patch-Top_csound.c
@@ -0,0 +1,23 @@
+$NetBSD: patch-Top_csound.c,v 1.1 2014/03/06 10:16:53 mrg Exp $
+
+--- Top/csound.c.orig 2014-01-07 08:54:20.000000000 -0800
++++ Top/csound.c 2014-02-12 23:44:07.000000000 -0800
+@@ -900,7 +900,8 @@
+
+ #if defined(ANDROID) || (!defined(LINUX) && !defined(SGI) && \
+ !defined(__HAIKU__) && !defined(__BEOS__) && \
+- !defined(__MACH__))
++ !defined(__MACH__) && !defined(__NetBSD__) && \
++ !defined(__DragonFly__))
+ static char *signal_to_string(int sig)
+ {
+ switch(sig) {
+@@ -1053,7 +1054,7 @@
+ }
+
+ static const int sigs[] = {
+-#if defined(LINUX) || defined(SGI) || defined(sol) || defined(__MACH__)
++#if defined(LINUX) || defined(SGI) || defined(sol) || defined(__MACH__) || defined(__NetBSD__) || defined(__DragonFly__)
+ SIGHUP, SIGINT, SIGQUIT, SIGILL, SIGTRAP, SIGABRT, SIGIOT, SIGBUS,
+ SIGFPE, SIGSEGV, SIGPIPE, SIGTERM, SIGXCPU, SIGXFSZ,
+ #elif defined(WIN32)
diff --git a/audio/csound6/patches/patch-Top_one_file.c b/audio/csound6/patches/patch-Top_one_file.c
new file mode 100644
index 00000000000..d88ce771614
--- /dev/null
+++ b/audio/csound6/patches/patch-Top_one_file.c
@@ -0,0 +1,40 @@
+$NetBSD: patch-Top_one_file.c,v 1.1 2014/03/06 10:16:53 mrg Exp $
+
+--- Top/one_file.c.orig 2014-01-07 08:54:20.000000000 -0800
++++ Top/one_file.c 2014-02-12 23:53:28.000000000 -0800
+@@ -29,7 +29,7 @@
+ #include <stdlib.h>
+ #include "corfile.h"
+
+-#if defined(LINUX) || defined(__MACH__) || defined(WIN32)
++#if defined(LINUX) || defined(__MACH__) || defined(WIN32) || defined(__NetBSD__) || defined(__DragonFly__)
+ # include <sys/types.h>
+ # include <sys/stat.h>
+ #endif
+@@ -77,7 +77,7 @@
+ {
+ size_t nBytes = 256;
+ char lbuf[256];
+-#if defined(LINUX) || defined(__MACH__)
++#if defined(LINUX) || defined(__MACH__) || defined(__NetBSD__) || defined(__DragonFly__)
+ struct stat tmp;
+ #elif defined(WIN32)
+ struct _stat tmp;
+@@ -109,7 +109,7 @@
+ }
+ #endif
+ if (ext != NULL && ext[0] != (char) 0) {
+-#if !defined(LINUX) && !defined(__MACH__) && !defined(WIN32)
++#if !defined(LINUX) && !defined(__MACH__) && !defined(WIN32) && !defined(__NetBSD__) && !defined(__DragonFly__)
+ char *p;
+ /* remove original extension (does not work on OS X */
+ /* and may be a bad idea) */
+@@ -129,7 +129,7 @@
+ } while (lbuf[i] != '\0');
+ }
+ #endif
+-#if defined(LINUX) || defined(__MACH__)
++#if defined(LINUX) || defined(__MACH__) || defined(__NetBSD__) || defined(__DragonFly__)
+ /* if the file already exists, try again */
+ } while (stat(lbuf, &tmp) == 0);
+ #elif defined(WIN32)
diff --git a/audio/csound6/patches/patch-Top_threads.c b/audio/csound6/patches/patch-Top_threads.c
new file mode 100644
index 00000000000..f05ad72320d
--- /dev/null
+++ b/audio/csound6/patches/patch-Top_threads.c
@@ -0,0 +1,22 @@
+$NetBSD: patch-Top_threads.c,v 1.1 2014/03/06 10:16:53 mrg Exp $
+
+--- Top/threads.c.orig 2014-01-07 08:54:20.000000000 -0800
++++ Top/threads.c 2014-02-12 23:55:26.000000000 -0800
+@@ -26,7 +26,7 @@
+
+ #ifndef HAVE_GETTIMEOFDAY
+ #if defined(LINUX) || defined(__unix) || defined(__unix__) || \
+- defined(__MACH__) || defined(__HAIKU__)
++ defined(__MACH__) || defined(__HAIKU__) || defined(__NetBSD__) || defined(__DragonFly__)
+ #define HAVE_GETTIMEOFDAY 1
+ #endif
+ #endif
+@@ -152,7 +152,7 @@
+
+
+ #if defined(LINUX) || defined(__MACH__) || defined(__HAIKU__) || \
+- defined(ANDROID) || defined(WIN32)
++ defined(ANDROID) || defined(WIN32) || defined(__NetBSD__) || defined(__DragonFly__)
+
+ #include <errno.h>
+ #include <pthread.h>
diff --git a/audio/csound6/patches/patch-frontends_CsoundVST_ScoreGeneratorVstMain.cpp b/audio/csound6/patches/patch-frontends_CsoundVST_ScoreGeneratorVstMain.cpp
new file mode 100644
index 00000000000..cb0e8874b1d
--- /dev/null
+++ b/audio/csound6/patches/patch-frontends_CsoundVST_ScoreGeneratorVstMain.cpp
@@ -0,0 +1,13 @@
+$NetBSD: patch-frontends_CsoundVST_ScoreGeneratorVstMain.cpp,v 1.1 2014/03/06 10:16:53 mrg Exp $
+
++++ frontends/CsoundVST/ScoreGeneratorVstMain.cpp.orig 2013-01-07 04:49:35.000000000 -0800
+--- frontends/CsoundVST/ScoreGeneratorVstMain.cpp 2014-02-12 20:42:30.000000000 -0800
+@@ -42,7 +42,7 @@
+ #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__) || defined(__DragonFly__)
+ AEffect *main_plugin (audioMasterCallback audioMaster)
+ #else
+ AEffect *main(audioMasterCallback audioMaster)