From a703a53232ac72b970232f02178c0592690792f9 Mon Sep 17 00:00:00 2001 From: falkTX Date: Sun, 12 Nov 2023 10:02:43 +0200 Subject: [PATCH 01/19] cmake: allow static builds, add host-plugin target Signed-off-by: falkTX --- cmake/CMakeLists.txt | 178 ++++++++++++++++++++++++++++++++++++++----- 1 file changed, 160 insertions(+), 18 deletions(-) diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 9ae263d1c..489c35fd8 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -49,8 +49,8 @@ else() set(CARLA_USE_OSC_DEFAULT TRUE) endif() - set(CARLA_BUILD_FRAMEWORKS FALSE CACHE BOOL "Build libraries as macOS frameworks") +set(CARLA_BUILD_STATIC FALSE CACHE BOOL "Build static libraries") set(CARLA_ENABLE_JSFX TRUE CACHE BOOL "Enable JSFX") set(CARLA_USE_JACK ${CARLA_USE_JACK_DEFAULT} CACHE BOOL "Enable JACK") set(CARLA_USE_OSC ${CARLA_USE_OSC_DEFAULT} CACHE BOOL "Enable OSC") @@ -60,6 +60,12 @@ if(${CARLA_BUILD_FRAMEWORKS} AND NOT APPLE) mark_as_advanced(CARLA_BUILD_FRAMEWORKS) endif() +if(${CARLA_BUILD_STATIC}) + set(CARLA_LIB_TYPE STATIC) +else() + set(CARLA_LIB_TYPE SHARED) +endif() + if(${CARLA_BUILD_FRAMEWORKS}) execute_process(COMMAND date -u +%y%m%d%H%M%S OUTPUT_VARIABLE CARLA_DATE OUTPUT_STRIP_TRAILING_WHITESPACE) endif() @@ -158,6 +164,8 @@ function(set_common_target_properties TARGET) target_compile_definitions(${TARGET} PRIVATE BUILDING_CARLA + $<$:_USE_MATH_DEFINES> + PUBLIC $<$:HAVE_YSFX> $<$:HAVE_JACK> $<$:HAVE_FLUIDSYNTH> @@ -166,7 +174,6 @@ function(set_common_target_properties TARGET) $<$:HAVE_PYQT> $<$:HAVE_SNDFILE> $<$:HAVE_X11> - $<$:_USE_MATH_DEFINES> ) target_compile_options(${TARGET} @@ -240,7 +247,7 @@ target_include_directories(carla-audio-decoder ) target_link_libraries(carla-audio-decoder - PRIVATE + PUBLIC PkgConfig::SNDFILE ) @@ -268,7 +275,7 @@ target_include_directories(carla-jackbridge ) target_link_libraries(carla-jackbridge - PRIVATE + PUBLIC ${CARLA_LIBDL} ${CARLA_LIBRT} ) @@ -418,6 +425,7 @@ target_link_libraries(carla-lilv carla-lilv_sord carla-lilv_sratom carla-lilv_lilv + PUBLIC ${CARLA_LIBDL} ${CARLA_LIBM} ${CARLA_LIBRT} @@ -439,7 +447,7 @@ target_include_directories(carla-native-plugins ) target_link_libraries(carla-native-plugins - PRIVATE + PUBLIC ${CARLA_PTHREADS} ) @@ -484,7 +492,7 @@ target_include_directories(carla-rtmempool ) target_link_libraries(carla-rtmempool - PRIVATE + PUBLIC ${CARLA_LIBDL} ${CARLA_LIBRT} ${CARLA_PTHREADS} @@ -513,6 +521,7 @@ target_include_directories(carla-sfzero target_link_libraries(carla-sfzero PRIVATE carla-audio-decoder + PUBLIC ${CARLA_PTHREADS} ) @@ -541,7 +550,7 @@ target_include_directories(carla-water ) target_link_libraries(carla-water - PRIVATE + PUBLIC $<$:$> $<$:comdlg32> $<$:ole32> @@ -576,7 +585,7 @@ target_include_directories(carla-water-files ) target_link_libraries(carla-water-files - PRIVATE + PUBLIC $<$:$> $<$:ole32> $<$:winmm> @@ -691,7 +700,7 @@ target_include_directories(carla-zita-resampler ) target_link_libraries(carla-zita-resampler - PRIVATE + PUBLIC ${CARLA_PTHREADS} ) @@ -753,6 +762,7 @@ target_link_libraries(carla-bridge-native carla-water $<$:carla-ysfx> carla-zita-resampler + PUBLIC PkgConfig::FLUIDSYNTH PkgConfig::LIBLO PkgConfig::LIBMAGIC @@ -824,6 +834,7 @@ target_link_libraries(carla-bridge-lv2-gtk2 PRIVATE carla-lilv carla-water-files + PUBLIC PkgConfig::X11 ${CARLA_PTHREADS} ) @@ -867,6 +878,7 @@ target_link_libraries(carla-bridge-lv2-gtk3 PRIVATE carla-lilv carla-water-files + PUBLIC PkgConfig::X11 ${CARLA_PTHREADS} ) @@ -904,6 +916,7 @@ target_link_libraries(carla-discovery-native carla-lilv carla-water-files $<$:carla-ysfx> + PUBLIC PkgConfig::FLUIDSYNTH ${CARLA_PTHREADS} ) @@ -913,11 +926,135 @@ target_sources(carla-discovery-native ../source/discovery/carla-discovery.cpp ) +####################################################################################################################### +# carla host-plugin + +add_library(carla-host-plugin ${CARLA_LIB_TYPE}) +add_library(carla::host-plugin ALIAS carla-host-plugin) + +set_common_target_properties(carla-host-plugin) + +if(${CARLA_BUILD_FRAMEWORKS}) + set(carla-host-plugin-public-headers + ../source/backend/CarlaBackend.h + ../source/backend/CarlaHost.h + ../source/backend/CarlaUtils.h + ) + + set_target_properties(carla-host-plugin + PROPERTIES + FRAMEWORK TRUE + FRAMEWORK_VERSION A + OUTPUT_NAME carla-host-plugin + PUBLIC_HEADER "${carla-host-plugin-public-headers}" + MACOSX_FRAMEWORK_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/Info-framework.plist.in" + MACOSX_FRAMEWORK_IDENTIFIER "studio.kx.carla.host-plugin" + MACOSX_FRAMEWORK_BUNDLE_VERSION "${CARLA_DATE}" + MACOSX_FRAMEWORK_SHORT_VERSION_STRING "${PROJECT_SHORT_VERSION}" + ) +else() + set_target_properties(carla-host-plugin + PROPERTIES + OUTPUT_NAME carla_host-plugin + IMPORT_PREFIX lib + PREFIX lib + ) +endif() + +target_compile_definitions(carla-host-plugin + PRIVATE + CARLA_PLUGIN_BUILD + CARLA_LIB_EXT="${CMAKE_SHARED_LIBRARY_SUFFIX}" +) + +# FIXME +# target_compile_options(carla-host-plugin +# PRIVATE +# $<$:-Wno-unused-parameter> +# ) + +target_include_directories(carla-host-plugin + PRIVATE + ../source + ../source/modules + PUBLIC + ../source/backend + ../source/includes + ../source/utils +) + +target_link_libraries(carla-host-plugin + PRIVATE + carla-jackbridge + carla-lilv + carla-native-plugins + carla-rtmempool + carla-sfzero + carla-water + $<$:carla-ysfx> + carla-zita-resampler + PUBLIC + PkgConfig::FLUIDSYNTH + PkgConfig::LIBLO + PkgConfig::LIBMAGIC + PkgConfig::X11 + $<$:$> + ${CARLA_PTHREADS} +) + +target_sources(carla-host-plugin + PRIVATE + ../source/backend/engine/CarlaEngine.cpp + ../source/backend/engine/CarlaEngineClient.cpp + ../source/backend/engine/CarlaEngineData.cpp + ../source/backend/engine/CarlaEngineGraph.cpp + ../source/backend/engine/CarlaEngineInternal.cpp + ../source/backend/engine/CarlaEngineNative.cpp + ../source/backend/engine/CarlaEngineOsc.cpp + ../source/backend/engine/CarlaEngineOscHandlers.cpp + ../source/backend/engine/CarlaEngineOscSend.cpp + ../source/backend/engine/CarlaEnginePorts.cpp + ../source/backend/engine/CarlaEngineRunner.cpp + ../source/backend/plugin/CarlaPlugin.cpp + ../source/backend/plugin/CarlaPluginBridge.cpp + ../source/backend/plugin/CarlaPluginInternal.cpp + ../source/backend/plugin/CarlaPluginAU.cpp + ../source/backend/plugin/CarlaPluginCLAP.cpp + ../source/backend/plugin/CarlaPluginFluidSynth.cpp + ../source/backend/plugin/CarlaPluginJuce.cpp + ../source/backend/plugin/CarlaPluginJSFX.cpp + ../source/backend/plugin/CarlaPluginLADSPADSSI.cpp + ../source/backend/plugin/CarlaPluginLV2.cpp + ../source/backend/plugin/CarlaPluginNative.cpp + ../source/backend/plugin/CarlaPluginSFZero.cpp + ../source/backend/plugin/CarlaPluginVST2.cpp + ../source/backend/plugin/CarlaPluginVST3.cpp + ../source/plugin/carla-host-plugin.cpp + $<$:../source/backend/plugin/CarlaPluginJack.cpp> + PUBLIC + ${carla-host-plugin-public-headers} +) + +install(TARGETS carla-host-plugin + ARCHIVE DESTINATION ${CARLA_INSTALL_LIBDIR} + LIBRARY DESTINATION ${CARLA_INSTALL_LIBDIR} + FRAMEWORK DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CARLA_INSTALL_BINDIR} +) + +if(${CARLA_BUILD_FRAMEWORKS}) + install(FILES + ../source/includes/CarlaDefines.h + ../source/includes/CarlaNative.h + ../source/includes/CarlaNativePlugin.h + DESTINATION ${CMAKE_INSTALL_LIBDIR}/carla-standalone.framework/Versions/A/Headers/includes) +endif() + ####################################################################################################################### # carla native-plugin -add_library(carla-native-plugin SHARED) -add_library(carla::standalone ALIAS carla-native-plugin) +add_library(carla-native-plugin ${CARLA_LIB_TYPE}) +add_library(carla::native-plugin ALIAS carla-native-plugin) set_common_target_properties(carla-native-plugin) @@ -963,9 +1100,10 @@ target_compile_definitions(carla-native-plugin target_include_directories(carla-native-plugin PRIVATE ../source + ../source/modules + PUBLIC ../source/backend ../source/includes - ../source/modules ../source/utils ) @@ -1023,6 +1161,7 @@ target_link_libraries(carla-native-plugin carla-water $<$:carla-ysfx> carla-zita-resampler + PUBLIC PkgConfig::FLUIDSYNTH PkgConfig::LIBLO PkgConfig::LIBMAGIC @@ -1082,7 +1221,7 @@ endif() ####################################################################################################################### # carla standalone -add_library(carla-standalone SHARED) +add_library(carla-standalone ${CARLA_LIB_TYPE}) add_library(carla::standalone ALIAS carla-standalone) set_common_target_properties(carla-standalone) @@ -1134,9 +1273,10 @@ target_compile_options(carla-standalone target_include_directories(carla-standalone PRIVATE ../source + ../source/modules + PUBLIC ../source/backend ../source/includes - ../source/modules ../source/utils ) @@ -1150,6 +1290,7 @@ target_link_libraries(carla-standalone carla-water $<$:carla-ysfx> carla-zita-resampler + PUBLIC PkgConfig::FLUIDSYNTH PkgConfig::LIBLO PkgConfig::LIBMAGIC @@ -1238,7 +1379,7 @@ endif() ####################################################################################################################### # carla utils -add_library(carla-utils SHARED) +add_library(carla-utils ${CARLA_LIB_TYPE}) add_library(carla::utils ALIAS carla-utils) set_common_target_properties(carla-utils) @@ -1272,9 +1413,10 @@ endif() target_include_directories(carla-utils PRIVATE ../source + ../source/modules + PUBLIC ../source/backend ../source/includes - ../source/modules ../source/utils ) @@ -1284,12 +1426,12 @@ target_link_libraries(carla-utils carla-lilv carla-water-files $<$:carla-ysfx> + PUBLIC PkgConfig::FLUIDSYNTH PkgConfig::LIBMAGIC PkgConfig::X11 - $<$:$> ${CARLA_PTHREADS} - PUBLIC + $<$:$> $<$:winmm> ) From c1352d5aa8315b1d7fe15faa803150d9da6a0461 Mon Sep 17 00:00:00 2001 From: falkTX Date: Sun, 12 Nov 2023 10:17:29 +0200 Subject: [PATCH 02/19] Fix previous commit Signed-off-by: falkTX --- cmake/CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 489c35fd8..6942e57f3 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -425,7 +425,6 @@ target_link_libraries(carla-lilv carla-lilv_sord carla-lilv_sratom carla-lilv_lilv - PUBLIC ${CARLA_LIBDL} ${CARLA_LIBM} ${CARLA_LIBRT} From 88b600d6e2ad3bfd12747e8ddde031e40fc79a1f Mon Sep 17 00:00:00 2001 From: falkTX Date: Sun, 12 Nov 2023 10:47:47 +0200 Subject: [PATCH 03/19] Fix audio-file for offline use Signed-off-by: falkTX --- source/native-plugins/audio-file.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/source/native-plugins/audio-file.cpp b/source/native-plugins/audio-file.cpp index 4d37ffb6e..822ccdb61 100644 --- a/source/native-plugins/audio-file.cpp +++ b/source/native-plugins/audio-file.cpp @@ -449,12 +449,21 @@ protected: return; } + const bool offline = isOffline(); bool needsIdleRequest = false; - if (fReader.tickFrames(outBuffer, 0, frames, framePos, fLoopMode, isOffline()) && ! fPendingFileRead) + if (fReader.tickFrames(outBuffer, 0, frames, framePos, fLoopMode, offline) && ! fPendingFileRead) { - fPendingFileRead = true; - needsIdleRequest = true; + if (offline) + { + fPendingFileRead = false; + fReader.readPoll(); + } + else + { + fPendingFileRead = true; + needsIdleRequest = true; + } } fLastPosition = fReader.getLastPlayPosition() * 100.f; From 454e2e5fb6f7db631dc6e5d9d84202b99625c2bc Mon Sep 17 00:00:00 2001 From: falkTX Date: Sun, 19 Nov 2023 20:42:38 +0100 Subject: [PATCH 04/19] cmake: Set CMP0126 policy to new Signed-off-by: falkTX --- cmake/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 6942e57f3..5fc9c6d60 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -16,6 +16,7 @@ set(PROJECT_SHORT_VERSION 2.5.91) set(CMAKE_POLICY_DEFAULT_CMP0025 NEW) set(CMAKE_POLICY_DEFAULT_CMP0063 NEW) set(CMAKE_POLICY_DEFAULT_CMP0069 NEW) +set(CMAKE_POLICY_DEFAULT_CMP0126 NEW) set(CMAKE_C_STANDARD 11) set(CMAKE_CXX_STANDARD 11) From d362d141ca4e9f8037bd9207f081ac901aeec0ff Mon Sep 17 00:00:00 2001 From: falkTX Date: Sun, 26 Nov 2023 11:42:12 +0100 Subject: [PATCH 05/19] pluginlist: skip bridge scanning if not enabled in settings Also some cleanup Signed-off-by: falkTX --- .../frontend/pluginlist/pluginlistdialog.cpp | 26 +++++++++++++------ 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/source/frontend/pluginlist/pluginlistdialog.cpp b/source/frontend/pluginlist/pluginlistdialog.cpp index 6d94e41eb..053d48a15 100644 --- a/source/frontend/pluginlist/pluginlistdialog.cpp +++ b/source/frontend/pluginlist/pluginlistdialog.cpp @@ -407,7 +407,7 @@ static QVariant asByteArray(const PluginInfo& info) QByteArray qdata; // start with the POD data, stored as-is - qdata.append(static_cast(static_cast(&info)), sizeof(PluginInfoHeader)); + qdata.append(reinterpret_cast(&info), sizeof(PluginInfoHeader)); // then all the strings, with a null terminating byte { @@ -455,8 +455,8 @@ static PluginInfo asPluginInfo(const QByteArray &qdata) CARLA_SAFE_ASSERT_RETURN(static_cast(qdata.size()) >= sizeof(PluginInfoHeader) + sizeof(char) * 5, {}); // read POD data first - const PluginInfoHeader* const data - = static_cast(static_cast(qdata.constData())); + const PluginInfoHeader* const data = reinterpret_cast(qdata.constData()); + PluginInfo info = {}; info.build = data->build; info.type = data->type; @@ -472,7 +472,7 @@ static PluginInfo asPluginInfo(const QByteArray &qdata) info.parameterOuts = data->parameterOuts; // then all the strings, keeping the same order as in `asVariant` - const char* sdata = static_cast(static_cast(data + 1)); + const char* sdata = reinterpret_cast(data + 1); info.category = QString::fromUtf8(sdata); sdata += info.category.size() + 1; @@ -556,7 +556,7 @@ static QByteArray asByteArray(const PluginFavorite& fav) QByteArray qdata; // start with the POD data, stored as-is - qdata.append(static_cast(static_cast(&fav)), sizeof(PluginFavoriteHeader)); + qdata.append(reinterpret_cast(&fav), sizeof(PluginFavoriteHeader)); // then all the strings, with a null terminating byte { @@ -591,12 +591,11 @@ static PluginFavorite asPluginFavorite(const QByteArray& qdata) CARLA_SAFE_ASSERT_RETURN(static_cast(qdata.size()) >= sizeof(PluginFavoriteHeader) + sizeof(char) * 3, {}); // read POD data first - const PluginFavoriteHeader* const data - = static_cast(static_cast(qdata.constData())); + const PluginFavoriteHeader* const data = reinterpret_cast(qdata.constData()); PluginFavorite fav = { data->type, data->uniqueId, {}, {} }; // then all the strings, keeping the same order as in `asVariant` - const char* sdata = static_cast(static_cast(data + 1)); + const char* sdata = reinterpret_cast(data + 1); fav.filename = QString::fromUtf8(sdata); sdata += fav.filename.size() + 1; @@ -663,6 +662,8 @@ struct PluginListDialog::PrivateData { bool firstInit = true; bool ignoreCache = false; bool checkInvalid = false; + bool usePluginBridges = false; + bool useWineBridges = false; CarlaPluginDiscoveryHandle handle = nullptr; QCarlaString tool; CarlaScopedPointer dialog; @@ -686,6 +687,9 @@ struct PluginListDialog::PrivateData { handle = nullptr; } + if (!usePluginBridges) + return false; + #ifdef CARLA_OS_WIN #ifdef CARLA_OS_WIN64 // look for win32 plugins on win64 @@ -719,6 +723,9 @@ struct PluginListDialog::PrivateData { } #endif + if (!useWineBridges) + return false; + // try wine bridges #ifdef CARLA_OS_64BIT if (btype == BINARY_NATIVE || btype == BINARY_POSIX32) @@ -822,6 +829,9 @@ PluginListDialog::PluginListDialog(QWidget* const parent, const HostSettings* co // ---------------------------------------------------------------------------------------------------------------- // Set-up global discovery options + p->discovery.usePluginBridges = hostSettings->showPluginBridges; + p->discovery.useWineBridges = hostSettings->showWineBridges; + #ifndef CARLA_OS_WIN carla_plugin_discovery_set_option(ENGINE_OPTION_WINE_AUTO_PREFIX, hostSettings->wineAutoPrefix, nullptr); carla_plugin_discovery_set_option(ENGINE_OPTION_WINE_EXECUTABLE, 0, hostSettings->wineExecutable); From f3d8dce5861fcd6024c524c7966d5226aa07e328 Mon Sep 17 00:00:00 2001 From: falkTX Date: Sun, 26 Nov 2023 11:48:40 +0100 Subject: [PATCH 06/19] Set wine env vars for all discovery methods Signed-off-by: falkTX --- source/backend/utils/PluginDiscovery.cpp | 47 +++++++++++++----------- 1 file changed, 25 insertions(+), 22 deletions(-) diff --git a/source/backend/utils/PluginDiscovery.cpp b/source/backend/utils/PluginDiscovery.cpp index dac350162..9392d92a0 100644 --- a/source/backend/utils/PluginDiscovery.cpp +++ b/source/backend/utils/PluginDiscovery.cpp @@ -440,6 +440,31 @@ private: default: break; } + + String winePrefix; + + if (options.wine.autoPrefix && !fBinaries.empty()) + { + const File file(fBinaries[fBinaryIndex]); + const String filename(file.getFullPathName()); + + winePrefix = findWinePrefix(filename); + } + + if (winePrefix.isEmpty()) + { + const char* const envWinePrefix = std::getenv("WINEPREFIX"); + + if (envWinePrefix != nullptr && envWinePrefix[0] != '\0') + winePrefix = envWinePrefix; + else if (options.wine.fallbackPrefix != nullptr && options.wine.fallbackPrefix[0] != '\0') + winePrefix = options.wine.fallbackPrefix.buffer(); + else + winePrefix = File::getSpecialLocation(File::userHomeDirectory).getFullPathName() + "/.wine"; + } + + const CarlaScopedEnvVar sev1("WINEDEBUG", "-all"); + const CarlaScopedEnvVar sev2("WINEPREFIX", winePrefix.toRawUTF8()); #endif if (fBinaries.empty()) @@ -468,28 +493,6 @@ private: } } - #ifndef CARLA_OS_WIN - String winePrefix; - - if (options.wine.autoPrefix) - winePrefix = findWinePrefix(filename); - - if (winePrefix.isEmpty()) - { - const char* const envWinePrefix = std::getenv("WINEPREFIX"); - - if (envWinePrefix != nullptr && envWinePrefix[0] != '\0') - winePrefix = envWinePrefix; - else if (options.wine.fallbackPrefix != nullptr && options.wine.fallbackPrefix[0] != '\0') - winePrefix = options.wine.fallbackPrefix.buffer(); - else - winePrefix = File::getSpecialLocation(File::userHomeDirectory).getFullPathName() + "/.wine"; - } - - const CarlaScopedEnvVar sev1("WINEDEBUG", "-all"); - const CarlaScopedEnvVar sev2("WINEPREFIX", winePrefix.toRawUTF8()); - #endif - carla_stdout("Scanning \"%s\"...", filename.toRawUTF8()); #ifndef CARLA_OS_WIN From bcfcafd2adfa2cabd1c823ef026aaaa79a7fb73c Mon Sep 17 00:00:00 2001 From: falkTX Date: Fri, 8 Dec 2023 12:44:48 +0100 Subject: [PATCH 07/19] Backport serd double backslash encoding fix Signed-off-by: falkTX --- source/modules/lilv/serd-0.24.0/src/reader.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/source/modules/lilv/serd-0.24.0/src/reader.c b/source/modules/lilv/serd-0.24.0/src/reader.c index fad845a04..6adef5d50 100644 --- a/source/modules/lilv/serd-0.24.0/src/reader.c +++ b/source/modules/lilv/serd-0.24.0/src/reader.c @@ -554,9 +554,19 @@ read_STRING_LITERAL_LONG(SerdReader* reader, SerdNodeFlags* flags, uint8_t q) eat_byte_safe(reader, q3); return ref; } else { - *flags |= SERD_HAS_QUOTE; - push_byte(reader, ref, c); - read_character(reader, ref, flags, q2); + if (q2 == '\\') { + push_byte(reader, ref, c); + if (!read_ECHAR(reader, ref, flags) && + !read_UCHAR(reader, ref, &code)) { + r_err(reader, SERD_ERR_BAD_SYNTAX, + "invalid escape `\\%c'\n", peek_byte(reader)); + return pop_node(reader, ref); + } + } else { + *flags |= SERD_HAS_QUOTE; + push_byte(reader, ref, c); + read_character(reader, ref, flags, q2); + } } } else { read_character(reader, ref, flags, eat_byte_safe(reader, c)); From 68bbca2711626835157ef3a55938566f2ee3fe87 Mon Sep 17 00:00:00 2001 From: Alexandros Theodotou Date: Wed, 13 Dec 2023 20:17:51 +0900 Subject: [PATCH 08/19] cmake: Install host-plugin/native-plugin/standalone pkgconfig files --- cmake/CMakeLists.txt | 6 ++++++ cmake/carla-host-plugin.pc.in | 10 ++++++++++ cmake/carla-native-plugin.pc.in | 9 +++++++++ cmake/carla-standalone.pc.in | 9 +++++++++ 4 files changed, 34 insertions(+) create mode 100644 cmake/carla-host-plugin.pc.in create mode 100644 cmake/carla-native-plugin.pc.in create mode 100644 cmake/carla-standalone.pc.in diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 5fc9c6d60..c0a817e07 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -1587,9 +1587,15 @@ install(TARGETS carla-headers-utils PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_IN if(NOT ${CARLA_BUILD_FRAMEWORKS} AND NOT MSVC) configure_file(carla-utils.pc.in carla-utils.pc @ONLY) + configure_file(carla-standalone.pc.in carla-standalone.pc @ONLY) + configure_file(carla-native-plugin.pc.in carla-native-plugin.pc @ONLY) + configure_file(carla-host-plugin.pc.in carla-host-plugin.pc @ONLY) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/carla-utils.pc + ${CMAKE_CURRENT_BINARY_DIR}/carla-standalone.pc + ${CMAKE_CURRENT_BINARY_DIR}/carla-native-plugin.pc + ${CMAKE_CURRENT_BINARY_DIR}/carla-host-plugin.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig ) diff --git a/cmake/carla-host-plugin.pc.in b/cmake/carla-host-plugin.pc.in new file mode 100644 index 000000000..5850be717 --- /dev/null +++ b/cmake/carla-host-plugin.pc.in @@ -0,0 +1,10 @@ +prefix=@CMAKE_INSTALL_PREFIX@ +libdir=@CMAKE_INSTALL_FULL_LIBDIR@ +includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@ +carla_libdir=${libdir}/carla + +Name: carla-host-plugin +Version: @PROJECT_VERSION@ +Description: Carla Host as Native Plugin +Libs: -Wl,-rpath,${carla_libdir} -L${carla_libdir} -lcarla_host-plugin +Cflags: -I${includedir}/carla -I${includedir}/carla/includes diff --git a/cmake/carla-native-plugin.pc.in b/cmake/carla-native-plugin.pc.in new file mode 100644 index 000000000..2e677ae9e --- /dev/null +++ b/cmake/carla-native-plugin.pc.in @@ -0,0 +1,9 @@ +prefix=@CMAKE_INSTALL_PREFIX@ +libdir=@CMAKE_INSTALL_FULL_LIBDIR@ +includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@ + +Name: carla-native-plugin +Version: @PROJECT_VERSION@ +Description: Carla Native Plugin +Libs: -Wl,-rpath,${libdir}/carla -L${libdir}/carla -lcarla_native-plugin +Cflags: -I${includedir}/carla -I${includedir}/carla/includes diff --git a/cmake/carla-standalone.pc.in b/cmake/carla-standalone.pc.in new file mode 100644 index 000000000..acc821c00 --- /dev/null +++ b/cmake/carla-standalone.pc.in @@ -0,0 +1,9 @@ +prefix=@CMAKE_INSTALL_PREFIX@ +libdir=@CMAKE_INSTALL_FULL_LIBDIR@ +includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@ + +Name: carla-standalone +Version: @PROJECT_VERSION@ +Description: Carla Host Standalone +Libs: -Wl,-rpath,${libdir}/carla -L${libdir}/carla -lcarla_standalone2 +Cflags: -I${includedir}/carla -I${includedir}/carla/includes From 01508aac264e6686e07b46008711b50dda243838 Mon Sep 17 00:00:00 2001 From: falkTX Date: Sat, 23 Dec 2023 14:53:10 +0100 Subject: [PATCH 09/19] Rework CI cmake setup Signed-off-by: falkTX --- .github/workflows/cmake.yml | 152 ++++++++++++++++++------------------ 1 file changed, 75 insertions(+), 77 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 40fa0f9b9..562756923 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -6,140 +6,138 @@ env: DESTDIR: ${{ github.workspace }}/build/tmp jobs: - macos-libs: - runs-on: macos-latest + linux: + strategy: + matrix: + include: + - container: debian:11 + - container: debian:12 + - container: ubuntu:20.04 + - container: ubuntu:22.04 + - container: ubuntu:23.10 + runs-on: ubuntu-latest + container: + image: ${{ matrix.container }} steps: - uses: actions/checkout@v3 - name: Set up dependencies run: | - brew install cmake fluid-synth liblo libmagic libsndfile pkg-config + apt-get update -qq + apt-get install -yqq cmake g++ libfluidsynth-dev liblo-dev libmagic-dev libsndfile1-dev libx11-dev lsb-release pkg-config + echo "PACK_NAME=$(lsb_release -cs 2>/dev/null)" >> "${GITHUB_ENV}" - name: configure - run: cmake -S cmake -B build -DCARLA_BUILD_FRAMEWORKS=OFF + run: cmake -S cmake -B build - name: build - run: cmake --build build -j $(sysctl -n hw.logicalcpu) + run: cmake --build build -j $(nproc) - name: install run: cmake --install build --verbose - uses: actions/upload-artifact@v3 with: - name: macos-libs + name: linux-${{ env.PACK_NAME }} path: ${{ env.DESTDIR }} - macos-frameworks: + macos: + strategy: + matrix: + include: + - frameworks: ON + - frameworks: OFF runs-on: macos-latest steps: - uses: actions/checkout@v3 - name: Set up dependencies run: | brew install cmake fluid-synth liblo libmagic libsndfile pkg-config + if [ "${{ matrix.frameworks }}" = "" ]; then + echo "PACK_NAME=frameworks" >> "${GITHUB_ENV}" + else + echo "PACK_NAME=libs" >> "${GITHUB_ENV}" + fi - name: configure - run: cmake -S cmake -B build -DCARLA_BUILD_FRAMEWORKS=ON + run: cmake -S cmake -B build -DCARLA_BUILD_FRAMEWORKS=${{ matrix.frameworks }} - name: build run: cmake --build build -j $(sysctl -n hw.logicalcpu) - name: install run: cmake --install build --verbose - uses: actions/upload-artifact@v3 with: - name: macos-frameworks + name: macos-${{ env.PACK_NAME }} path: ${{ env.DESTDIR }} mingw32-cross: - runs-on: ubuntu-22.04 + strategy: + matrix: + include: + #- container: debian:11 + - container: debian:12 + - container: ubuntu:20.04 + - container: ubuntu:22.04 + - container: ubuntu:23.10 + runs-on: ubuntu-latest + container: + image: ${{ matrix.container }} steps: - uses: actions/checkout@v3 - name: Set up dependencies run: | - sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list - sudo dpkg --add-architecture i386 - sudo apt-get update -qq - sudo apt-get install -yqq --allow-downgrades cmake libc6:i386 libgcc-s1:i386 libstdc++6:i386 binutils-mingw-w64-i686 g++-mingw-w64-i686 mingw-w64 wine-stable:i386 + dpkg --add-architecture i386 + apt-get update -qq + apt-get install -yqq cmake binutils-mingw-w64-i686 gcc g++-mingw-w64 lsb-release mingw-w64 pkg-config + if [ "$(lsb_release -si 2>/dev/null)" = "Debian" ]; then + apt-get install -yqq wine wine32 wine64 + else + apt-get install -yqq wine-stable + fi + echo "PACK_NAME=$(lsb_release -cs 2>/dev/null)" >> "${GITHUB_ENV}" - name: configure env: PKG_CONFIG: false - run: cmake -S cmake -B build \ - -DCMAKE_CROSSCOMPILING=ON \ - -DCMAKE_CROSSCOMPILING_EMULATOR=wine \ - -DCMAKE_SYSTEM_NAME=Windows \ - -DCMAKE_SYSTEM_PROCESSOR=i686 \ - -DCMAKE_C_COMPILER=i686-w64-mingw32-gcc \ - -DCMAKE_CXX_COMPILER=i686-w64-mingw32-g++ \ - -DCMAKE_RANLIB=i686-w64-mingw32-ranlib \ - -DCMAKE_AR=$(which i686-w64-mingw32-ar) + run: cmake -S cmake -B build -DCMAKE_CROSSCOMPILING=ON -DCMAKE_CROSSCOMPILING_EMULATOR=wine -DCMAKE_SYSTEM_NAME=Windows -DCMAKE_SYSTEM_PROCESSOR=i686 -DCMAKE_C_COMPILER=i686-w64-mingw32-gcc -DCMAKE_CXX_COMPILER=i686-w64-mingw32-g++ -DCMAKE_AR=/usr/bin/i686-w64-mingw32-ar -DCMAKE_C_COMPILER_AR=/usr/bin/i686-w64-mingw32-ar -DCMAKE_CXX_COMPILER_AR=/usr/bin/i686-w64-mingw32-ar -DCMAKE_RANLIB=/usr/bin/i686-w64-mingw32-ranlib -DCMAKE_C_COMPILER_RANLIB=/usr/bin/i686-w64-mingw32-ranlib -DCMAKE_CXX_COMPILER_RANLIB=/usr/bin/i686-w64-mingw32-ranlib -DCMAKE_RC_COMPILER=/usr/bin/i686-w64-mingw32-windres - name: build run: cmake --build build -j $(nproc) - name: install run: cmake --install build --verbose - uses: actions/upload-artifact@v3 with: - name: mingw32 + name: mingw32-${{ env.PACK_NAME }} path: ${{ env.DESTDIR }} mingw64-cross: - runs-on: ubuntu-22.04 + strategy: + matrix: + include: + #- container: debian:11 + - container: debian:12 + - container: ubuntu:20.04 + - container: ubuntu:22.04 + - container: ubuntu:23.10 + runs-on: ubuntu-latest + container: + image: ${{ matrix.container }} steps: - uses: actions/checkout@v3 - name: Set up dependencies run: | - sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list - sudo dpkg --add-architecture i386 - sudo apt-get update -qq - sudo apt-get install -yqq --allow-downgrades cmake libc6:i386 libgcc-s1:i386 libstdc++6:i386 binutils-mingw-w64-x86-64 g++-mingw-w64-x86-64 mingw-w64 wine-stable + dpkg --add-architecture i386 + apt-get update -qq + apt-get install -yqq cmake binutils-mingw-w64-x86-64 gcc g++-mingw-w64 lsb-release mingw-w64 pkg-config + if [ "$(lsb_release -si 2>/dev/null)" = "Debian" ]; then + apt-get install -yqq wine wine32 wine64 + else + apt-get install -yqq wine-stable + fi + echo "PACK_NAME=$(lsb_release -cs 2>/dev/null)" >> "${GITHUB_ENV}" - name: configure env: PKG_CONFIG: false - run: cmake -S cmake -B build \ - -DCMAKE_CROSSCOMPILING=ON \ - -DCMAKE_CROSSCOMPILING_EMULATOR=wine \ - -DCMAKE_SYSTEM_NAME=Windows \ - -DCMAKE_SYSTEM_PROCESSOR=x86_64 \ - -DCMAKE_C_COMPILER=x86_64-w64-mingw32-gcc \ - -DCMAKE_CXX_COMPILER=x86_64-w64-mingw32-g++ \ - -DCMAKE_RANLIB=x86_64-w64-mingw32-ranlib \ - -DCMAKE_AR=$(which x86_64-w64-mingw32-ar) - - name: build - run: cmake --build build -j $(nproc) - - name: install - run: cmake --install build --verbose - - uses: actions/upload-artifact@v3 - with: - name: mingw64 - path: ${{ env.DESTDIR }} - - ubuntu-20_04: - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v3 - - name: Set up dependencies - run: | - sudo apt-get update -qq - sudo apt-get install -yqq cmake libfluidsynth-dev liblo-dev libmagic-dev libsndfile1-dev libx11-dev pkg-config - - name: configure - run: cmake -S cmake -B build - - name: build - run: cmake --build build -j $(nproc) - - name: install - run: cmake --install build --verbose - - uses: actions/upload-artifact@v3 - with: - name: ubuntu-20.04 - path: ${{ env.DESTDIR }} - - ubuntu-22_04: - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v3 - - name: Set up dependencies - run: | - sudo apt-get update -qq - sudo apt-get install -yqq cmake libfluidsynth-dev liblo-dev libmagic-dev libsndfile1-dev libx11-dev pkg-config - - name: configure - run: cmake -S cmake -B build + run: cmake -S cmake -B build -DCMAKE_CROSSCOMPILING=ON -DCMAKE_CROSSCOMPILING_EMULATOR=wine -DCMAKE_SYSTEM_NAME=Windows -DCMAKE_SYSTEM_PROCESSOR=x86_64 -DCMAKE_C_COMPILER=x86_64-w64-mingw32-gcc -DCMAKE_CXX_COMPILER=x86_64-w64-mingw32-g++ -DCMAKE_AR=/usr/bin/x86_64-w64-mingw32-ar -DCMAKE_C_COMPILER_AR=/usr/bin/x86_64-w64-mingw32-ar -DCMAKE_CXX_COMPILER_AR=/usr/bin/x86_64-w64-mingw32-ar -DCMAKE_RANLIB=/usr/bin/x86_64-w64-mingw32-ranlib -DCMAKE_C_COMPILER_RANLIB=/usr/bin/x86_64-w64-mingw32-ranlib -DCMAKE_CXX_COMPILER_RANLIB=/usr/bin/x86_64-w64-mingw32-ranlib -DCMAKE_RC_COMPILER=/usr/bin/x86_64-w64-mingw32-windres - name: build run: cmake --build build -j $(nproc) - name: install run: cmake --install build --verbose - uses: actions/upload-artifact@v3 with: - name: ubuntu-22.04 + name: mingw64-${{ env.PACK_NAME }} path: ${{ env.DESTDIR }} windows: From 903ad4d2a8c371cd1a85db147f99654327d4bb2c Mon Sep 17 00:00:00 2001 From: falkTX Date: Sat, 23 Dec 2023 18:55:10 +0100 Subject: [PATCH 10/19] CI rework Signed-off-by: falkTX --- .github/workflows/build.yml | 74 +++++++++++++++-------------------- .github/workflows/cmake.yml | 10 ++--- .github/workflows/dpf.yml | 6 ++- .github/workflows/release.yml | 9 ++++- 4 files changed, 49 insertions(+), 50 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 761b0cac6..57b862964 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -4,39 +4,34 @@ on: [push, pull_request] env: DEBIAN_FRONTEND: noninteractive + EMSCRIPTEN_VERSION: 3.1.27 HOMEBREW_NO_AUTO_UPDATE: 1 - WITH_LTO: false + HOMEBREW_NO_INSTALL_CLEANUP: 1 jobs: - macos-11: - runs-on: macos-11 + linux: + strategy: + matrix: + include: + - target: debian:11 + - target: debian:12 + - target: ubuntu:18.04 + - target: ubuntu:20.04 + - target: ubuntu:22.04 + runs-on: ubuntu-latest + container: + image: ${{ matrix.target }} steps: - uses: actions/checkout@v3 - name: Set up dependencies run: | - brew install fluid-synth liblo libmagic libsndfile pkg-config pyqt@5 qt@5 sdl2 - - name: make features - run: make features - - name: make - run: make -j $(sysctl -n hw.logicalcpu) - - ubuntu-20_04: - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v3 - - name: Fix GitHub's mess - run: | - sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list - sudo dpkg --add-architecture i386 - sudo apt-get update -qq - sudo apt-get install -yqq --allow-downgrades libpcre2-8-0/focal libpcre2-16-0/focal libpcre2-32-0/focal libpcre2-posix2/focal - - name: Set up dependencies - run: | - sudo apt-get install -yqq libasound2-dev libfluidsynth-dev libgl1-mesa-dev liblo-dev libmagic-dev libpulse-dev libsdl2-dev libsndfile1-dev libx11-dev libxcursor-dev libxext-dev libxrandr-dev pkg-config pyqt5-dev-tools qtbase5-dev - sudo apt-get install -yqq g++-multilib libx11-6:i386 libxext6:i386 + dpkg --add-architecture i386 + apt-get update -qq + apt-get install -yqq g++-multilib libasound2-dev libfluidsynth-dev libgl1-mesa-dev liblo-dev libmagic-dev libpulse-dev libsdl2-dev libsndfile1-dev libx11-dev libxcursor-dev libxext-dev libxrandr-dev make pkg-config pyqt5-dev-tools qtbase5-dev + apt-get install -yqq libx11-6:i386 libxext6:i386 # Fix 32bit bridge build - sudo ln -s /usr/lib/i386-linux-gnu/libX11.so.6 /usr/lib/i386-linux-gnu/libX11.so - sudo ln -s /usr/lib/i386-linux-gnu/libXext.so.6 /usr/lib/i386-linux-gnu/libXext.so + ln -s /usr/lib/i386-linux-gnu/libX11.so.6 /usr/lib/i386-linux-gnu/libX11.so + ln -s /usr/lib/i386-linux-gnu/libXext.so.6 /usr/lib/i386-linux-gnu/libXext.so - name: make features run: make features - name: make @@ -44,34 +39,27 @@ jobs: - name: make posix32 run: make posix32 -j $(nproc) - ubuntu-22_04: - runs-on: ubuntu-22.04 + macos: + strategy: + matrix: + include: + #- target: macos-11 + - target: macos-12 + runs-on: ${{ matrix.target }} steps: - uses: actions/checkout@v3 - - name: Fix GitHub's mess - run: | - sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list - sudo dpkg --add-architecture i386 - sudo apt-get update -qq - sudo apt-get install -yqq --allow-downgrades libc6:i386 libgcc-s1:i386 libstdc++6:i386 + with: + submodules: recursive - name: Set up dependencies run: | - sudo apt-get install -yqq libasound2-dev libfluidsynth-dev libgl1-mesa-dev liblo-dev libmagic-dev libpulse-dev libsdl2-dev libsndfile1-dev libx11-dev libxcursor-dev libxext-dev libxrandr-dev pkg-config pyqt5-dev-tools qtbase5-dev - sudo apt-get install -yqq g++-multilib libx11-6:i386 libxext6:i386 - # Fix 32bit bridge build - sudo ln -s /usr/lib/i386-linux-gnu/libX11.so.6 /usr/lib/i386-linux-gnu/libX11.so - sudo ln -s /usr/lib/i386-linux-gnu/libXext.so.6 /usr/lib/i386-linux-gnu/libXext.so + brew install fluid-synth liblo libmagic libsndfile pkg-config pyqt@5 qt@5 sdl2 - name: make features run: make features - name: make - run: make -j $(nproc) - - name: make posix32 - run: make posix32 -j $(nproc) + run: make -j $(sysctl -n hw.logicalcpu) wasm: runs-on: ubuntu-22.04 - env: - EMSCRIPTEN_VERSION: 3.1.27 steps: - uses: actions/checkout@v3 with: diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 562756923..f9d20b793 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -12,7 +12,7 @@ jobs: include: - container: debian:11 - container: debian:12 - - container: ubuntu:20.04 + #- container: ubuntu:20.04 - container: ubuntu:22.04 - container: ubuntu:23.10 runs-on: ubuntu-latest @@ -68,9 +68,9 @@ jobs: strategy: matrix: include: - #- container: debian:11 + - container: debian:11 - container: debian:12 - - container: ubuntu:20.04 + #- container: ubuntu:20.04 - container: ubuntu:22.04 - container: ubuntu:23.10 runs-on: ubuntu-latest @@ -106,9 +106,9 @@ jobs: strategy: matrix: include: - #- container: debian:11 + - container: debian:11 - container: debian:12 - - container: ubuntu:20.04 + #- container: ubuntu:20.04 - container: ubuntu:22.04 - container: ubuntu:23.10 runs-on: ubuntu-latest diff --git a/.github/workflows/dpf.yml b/.github/workflows/dpf.yml index fb184d617..ad12f0db7 100644 --- a/.github/workflows/dpf.yml +++ b/.github/workflows/dpf.yml @@ -2,6 +2,10 @@ name: dpf on: [push, pull_request] +env: + PAWPAW_SKIP_LTO: 1 + PAWPAW_SKIP_TESTS: 1 + jobs: linux: strategy: @@ -22,7 +26,7 @@ jobs: macos: strategy: matrix: - target: [macos-intel, macos-universal] + target: [macos-intel, macos-universal, macos-universal-10.15] runs-on: macos-11 steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0ab65ebe6..2647f4a9f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,8 +4,12 @@ on: [push, pull_request] env: CACHE_VERSION: 1 + DEBIAN_FRONTEND: noninteractive + HOMEBREW_NO_AUTO_UPDATE: 1 + HOMEBREW_NO_INSTALL_CLEANUP: 1 PAWPAW_SKIP_LTO: 1 - PAWPAW_VERSION: cd7b760d6a32ecad263b112c12be8a306ed1e89c + PAWPAW_SKIP_TESTS: 1 + PAWPAW_VERSION: 9534e2b4f9bafc993e05fada89b824f3a2176708 jobs: # macOS native universal build @@ -29,6 +33,7 @@ jobs: run: | git clone https://github.com/DISTRHO/PawPaw.git git -C PawPaw checkout ${{ env.PAWPAW_VERSION }} + ./PawPaw/.github/workflows/bootstrap-deps.sh macos-universal ./PawPaw/bootstrap-carla.sh macos-universal && ./PawPaw/.cleanup.sh macos-universal - name: Build macOS universal shell: bash @@ -92,6 +97,7 @@ jobs: run: | git clone https://github.com/DISTRHO/PawPaw.git git -C PawPaw checkout ${{ env.PAWPAW_VERSION }} + ./PawPaw/.github/workflows/bootstrap-deps.sh win32 ./PawPaw/bootstrap-carla.sh win32 && ./PawPaw/.cleanup.sh win32 - name: Build win32 cross-compiled shell: bash @@ -155,6 +161,7 @@ jobs: run: | git clone https://github.com/DISTRHO/PawPaw.git git -C PawPaw checkout ${{ env.PAWPAW_VERSION }} + ./PawPaw/.github/workflows/bootstrap-deps.sh win64 ./PawPaw/bootstrap-carla.sh win64 && ./PawPaw/.cleanup.sh win64 - name: Build win64 cross-compiled shell: bash From 81ad428b85bccc9c242efd319bd9accb6038182d Mon Sep 17 00:00:00 2001 From: falkTX Date: Sat, 23 Dec 2023 23:45:46 +0100 Subject: [PATCH 11/19] Enable all dpf CI targets Signed-off-by: falkTX --- .github/workflows/dpf.yml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/dpf.yml b/.github/workflows/dpf.yml index ad12f0db7..7f36bda57 100644 --- a/.github/workflows/dpf.yml +++ b/.github/workflows/dpf.yml @@ -10,8 +10,7 @@ jobs: linux: strategy: matrix: - target: [linux-x86_64] - # linux-arm64, linux-armhf, linux-i686, linux-riscv64 + target: [linux-arm64, linux-armhf, linux-i686, linux-riscv64, linux-x86_64] runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v3 @@ -58,15 +57,16 @@ jobs: pawpaw: true release: false - # pluginval: - # runs-on: ubuntu-20.04 - # steps: - # - uses: actions/checkout@v3 - # with: - # submodules: recursive - # - uses: distrho/dpf-makefile-action@v1 - # with: - # target: pluginval + pluginval: + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v3 + with: + submodules: recursive + - uses: distrho/dpf-makefile-action@v1 + with: + target: pluginval + pawpaw: true source: runs-on: ubuntu-20.04 From 7f75c5a3698cd223a667d3eae5c6b6611264e03f Mon Sep 17 00:00:00 2001 From: falkTX Date: Sun, 24 Dec 2023 00:30:41 +0100 Subject: [PATCH 12/19] Tweaks to make ttl validators happy Signed-off-by: falkTX --- .github/workflows/dpf.yml | 4 +++- source/plugin/carla-lv2-export.cpp | 32 ++++++++++++++++++++---------- 2 files changed, 25 insertions(+), 11 deletions(-) diff --git a/.github/workflows/dpf.yml b/.github/workflows/dpf.yml index 7f36bda57..954381060 100644 --- a/.github/workflows/dpf.yml +++ b/.github/workflows/dpf.yml @@ -10,7 +10,9 @@ jobs: linux: strategy: matrix: - target: [linux-arm64, linux-armhf, linux-i686, linux-riscv64, linux-x86_64] + target: [linux-x86_64] + # TODO: add PawPaw bootstrap type + # linux-arm64, linux-armhf, linux-i686, linux-riscv64, runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v3 diff --git a/source/plugin/carla-lv2-export.cpp b/source/plugin/carla-lv2-export.cpp index b64df5482..72c9a5129 100644 --- a/source/plugin/carla-lv2-export.cpp +++ b/source/plugin/carla-lv2-export.cpp @@ -118,6 +118,7 @@ static void writeManifestFile(PluginListManager& plm, const uint32_t microVersio text += "@prefix atom: <" LV2_ATOM_PREFIX "> .\n"; text += "@prefix doap: .\n"; text += "@prefix foaf: .\n"; + text += "@prefix idpy: .\n"; text += "@prefix lv2: <" LV2_CORE_PREFIX "> .\n"; text += "@prefix mod: .\n"; text += "@prefix opts: <" LV2_OPTIONS_PREFIX "> .\n"; @@ -143,6 +144,17 @@ static void writeManifestFile(PluginListManager& plm, const uint32_t microVersio text += " lv2:symbol \"carla\" .\n"; text += "\n"; + // ------------------------------------------------------------------- + // Extensions + + text += "idpy:interface\n"; + text += " a lv2:ExtensionData .\n"; + text += "\n"; + + text += "idpy:queue_draw\n"; + text += " a lv2:Feature .\n"; + text += "\n"; + // ------------------------------------------------------------------- // Plugins @@ -291,28 +303,28 @@ static void writePluginFile(const NativePluginDescriptor* const pluginDesc, switch (pluginDesc->category) { case NATIVE_PLUGIN_CATEGORY_SYNTH: - text += " a lv2:InstrumentPlugin, lv2:Plugin ;\n"; + text += " a lv2:InstrumentPlugin, lv2:Plugin, doap:Project ;\n"; break; case NATIVE_PLUGIN_CATEGORY_DELAY: - text += " a lv2:DelayPlugin, lv2:Plugin ;\n"; + text += " a lv2:DelayPlugin, lv2:Plugin, doap:Project ;\n"; break; case NATIVE_PLUGIN_CATEGORY_EQ: - text += " a lv2:EQPlugin, lv2:Plugin ;\n"; + text += " a lv2:EQPlugin, lv2:Plugin, doap:Project ;\n"; break; case NATIVE_PLUGIN_CATEGORY_FILTER: - text += " a lv2:FilterPlugin, lv2:Plugin ;\n"; + text += " a lv2:FilterPlugin, lv2:Plugin, doap:Project ;\n"; break; case NATIVE_PLUGIN_CATEGORY_DYNAMICS: - text += " a lv2:DynamicsPlugin, lv2:Plugin ;\n"; + text += " a lv2:DynamicsPlugin, lv2:Plugin, doap:Project ;\n"; break; case NATIVE_PLUGIN_CATEGORY_MODULATOR: - text += " a lv2:ModulatorPlugin, lv2:Plugin ;\n"; + text += " a lv2:ModulatorPlugin, lv2:Plugin, doap:Project ;\n"; break; case NATIVE_PLUGIN_CATEGORY_UTILITY: - text += " a lv2:UtilityPlugin, lv2:Plugin ;\n"; + text += " a lv2:UtilityPlugin, lv2:Plugin, doap:Project ;\n"; break; default: - text += " a lv2:Plugin ;\n"; + text += " a lv2:Plugin, doap:Project ;\n"; break; } @@ -325,7 +337,7 @@ static void writePluginFile(const NativePluginDescriptor* const pluginDesc, if (pluginDesc->hints & NATIVE_PLUGIN_IS_RTSAFE) text += " lv2:optionalFeature <" LV2_CORE__hardRTCapable "> ;\n"; if (pluginDesc->hints & NATIVE_PLUGIN_HAS_INLINE_DISPLAY) - text += " lv2:optionalFeature <" LV2_INLINEDISPLAY__queue_draw "> ;\n"; + text += " lv2:optionalFeature idpy:queue_draw ;\n"; if ((pluginDesc->hints & NATIVE_PLUGIN_USES_STATE) || (pluginDesc->hints & NATIVE_PLUGIN_NEEDS_UI_OPEN_SAVE)) text += " lv2:optionalFeature <" LV2_STATE__threadSafeRestore "> ;\n"; text += "\n"; @@ -358,7 +370,7 @@ static void writePluginFile(const NativePluginDescriptor* const pluginDesc, text += " lv2:extensionData <" LV2_WORKER__interface "> ;\n"; if (pluginDesc->hints & NATIVE_PLUGIN_HAS_INLINE_DISPLAY) - text += " lv2:extensionData <" LV2_INLINEDISPLAY__interface "> ;\n"; + text += " lv2:extensionData idpy:interface ;\n"; text += "\n"; From 20e20b6e17183ea029ae509f666f4537e00346ae Mon Sep 17 00:00:00 2001 From: falkTX Date: Sun, 24 Dec 2023 00:34:38 +0100 Subject: [PATCH 13/19] Tag MIDI plugins as lv2:MIDIPlugin Signed-off-by: falkTX --- source/plugin/carla-lv2-export.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source/plugin/carla-lv2-export.cpp b/source/plugin/carla-lv2-export.cpp index 72c9a5129..78c585297 100644 --- a/source/plugin/carla-lv2-export.cpp +++ b/source/plugin/carla-lv2-export.cpp @@ -324,7 +324,10 @@ static void writePluginFile(const NativePluginDescriptor* const pluginDesc, text += " a lv2:UtilityPlugin, lv2:Plugin, doap:Project ;\n"; break; default: - text += " a lv2:Plugin, doap:Project ;\n"; + if (pluginDesc->midiIns >= 1 && pluginDesc->midiOuts >= 1 && pluginDesc->audioIns + pluginDesc->audioOuts == 0) + text += " a lv2:MIDIPlugin, lv2:Plugin, doap:Project ;\n"; + else + text += " a lv2:Plugin, doap:Project ;\n"; break; } From 80ef8ae4675c92b86ee29611c9e77f2fe2724dda Mon Sep 17 00:00:00 2001 From: falkTX Date: Sun, 24 Dec 2023 00:47:40 +0100 Subject: [PATCH 14/19] More lv2 ttl fixups Signed-off-by: falkTX --- source/plugin/carla-lv2-export.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/plugin/carla-lv2-export.cpp b/source/plugin/carla-lv2-export.cpp index 78c585297..c486b20fb 100644 --- a/source/plugin/carla-lv2-export.cpp +++ b/source/plugin/carla-lv2-export.cpp @@ -130,7 +130,7 @@ static void writeManifestFile(PluginListManager& plm, const uint32_t microVersio // Project text += "\n"; - text += " a lv2:Project ;\n"; + text += " a lv2:Project, doap:Project ;\n"; text += " doap:homepage ;\n"; text += " doap:maintainer [\n"; text += " foaf:homepage ;\n"; @@ -283,6 +283,7 @@ static void writePluginFile(const NativePluginDescriptor* const pluginDesc, text += "@prefix atom: <" LV2_ATOM_PREFIX "> .\n"; text += "@prefix doap: .\n"; text += "@prefix foaf: .\n"; + text += "@prefix idpy: .\n"; text += "@prefix lv2: <" LV2_CORE_PREFIX "> .\n"; text += "@prefix opts: <" LV2_OPTIONS_PREFIX "> .\n"; text += "@prefix patch: <" LV2_PATCH_PREFIX "> .\n"; From c2031edc1c82c3e760394b6363627caf25a7c256 Mon Sep 17 00:00:00 2001 From: falkTX Date: Sun, 24 Dec 2023 01:16:31 +0100 Subject: [PATCH 15/19] Add owl:Class to carla as lv2 project Signed-off-by: falkTX --- source/plugin/carla-lv2-export.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/plugin/carla-lv2-export.cpp b/source/plugin/carla-lv2-export.cpp index c486b20fb..752f26c8c 100644 --- a/source/plugin/carla-lv2-export.cpp +++ b/source/plugin/carla-lv2-export.cpp @@ -130,7 +130,7 @@ static void writeManifestFile(PluginListManager& plm, const uint32_t microVersio // Project text += "\n"; - text += " a lv2:Project, doap:Project ;\n"; + text += " a owl:Ontology, lv2:Project, doap:Project ;\n"; text += " doap:homepage ;\n"; text += " doap:maintainer [\n"; text += " foaf:homepage ;\n"; From 46792aaa457c0247e1479392c1e9128502c1ba15 Mon Sep 17 00:00:00 2001 From: falkTX Date: Tue, 2 Jan 2024 19:53:37 +0100 Subject: [PATCH 16/19] Fix winevst for DLL_PROCESS_ATTACH Signed-off-by: falkTX --- source/plugin/carla-vst-export-bridged.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/plugin/carla-vst-export-bridged.cpp b/source/plugin/carla-vst-export-bridged.cpp index 14d53b60c..219f4aebd 100644 --- a/source/plugin/carla-vst-export-bridged.cpp +++ b/source/plugin/carla-vst-export-bridged.cpp @@ -43,7 +43,8 @@ static HINSTANCE getCurrentModuleInstanceHandle() noexcept CARLA_PLUGIN_EXPORT BOOL WINAPI DllMain(HINSTANCE hInst, DWORD, LPVOID) { - currentModuleHandle = hInst; + if (reason == DLL_PROCESS_ATTACH) + currentModuleHandle = hInst; return 1; } From 73ddea269b927770a338d352a0d0db20aad87624 Mon Sep 17 00:00:00 2001 From: falkTX Date: Tue, 2 Jan 2024 20:11:59 +0100 Subject: [PATCH 17/19] Fix potential wrong-over-optimization in math utilities Signed-off-by: falkTX --- source/utils/CarlaMathUtils.hpp | 6 +++--- source/utils/CarlaUtils.hpp | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/source/utils/CarlaMathUtils.hpp b/source/utils/CarlaMathUtils.hpp index 7fdd55ab9..9867ea607 100644 --- a/source/utils/CarlaMathUtils.hpp +++ b/source/utils/CarlaMathUtils.hpp @@ -179,7 +179,7 @@ void carla_addFloats(float dest[], const float src[], const std::size_t count) n if (!std::isfinite(src[i])) __builtin_unreachable(); #endif - *dest++ += *src++; + dest[i] += src[i]; } } @@ -217,7 +217,7 @@ void carla_fillFloatsWithSingleValue(float data[], const float& value, const std if (!std::isfinite(data[i])) __builtin_unreachable(); #endif - *data++ = value; + data[i] = value; } } } @@ -302,7 +302,7 @@ void carla_multiply(float data[], const float& multiplier, const std::size_t cou if (!std::isfinite(data[i])) __builtin_unreachable(); #endif - *data++ *= multiplier; + data[i] *= multiplier; } } } diff --git a/source/utils/CarlaUtils.hpp b/source/utils/CarlaUtils.hpp index 9b563aa96..7346b5117 100644 --- a/source/utils/CarlaUtils.hpp +++ b/source/utils/CarlaUtils.hpp @@ -406,7 +406,7 @@ void carla_add(T dest[], const T src[], const std::size_t count) noexcept CARLA_SAFE_ASSERT_RETURN(count > 0,); for (std::size_t i=0; i 0,); for (std::size_t i=0; i 0,); for (std::size_t i=0; i Date: Tue, 2 Jan 2024 20:36:41 +0100 Subject: [PATCH 18/19] Fix carla.lv2 ttl validation Signed-off-by: falkTX --- .github/workflows/dpf.yml | 24 ++++++++++++++---------- source/plugin/carla-lv2-export.cpp | 3 ++- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/.github/workflows/dpf.yml b/.github/workflows/dpf.yml index 954381060..d42a72ea7 100644 --- a/.github/workflows/dpf.yml +++ b/.github/workflows/dpf.yml @@ -59,16 +59,20 @@ jobs: pawpaw: true release: false - pluginval: - runs-on: ubuntu-20.04 - steps: - - uses: actions/checkout@v3 - with: - submodules: recursive - - uses: distrho/dpf-makefile-action@v1 - with: - target: pluginval - pawpaw: true + # NOTE disabled for now + # lv2lint does not allow to differentiate exposed features for multiple plugins in a single binary + # (e.g. plugin A uses worker while plugin B does not, but they come from the same binary) + # see https://github.com/falkTX/Carla/actions/runs/7389992205/job/20103997236 + #pluginval: + #runs-on: ubuntu-20.04 + #steps: + #- uses: actions/checkout@v3 + #with: + #submodules: recursive + #- uses: distrho/dpf-makefile-action@v1 + #with: + #target: pluginval + #pawpaw: true source: runs-on: ubuntu-20.04 diff --git a/source/plugin/carla-lv2-export.cpp b/source/plugin/carla-lv2-export.cpp index 752f26c8c..f2bed64d7 100644 --- a/source/plugin/carla-lv2-export.cpp +++ b/source/plugin/carla-lv2-export.cpp @@ -122,6 +122,7 @@ static void writeManifestFile(PluginListManager& plm, const uint32_t microVersio text += "@prefix lv2: <" LV2_CORE_PREFIX "> .\n"; text += "@prefix mod: .\n"; text += "@prefix opts: <" LV2_OPTIONS_PREFIX "> .\n"; + text += "@prefix owl: .\n"; text += "@prefix rdfs: .\n"; text += "@prefix ui: <" LV2_UI_PREFIX "> .\n"; text += "\n"; @@ -130,7 +131,7 @@ static void writeManifestFile(PluginListManager& plm, const uint32_t microVersio // Project text += "\n"; - text += " a owl:Ontology, lv2:Project, doap:Project ;\n"; + text += " a owl:Ontology, doap:Project ;\n"; text += " doap:homepage ;\n"; text += " doap:maintainer [\n"; text += " foaf:homepage ;\n"; From 84e2e0a4beee64297e3e33c9cb58448cb2fdbd73 Mon Sep 17 00:00:00 2001 From: falkTX Date: Fri, 5 Jan 2024 13:26:40 +0100 Subject: [PATCH 19/19] Always activate VST3 buses, regardless of default flags Signed-off-by: falkTX --- source/backend/plugin/CarlaPluginVST3.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/source/backend/plugin/CarlaPluginVST3.cpp b/source/backend/plugin/CarlaPluginVST3.cpp index 0cf210879..b6d62ef39 100644 --- a/source/backend/plugin/CarlaPluginVST3.cpp +++ b/source/backend/plugin/CarlaPluginVST3.cpp @@ -2003,10 +2003,8 @@ public: const int32_t numChannels = busInfo.channel_count; CARLA_SAFE_ASSERT_BREAK(numChannels >= 0); - if ((busInfo.flags & V3_DEFAULT_ACTIVE) == 0x0) { - CARLA_SAFE_ASSERT_BREAK(v3_cpp_obj(fV3.component)->activate_bus(fV3.component, - V3_AUDIO, V3_INPUT, b, true) == V3_OK); - } + CARLA_SAFE_ASSERT_BREAK(v3_cpp_obj(fV3.component)->activate_bus(fV3.component, + V3_AUDIO, V3_INPUT, b, true) == V3_OK); fBuses.inputs[b].num_channels = numChannels; fBuses.inputInfo[b].bus_type = busInfo.bus_type; @@ -2031,10 +2029,8 @@ public: const int32_t numChannels = busInfo.channel_count; CARLA_SAFE_ASSERT_BREAK(numChannels >= 0); - if ((busInfo.flags & V3_DEFAULT_ACTIVE) == 0x0) { - CARLA_SAFE_ASSERT_BREAK(v3_cpp_obj(fV3.component)->activate_bus(fV3.component, - V3_AUDIO, V3_OUTPUT, b, true) == V3_OK); - } + CARLA_SAFE_ASSERT_BREAK(v3_cpp_obj(fV3.component)->activate_bus(fV3.component, + V3_AUDIO, V3_OUTPUT, b, true) == V3_OK); fBuses.outputs[b].num_channels = numChannels; fBuses.outputInfo[b].bus_type = busInfo.bus_type;