Browse Source

SC: standardize file locations and make steps

tags/v1.3.0
Brian Heim 5 years ago
parent
commit
fb7569d3f3
4 changed files with 52 additions and 3 deletions
  1. +6
    -2
      Makefile
  2. +1
    -1
      src/SuperColliderEngine.cpp
  3. +23
    -0
      support/supercollider_extensions/VcvPrototypeProcessBlock.sc
  4. +22
    -0
      support/supercollider_get_libsclang_link_line.patch

+ 6
- 2
Makefile View File

@@ -83,17 +83,21 @@ FLAGS += -DNDEBUG # TODO is this OK?
supercollider := dep/supercollider/build/lang/libsclang.a
OBJECTS += $(supercollider)
DEPS += $(supercollider)
DISTRIBUTABLES += dep/supercollider/SCClassLibrary
DISTRIBUTABLES += support/supercollider_extensions
SUPERCOLLIDER_CMAKE_FLAGS += -DSUPERNOVA=OFF -DSC_EL=OFF -DSC_VIM=OFF -DSC_ED=OFF -DSC_IDE=OFF -DSC_ABLETON_LINK=OFF -DSC_QT=OFF -DCMAKE_BUILD_TYPE=Release -DSCLANG_SERVER=OFF -DBUILD_TESTING=OFF
SUPERCOLLIDER_SUBMODULES += external_libraries/hidapi external_libraries/nova-simd external_libraries/nova-tt external_libraries/portaudio_sc_org external_libraries/yaml-cpp
SUPERCOLLIDER_BRANCH := topic/vcv-prototype-support
# TODO need some better way of getting link library names!
LDFLAGS += dep/supercollider/build/lang/../external_libraries/libtlsf.a /usr/lib/libpthread.dylib dep/supercollider/build/lang/../external_libraries/hidapi/mac/libhidapi.a dep/supercollider/build/lang/../external_libraries/hidapi/hidapi_parser/libhidapi_parser.a dep/supercollider/build/lang/../external_libraries/libboost_thread_lib.a dep/supercollider/build/lang/../external_libraries/libboost_system_lib.a dep/supercollider/build/lang/../external_libraries/libboost_regex_lib.a dep/supercollider/build/lang/../external_libraries/libboost_filesystem_lib.a /usr/local/opt/readline/lib/libreadline.dylib -framework Carbon -framework CoreAudio -framework CoreMIDI -framework CoreServices -framework IOKit -framework CoreFoundation /usr/local/opt/libsndfile/lib/libsndfile.dylib dep/supercollider/build/lang/../external_libraries/libyaml.a
# FIXME should be able to find some better way of getting link library names!
LDFLAGS += $$(cat dep/supercollider/build/lang/vcv_libsclang_link_line.txt)
$(supercollider):
cd dep && git clone "https://github.com/supercollider/supercollider" --branch $(SUPERCOLLIDER_BRANCH) --depth 5
cd dep/supercollider && git submodule update --init -- $(SUPERCOLLIDER_SUBMODULES)
cd dep/supercollider && git apply ../../support/supercollider_get_libsclang_link_line.patch
cd dep/supercollider && mkdir build && cd build
cd dep/supercollider/build && cmake .. -G "Unix Makefiles" $(SUPERCOLLIDER_CMAKE_FLAGS)
cd dep/supercollider/build && $(MAKE) libsclang
cd dep/supercollider/build && $(MAKE) generate_libsclang_link_line
endif

# Python


+ 1
- 1
src/SuperColliderEngine.cpp View File

@@ -161,7 +161,7 @@ SC_VcvPrototypeClient::SC_VcvPrototypeClient(SuperColliderEngine* engine)
{
using Path = SC_LanguageConfig::Path;
Path sc_lib_root = rack::asset::plugin(pluginInstance, "dep/supercollider/SCClassLibrary");
Path sc_ext_root = rack::asset::plugin(pluginInstance, "dep/supercollider_extensions");
Path sc_ext_root = rack::asset::plugin(pluginInstance, "support/supercollider_extensions");
Path sc_yaml_path = rack::asset::plugin(pluginInstance, "dep/supercollider/sclang_vcv_config.yml");

if (!SC_LanguageConfig::defaultLibraryConfig(/* isStandalone */ true))


+ 23
- 0
support/supercollider_extensions/VcvPrototypeProcessBlock.sc View File

@@ -0,0 +1,23 @@
// Represents a process block in VCV Prototype. Users should generally not create instances
// of this class themselves, and should only modify the values in `outputs`, `knobs`, `lights`,
// and `switchLights`.
//
// Original author: Brian Heim

VcvPrototypeProcessBlock {
classvar <>numRows; // Set internally, do not modify

// Code in SuperColliderEngine.cpp relies on ordering.
var <sampleRate; // Float
var <sampleTime; // Float
var <bufferSize; // Integer
var <inputs; // Array[numRows] of Signal[bufferSize]
var <>outputs; // Array[numRows] of Signal[bufferSize]
var <>knobs; // FloatArray[numRows]
var <switches; // Array[numRows] of Boolean
var <>lights; // Array[numRows] of FloatArray[3]
var <>switchLights; // Array[numRows] of FloatArray[3]

// TODO not needed?
*new { |... args| ^super.newCopyArgs(*args); }
}

+ 22
- 0
support/supercollider_get_libsclang_link_line.patch View File

@@ -0,0 +1,22 @@
diff --git a/lang/CMakeLists.txt b/lang/CMakeLists.txt
index f370ad7..f73309f 100644
--- a/lang/CMakeLists.txt
+++ b/lang/CMakeLists.txt
@@ -388,3 +388,17 @@ else()
RUNTIME DESTINATION "bin"
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
endif()
+
+set(LIBSCLANG_LINK_LINE_FILE vcv_libsclang_link_line.txt)
+get_target_property(libsclang_libs libsclang INTERFACE_LINK_LIBRARIES)
+add_custom_command(OUTPUT ${LIBSCLANG_LINK_LINE_FILE} COMMAND echo)
+foreach(lib IN LISTS libsclang_libs)
+ if(TARGET ${lib})
+ add_custom_command(APPEND OUTPUT ${LIBSCLANG_LINK_LINE_FILE}
+ COMMAND echo $<TARGET_FILE:${lib}> ">>" ${LIBSCLANG_LINK_LINE_FILE})
+ else()
+ add_custom_command(APPEND OUTPUT ${LIBSCLANG_LINK_LINE_FILE}
+ COMMAND echo ${lib} ">>" ${LIBSCLANG_LINK_LINE_FILE})
+ endif()
+endforeach()
+add_custom_target(generate_libsclang_link_line DEPENDS ${LIBSCLANG_LINK_LINE_FILE})

Loading…
Cancel
Save