Skip to content

Commit

Permalink
add back csound
Browse files Browse the repository at this point in the history
  • Loading branch information
ycollet committed Oct 9, 2024
1 parent c575b48 commit 6ba2836
Show file tree
Hide file tree
Showing 7 changed files with 837 additions and 0 deletions.
32 changes: 32 additions & 0 deletions csound/0001-Add-support-for-using-xdg-open-for-opening-help.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
From 8b5f77070c5a5a396e5886088d506e00d0cb7125 Mon Sep 17 00:00:00 2001
From: Peter Robinson <pbrobinson@gmail.com>
Date: Wed, 31 Jan 2018 13:33:06 +0000
Subject: [PATCH 1/4] Add support for using xdg-open for opening help

xdg-open is a desktop agnostic way of opening the user's default application.
By trying xdg-open first we're more likely to open html files in the user's
default choice.

Signed-off-by: Peter Robinson <pbrobinson@gmail.com>
---
installer/misc/vim/cshelp | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/installer/misc/vim/cshelp b/installer/misc/vim/cshelp
index 888b8fe25..8c6553de8 100755
--- a/installer/misc/vim/cshelp
+++ b/installer/misc/vim/cshelp
@@ -3,7 +3,9 @@
BROWSER_CMD=""

if [ "${DISPLAY}" != "" ] ; then
- if ( which links | grep -q -G -e "^/usr" ) ; then
+ if ( which xdg-open | grep -E -e "^(/usr)?/bin" ); then
+ BROWSER_CMD="xdg-open" ;
+ elif ( which links | grep -q -G -e "^/usr" ) ; then
BROWSER_CMD="links -g" ;
elif ( which konqueror | grep -q -G -e "^/opt" ) ; then
BROWSER_CMD="konqueror" ;
--
2.31.1

25 changes: 25 additions & 0 deletions csound/0002-Default-to-PulseAudio.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
From 575e455c18ec1e158660bcaeb443b37bea8c1f09 Mon Sep 17 00:00:00 2001
From: Yann Collette <ycollette.nospam@free.fr>
Date: Tue, 8 Oct 2024 23:18:00 +0200
Subject: [PATCH] pulse

