Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions packages/supercollider/CMakeLists.txt.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1ac592a85..69dc32265 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -14,7 +14,7 @@ if (CMAKE_SYSTEM_NAME MATCHES "Linux")
set(LINUX 1)
endif()

-if(CMAKE_SYSTEM_NAME MATCHES "Linux|FreeBSD|DragonFly|OpenBSD|NetBSD")
+if(CMAKE_SYSTEM_NAME MATCHES "Linux|FreeBSD|DragonFly|OpenBSD|NetBSD|Android")
set(LINUX_OR_BSD 1)
endif()

20 changes: 20 additions & 0 deletions packages/supercollider/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
TERMUX_PKG_HOMEPAGE=http://supercollider.github.io/
TERMUX_PKG_DESCRIPTION="A platform for audio synthesis and algorithmic composition"
TERMUX_PKG_LICENSE="GPL-3.0"
TERMUX_PKG_MAINTAINER="@rene-descartes2021"
TERMUX_PKG_VERSION=3.14.0-rc1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't usually ship rc versions.
So please either change this to the latest stable release, which seems to be 3.13.1

Or use a ~ instead of a - to indicate that this is a version before 3.14.0.
https://www.debian.org/doc/debian-policy/ch-controlfields.html#version

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok I'll just close this PR and reopen it with all the corrections when 3.14.0 comes out in a week or so.

3.13.1 requires a handful more patches to compile so best to just wait.

Thanks for the review!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR can stay the same.
You just have to force push your changes to rebase it.

3.14.0-rc1 will be fine as the version.
We just need to use a ~ to ensure it's correctly picked up as a lower version than 3.14.0

TERMUX_PKG_SRCURL=https://github.com/supercollider/supercollider/releases/download/Version-${TERMUX_PKG_VERSION}/SuperCollider-${TERMUX_PKG_VERSION}-Source.tar.bz2
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using the ~rc1 qualifier in the version will necessitate a substitution in the source URL.

Suggested change
TERMUX_PKG_SRCURL=https://github.com/supercollider/supercollider/releases/download/Version-${TERMUX_PKG_VERSION}/SuperCollider-${TERMUX_PKG_VERSION}-Source.tar.bz2
TERMUX_PKG_SRCURL=https://github.com/supercollider/supercollider/releases/download/Version-${TERMUX_PKG_VERSION/~/-}/SuperCollider-${TERMUX_PKG_VERSION/~/-}-Source.tar.bz2

We also usually use the GitHub provided release source tarballs.

Suggested change
TERMUX_PKG_SRCURL=https://github.com/supercollider/supercollider/releases/download/Version-${TERMUX_PKG_VERSION}/SuperCollider-${TERMUX_PKG_VERSION}-Source.tar.bz2
TERMUX_PKG_SRCURL=https://github.com/supercollider/supercollider/archive/refs/tags/Version-${TERMUX_PKG_VERSION/~/-}.tar.gz

Unless there's a specific reason to use the .tar.bz2 version of course.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No reason I know of- I'll ask them.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I just looked at the difference in the source tarballs, looks like the SuperCollider provided ones have a bunch of code in subdirs of external_libraries/, probably subrepos checked out. The GitHub provided tarballs don't have those. So I'll use the SuperCollider tarball.

TERMUX_PKG_SHA256=da5c0642f6d18b288539c600603be29e6e00d609bc664e2147bde146dabd6845
TERMUX_PKG_DEPENDS="jack2, libyaml-cpp, fftw, readline, libsndfile"
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="
-DBUILD_SHARED_LIBS=ON
-DNATIVE=ON
-DAUDIOAPI=jack
-DSC_QT=OFF
-DSC_HIDAPI=OFF
-DNO_X11=ON
-DNO_AVAHI=ON
-DSC_ABLETON_LINK=OFF
-DSYSTEM_YAMLCPP=ON
-DSYSTEM_BOOST=OFF
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a specific reason to not use the boost package available in Termux?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two reasons:
1)Using the system boost will result in a runtime failure, there is an error in 'boost interprocess' where it assumes and uses /tmp and that will fail on Terumx. One of the patches in this commit is to patch the bundled boost to fix that error.
2)There exists some sort of plugin to SuperCollider which requires the same version of boost to be used. I'm not really sure if this is a reason I haven't really looked into it, but I think it's the reason they bundle it in the first place.