---
Top/csound.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Top/csound.c b/Top/csound.c
index e4fd096..91371e4 100644
--- a/Top/csound.c
+++ b/Top/csound.c
@@ -3590,7 +3590,7 @@ PUBLIC void csoundReset(CSOUND *csound)
strcpy(s, "PortAudio");
#endif
#else
- strcpy(s, "alsa");
+ strcpy(s, "pulse");
#endif
csoundCreateConfigurationVariable(csound, "rtaudio", s, CSOUNDCFG_STRING,
0, NULL, &max_len,
--
2.46.2

62 changes: 62 additions & 0 deletions csound/0003-use-standard-plugins-path.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
From 6f13b0ba1e907a9b4fae12ce6b3c0562d2a5cdfe Mon Sep 17 00:00:00 2001
From: Yann Collette <ycollette.nospam@free.fr>
Date: Tue, 8 Oct 2024 23:22:52 +0200
Subject: [PATCH] plugin dir

---
CMakeLists.txt | 8 +-------
Top/csmodule.c | 4 ++--
installer/misc/mkpackage.py | 2 +-
3 files changed, 4 insertions(+), 10 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index c333e83..5123acc 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -240,13 +240,7 @@ elseif(NOT DEFINED LIBRARY_INSTALL_DIR)
endif()
message(STATUS "LIBRARY INSTALL DIR: ${LIBRARY_INSTALL_DIR}")

-if(USE_DOUBLE)
- message(STATUS "Building with 64-bit floats")
- set(PLUGIN_INSTALL_DIR "${LIBRARY_INSTALL_DIR}/csound/plugins64-${APIVERSION}")
-else()
- message(STATUS "Building with 32-bit floats")
- set(PLUGIN_INSTALL_DIR "${LIBRARY_INSTALL_DIR}/csound/plugins-${APIVERSION}")
-endif()
+set(PLUGIN_INSTALL_DIR "${LIBRARY_INSTALL_DIR}/csound/plugins-${APIVERSION}")

if(WIN32 AND NOT MSVC)
if(EXISTS "C:/MinGW/include")
diff --git a/Top/csmodule.c b/Top/csmodule.c
index a401962..9bbef3a 100644
--- a/Top/csmodule.c
+++ b/Top/csmodule.c
@@ -162,9 +162,9 @@ static const char *plugindir64_envvar = "OPCODE6DIR64";
# 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 "/usr/lib/csound/plugins"
# else
-# define CS_DEFAULT_PLUGINDIR "/usr/local/lib/csound/plugins64"
+# define CS_DEFAULT_PLUGINDIR "/usr/lib64/csound/plugins"
# endif
# endif
#endif
diff --git a/installer/misc/mkpackage.py b/installer/misc/mkpackage.py
index 801311b..fe3d860 100755
--- a/installer/misc/mkpackage.py
+++ b/installer/misc/mkpackage.py
@@ -27,7 +27,7 @@ libDir2 = libDir + '/csound/lib'
# single precision plugin libraries
pluginDir32 = libDir + '/csound/plugins'
# double precision plugin libraries
-pluginDir64 = libDir + '/csound/plugins64'
+pluginDir64 = libDir + '/csound/plugins'
# documentation
docDir = instPrefix + '/share/doc/csound'
# tclcsound.so
--
2.46.2

172 changes: 172 additions & 0 deletions csound/0004-fix-naming-conflicts.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,172 @@
From 7fea2ce68a7e28cfdaf8b643dc8e122e3cce32b2 Mon Sep 17 00:00:00 2001
From: Yann Collette <ycollette.nospam@free.fr>
Date: Tue, 8 Oct 2024 23:24:47 +0200
Subject: [PATCH] naming

---
installer/linux/d32.sh | 2 +-
installer/linux/d64.sh | 2 +-
installer/linux/f32.sh | 2 +-
installer/linux/f64.sh | 2 +-
installer/misc/mkpackage.py | 10 +++++-----
util/CMakeLists.txt | 18 +++++++++---------
util/make_src_conv | 2 +-
util1/CMakeLists.txt | 4 ++--
8 files changed, 21 insertions(+), 21 deletions(-)

diff --git a/installer/linux/d32.sh b/installer/linux/d32.sh
index 8828e6d..36b329e 100644
--- a/installer/linux/d32.sh
+++ b/installer/linux/d32.sh
@@ -13,7 +13,7 @@ mkdir -p -m 0755 ../../../CSDIST/$DIR/loc

rm ../../../CSDIST/$DIR/bin/*

-cp -pv ../../{linseg,lpanal,brkpt,lpc_export,lpc_import,cs,makecsd,csb64enc,cscore,csound,csound5gui,cvanal,dnoise,mixer,envext,extract,extractor,pvanal,pvlook,het_export,het_import,hetro,scale,scot,scsort,sdif2ad,srconv,tabdes,winsound,cstclsh,cswish,matrix.tk,pv_export,pv_import,atsa,sndinfo} ../../../CSDIST/$DIR/bin
+cp -pv ../../{linseg,lpanal,brkpt,lpc_export,lpc_import,cs,makecsd,csb64enc,cscore,csound,csound5gui,cvanal,dnoise,cs-mixer,cs-envext,cs-extract,cs-extractor,pvanal,pvlook,het_export,het_import,hetro,scale,cs-scot,scsort,sdif2ad,cs-srconv,tabdes,winsound,cstclsh,cswish,matrix.tk,pv_export,pv_import,atsa,cs-sndinfo} ../../../CSDIST/$DIR/bin

strip ../../../CSDIST/$DIR/bin/*

diff --git a/installer/linux/d64.sh b/installer/linux/d64.sh
index 7a18783..2a94bd1 100644
--- a/installer/linux/d64.sh
+++ b/installer/linux/d64.sh
@@ -12,7 +12,7 @@ mkdir -p -m 0755 ../../../CSDIST/$DIR/loc

rm ../../../CSDIST/$DIR/bin/*

-cp -pv ../../{linseg,lpanal,brkpt,lpc_export,lpc_import,cs,makecsd,csb64enc,cscore,csound,csound5gui,cvanal,dnoise,mixer,envext,extract,extractor,pvanal,pvlook,het_export,het_import,hetro,scale,scot,scsort,sdif2ad,srconv,tabdes,winsound,cstclsh,cswish,matrix.tk,pv_export,pv_import,atsa,sndinfo,cseditor} ../../../CSDIST/$DIR/bin
+cp -pv ../../{linseg,lpanal,brkpt,lpc_export,lpc_import,cs,makecsd,csb64enc,cscore,csound,csound5gui,cvanal,dnoise,mixer,cs-envext,cs-extract,cs-extractor,pvanal,pvlook,het_export,het_import,hetro,scale,cs-scot,scsort,sdif2ad,cs-srconv,tabdes,winsound,cstclsh,cswish,matrix.tk,pv_export,pv_import,atsa,cs-sndinfo,cseditor} ../../../CSDIST/$DIR/bin

strip ../../../CSDIST/$DIR/bin/*

diff --git a/installer/linux/f32.sh b/installer/linux/f32.sh
index c5bd835..5368566 100644
--- a/installer/linux/f32.sh
+++ b/installer/linux/f32.sh
@@ -12,7 +12,7 @@ mkdir -p -m 0755 ../../../CSDIST/$DIR/loc

rm ../../../CSDIST/$DIR/bin/*

-cp -pv ../../{linseg,lpanal,brkpt,lpc_export,lpc_import,cs,makecsd,csb64enc,cscore,csound,csound5gui,cvanal,dnoise,mixer,envext,extract,extractor,pvanal,pvlook,het_export,het_import,hetro,scale,scot,scsort,sdif2ad,srconv,tabdes,winsound,cstclsh,cswish,matrix.tk,pv_export,pv_import,atsa,sndinfo} ../../../CSDIST/$DIR/bin
+cp -pv ../../{linseg,lpanal,brkpt,lpc_export,lpc_import,cs,makecsd,csb64enc,cscore,csound,csound5gui,cvanal,dnoise,cs-mixer,cs-envext,cs-extract,cs-extractor,pvanal,pvlook,het_export,het_import,hetro,scale,cs-scot,scsort,sdif2ad,cs-srconv,tabdes,winsound,cstclsh,cswish,matrix.tk,pv_export,pv_import,atsa,cs-sndinfo} ../../../CSDIST/$DIR/bin

strip ../../../CSDIST/$DIR/bin/*

diff --git a/installer/linux/f64.sh b/installer/linux/f64.sh
index 76b6ed1..0906625 100644
--- a/installer/linux/f64.sh
+++ b/installer/linux/f64.sh
@@ -12,7 +12,7 @@ mkdir -p -m 0755 ../../../CSDIST/$DIR/loc

rm ../../../CSDIST/$DIR/bin/*

-cp -pv ../../{linseg,lpanal,brkpt,lpc_export,lpc_import,cs,makecsd,csb64enc,cscore,csound,csound5gui,cvanal,dnoise,mixer,envext,extract,extractor,pvanal,pvlook,het_export,het_import,hetro,scale,scot,scsort,sdif2ad,srconv,tabdes,winsound,cstclsh,cswish,matrix.tk,pv_export,pv_import,atsa,sndinfo,cseditor} ../../../CSDIST/$DIR/bin
+cp -pv ../../{linseg,lpanal,brkpt,lpc_export,lpc_import,cs,makecsd,csb64enc,cscore,csound,csound5gui,cvanal,dnoise,cs-mixer,cs-envext,cs-extract,cs-extractor,pvanal,pvlook,het_export,het_import,hetro,scale,cs-scot,scsort,sdif2ad,cs-srconv,tabdes,winsound,cstclsh,cswish,matrix.tk,pv_export,pv_import,atsa,cs-sndinfo,cseditor} ../../../CSDIST/$DIR/bin

strip ../../../CSDIST/$DIR/bin/*

diff --git a/installer/misc/mkpackage.py b/installer/misc/mkpackage.py
index fe3d860..4dafa99 100755
--- a/installer/misc/mkpackage.py
+++ b/installer/misc/mkpackage.py
@@ -71,13 +71,13 @@ headerFiles += ['interfaces/CppSound.hpp', 'interfaces/filebuilding.h']
headerFiles += ['interfaces/CsoundFile.hpp']

utils1 = ['csound', 'winsound', 'cstclsh', 'cswish',
- 'atsa', 'cvanal', 'dnoise', 'envext', 'extractor',
+ 'atsa', 'cvanal', 'dnoise', 'cs-envext', 'cs-extractor',
'het_export', 'het_import', 'hetro', 'lpanal',
- 'lpc_export', 'lpc_import', 'mixer', 'pvanal',
- 'pvlook', 'pv_export', 'pv_import', 'scale', 'sndinfo',
- 'srconv', 'cseditor']
+ 'lpc_export', 'lpc_import', 'cs-mixer', 'pvanal',
+ 'pvlook', 'pv_export', 'pv_import', 'cs-scale', 'cs-sndinfo',
+ 'cs-srconv', 'cseditor']

-utils2 = ['scsort', 'extract', 'cs', 'csb64enc', 'makecsd', 'scot']
+utils2 = ['scsort', 'cs-extract', 'cs', 'csb64enc', 'makecsd', 'cs-scot']

docFiles = ['COPYING', 'ChangeLog', 'INSTALL', 'readme-csound6.txt']

diff --git a/util/CMakeLists.txt b/util/CMakeLists.txt
index ad34fdb..0853cb9 100644
--- a/util/CMakeLists.txt
+++ b/util/CMakeLists.txt
@@ -19,34 +19,34 @@ if(BUILD_UTILITIES)
make_utility(csanalyze csanalyze.c)
make_utility(cvanal cvl_main.c)
make_utility(dnoise dnoise_main.c)
- make_utility(envext env_main.c)
- make_utility(extractor xtrc_main.c)
+ make_utility(cs-envext env_main.c)
+ make_utility(cs-extractor xtrc_main.c)
make_utility(het_export hetx_main.c)
make_utility(het_import heti_main.c)
make_utility(hetro het_main.c)
make_utility(lpanal lpc_main.c)
make_utility(lpc_export lpcx_main.c ${MATH_LIBRARY})
make_utility(lpc_import lpci_main.c ${MATH_LIBRARY})
- make_executable(mixer-bin mixer_main.c "${CSOUNDLIB};${MATH_LIBRARY}" mixer)
+ make_executable(mixer-bin mixer_main.c "${CSOUNDLIB};${MATH_LIBRARY}" cs-mixer)
make_utility(pvanal pvc_main.c)
make_utility(pvlook pvl_main.c)
make_utility(pv_export pvx_main.c)
make_utility(pv_import pvi_main.c)
- make_utility(scale scale_main.c)
- make_utility(sndinfo sndinfo_main.c)
- make_utility(srconv srconv_main.c)
+ make_utility(cs-scale scale_main.c)
+ make_utility(cs-sndinfo sndinfo_main.c)
+ make_utility(cs-srconv srconv_main.c)


#find_library(LIBSNDFILE_LIBRARY sndfile libsndfile-1)
find_library(LIBSAMPLERATE_LIBRARY NAMES samplerate libsamplerate-0)

if(LIBSNDFILE_LIBRARY AND LIBSAMPLERATE_LIBRARY)
- make_executable(src_conv new_srconv.c "${LIBSNDFILE_LIBRARY};${LIBSAMPLERATE_LIBRARY}")
+ make_executable(cs-src_conv new_srconv.c "${LIBSNDFILE_LIBRARY};${LIBSAMPLERATE_LIBRARY}")
if(MSVC)
- target_link_libraries(src_conv ${LIBSNDFILE_SUPPORT_LIBS})
+ target_link_libraries(cs-src_conv ${LIBSNDFILE_SUPPORT_LIBS})
endif()
else()
- message(STATUS "Not building src_conv (libsndfile or libsamplerate not found).")
+ message(STATUS "Not building cs-src_conv (libsndfile or libsamplerate not found).")
endif()

endif()
diff --git a/util/make_src_conv b/util/make_src_conv
index ce5a90b..5896091 100755
--- a/util/make_src_conv
+++ b/util/make_src_conv
@@ -1,2 +1,2 @@
#!/bin/sh
-gcc -g new_srconv.c -lsndfile -lsamplerate -o src_conv
\ No newline at end of file
+gcc -g new_srconv.c -lsndfile -lsamplerate -o cs-src_conv
diff --git a/util1/CMakeLists.txt b/util1/CMakeLists.txt
index 639ed0a..2078c01 100644
--- a/util1/CMakeLists.txt
+++ b/util1/CMakeLists.txt
@@ -1,7 +1,7 @@
#extra utilities

make_utility(scsort sortex/smain.c)
-make_utility(extract sortex/xmain.c)
+make_utility(cs-extract sortex/xmain.c)

if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_CLANG OR MSVC)
make_utility(cs csd_util/cs.c)
@@ -19,6 +19,6 @@ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_CLANG OR MSVC)

set(scot_SRCS
scot/scot_main.c scot/scot.c)
- make_utility(scot "${scot_SRCS}")
+ make_utility(cs-scot "${scot_SRCS}")
endif()

--
2.46.2

45 changes: 45 additions & 0 deletions csound/0005-OSC-types.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
From: Debian Multimedia Maintainers <debian-multimedia@lists.debian.org>
Date: Wed, 21 Aug 2024 10:22:40 +0200
Subject: Fix callback signatures and pointer-types

Origin: upstream
Applied-Upstream: 2a071ae8ca89bc21b5c80037f8c95a01bb670ac9, 596667daba1ed99eda048e491ff8f36200f09429
Last-Update: 2024-08-21

gcc>=14 is very picky about correct pointer types
Last-Update: 2024-08-21
---
Opcodes/OSC.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/Opcodes/OSC.c b/Opcodes/OSC.c
index 529e7b7..27dbae8 100644
--- a/Opcodes/OSC.c
+++ b/Opcodes/OSC.c
@@ -483,7 +483,7 @@ static int32_t OSCcounter(CSOUND *csound, OSCcount *p)
}

static int32_t OSC_handler(const char *path, const char *types,
- lo_arg **argv, int32_t argc, void *data, void *p)
+ lo_arg **argv, int32_t argc, lo_message data, void *p)
{
IGN(argc); IGN(data);
OSC_PORT *pp = (OSC_PORT*) p;
@@ -548,7 +548,7 @@ static int32_t OSC_handler(const char *path, const char *types,
case 'b':
{
int32_t len =
- lo_blobsize((lo_blob*)argv[i]);
+ lo_blobsize((lo_blob)argv[i]);
m->args[i].blob =
csound->Malloc(csound,len);
memcpy(m->args[i].blob, argv[i], len);
@@ -964,7 +964,7 @@ static int32_t OSC_list(CSOUND *csound, OSCLISTEN *p)
/* ******** ARRAY VERSION **** EXPERIMENTAL *** */

static int32_t OSC_ahandler(const char *path, const char *types,
- lo_arg **argv, int32_t argc, void *data, void *p)
+ lo_arg **argv, int32_t argc, lo_message data, void *p)
{
IGN(argc); IGN(data);
OSC_PORT *pp = (OSC_PORT*) p;
27 changes: 27 additions & 0 deletions csound/0006-python312.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
From: Debian Multimedia Maintainers <debian-multimedia@lists.debian.org>
Date: Wed, 21 Aug 2024 10:22:40 +0200
Subject: Fix raw string for Python3.12

Origin: Debian
Bug: https://github.com/csound/csound/issues/1906
Last-Update: 2024-07-01

Py3.12 bails out if it encounters an invalid escape sequence
Last-Update: 2024-07-01
---
tests/commandline/test.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/commandline/test.py b/tests/commandline/test.py
index cd29698..9747132 100755
--- a/tests/commandline/test.py
+++ b/tests/commandline/test.py
@@ -193,7 +193,7 @@ def runTest():
expectedResult = (len(t) == 3) and 1 or 0

if(os.sep == '\\' or os.name == 'nt'):
- executable = (csoundExecutable == "") and "..\csound.exe" or csoundExecutable
+ executable = (csoundExecutable == "") and r"..\csound.exe" or csoundExecutable
command = "%s %s %s %s/%s 2> %s"%(executable, parserType, runArgs, sourceDirectory, filename, tempfile)
print(command)
retVal = os.system(command)
Loading

0 comments on commit 6ba2836

Please sign in to comment.