If the first issue gets patched in boost and makes it's way to system boost I think it can be reconsidered then to use system boost.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two reasons: 1)Using the system boost will result in a runtime failure, there is an error in 'boost interprocess' where it assumes and uses /tmp and that will fail on Terumx. One of the patches in this commit is to patch the bundled boost to fix that error. 2)There exists some sort of plugin to SuperCollider which requires the same version of boost to be used. I'm not really sure if this is a reason I haven't really looked into it, but I think it's the reason they bundle it in the first place.

If the first issue gets patched in boost and makes it's way to system boost I think it can be reconsidered then to use system boost.

Yep that makes sense, thanks.
Your boost patch should probably also be ported to the termux package of boost.
I'll look into it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

boost /tmp

It should now be completely fixed after

-DSUPERNOVA=OFF"
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
diff --git a/external_libraries/boost/boost/interprocess/detail/shared_dir_helpers.hpp b/external_libraries/boost/boost/interprocess/detail/shared_dir_helpers.hpp
index 8d9d36f2d..744d9b370 100644
--- a/external_libraries/boost/boost/interprocess/detail/shared_dir_helpers.hpp
+++ b/external_libraries/boost/boost/interprocess/detail/shared_dir_helpers.hpp
@@ -24,6 +24,7 @@
#include <boost/interprocess/detail/os_file_functions.hpp>
#include <boost/interprocess/errors.hpp>
#include <boost/interprocess/exceptions.hpp>
+#include <filesystem>
#include <string>

#if defined(BOOST_INTERPROCESS_HAS_KERNEL_BOOTTIME) && defined(BOOST_INTERPROCESS_WINDOWS)
@@ -133,7 +134,7 @@ inline void get_shared_dir_root(std::basic_string<CharT> &dir_path)
#if defined (BOOST_INTERPROCESS_WINDOWS)
winapi::get_shared_documents_folder(dir_path);
#else
- dir_path = "/tmp";
+ dir_path = std::filesystem::temp_directory_path().string();
#endif

//We always need this path, so throw on error
17 changes: 17 additions & 0 deletions packages/supercollider/lang-CMakeLists.txt.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
diff --git a/lang/CMakeLists.txt b/lang/CMakeLists.txt
index 561023da4..20896f759 100644
--- a/lang/CMakeLists.txt
+++ b/lang/CMakeLists.txt
@@ -143,10 +143,10 @@ if(UNIX)
if(ALSA_FOUND)
list(APPEND sclang_sources LangPrimSource/SC_AlsaMIDI.cpp)
endif()
- if(LINUX)
+ if(LINUX AND NOT ANDROID)
list(APPEND sclang_sources LangPrimSource/SC_LID.cpp)
add_definitions(-DHAVE_LID)
- endif(LINUX)
+ endif(LINUX AND NOT ANDROID)
endif(APPLE)
endif(UNIX)

Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/lang/LangPrimSource/PyrPrimitive.cpp b/lang/LangPrimSource/PyrPrimitive.cpp
index 527369718..7167eaea2 100644
--- a/lang/LangPrimSource/PyrPrimitive.cpp
+++ b/lang/LangPrimSource/PyrPrimitive.cpp
@@ -4016,7 +4016,7 @@ void initPrimitives() {
initMIDIPrimitives();
#endif

-#if defined __linux__
+#if defined __linux__ && defined(HAVE_LID)
void initLIDPrimitives();
initLIDPrimitives();
#endif
14 changes: 14 additions & 0 deletions packages/supercollider/lang-LangSource-Bison-lang11d.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
diff --git a/lang/LangSource/Bison/lang11d b/lang/LangSource/Bison/lang11d
index b441b7a13..fd03d0cd9 100644
--- a/lang/LangSource/Bison/lang11d
+++ b/lang/LangSource/Bison/lang11d
@@ -26,7 +26,9 @@
#include "PredefinedSymbols.h"
#include "SimpleStack.h"

+#if !defined(__ANDROID__)
void bcopy(void *src, void *dst, size_t size) ;
+#endif
int yyparse();
extern bool compilingCmdLine;
extern LongStack generatorStack;
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
diff --git a/lang/LangSource/Bison/lang11d_tab.cpp b/lang/LangSource/Bison/lang11d_tab.cpp
index ebafb0d65..76340a9cb 100644
--- a/lang/LangSource/Bison/lang11d_tab.cpp
+++ b/lang/LangSource/Bison/lang11d_tab.cpp
@@ -81,7 +81,9 @@
#include "PredefinedSymbols.h"
#include "SimpleStack.h"

+#if !defined(__ANDROID__)
void bcopy(void *src, void *dst, size_t size) ;
+#endif
int yyparse();
extern bool compilingCmdLine;
extern LongStack generatorStack;
Loading