diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4c1e073..bf8c6bf 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -175,6 +175,21 @@ jobs: path: | *.tar.gz + linux-x86_64-headless: + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v2 + with: + submodules: recursive + - name: Set up dependencies + run: | + sudo apt-get update -qq + sudo apt-get install -yqq libasound2-dev libgl1-mesa-dev liblo-dev libpulse-dev libx11-dev libxcursor-dev libxext-dev libxrandr-dev + - name: Build linux x86_64 (headless) + run: | + make features + make HEADLESS=true -j $(nproc) + linux-x86_64-sysdeps: runs-on: ubuntu-20.04 steps: diff --git a/Makefile b/Makefile index 30f147c..9b08c6e 100644 --- a/Makefile +++ b/Makefile @@ -65,6 +65,13 @@ ifneq ($(HAVE_XRANDR),true) $(warning Xrandr dependency not installed/available) endif +else + +CARLA_EXTRA_ARGS += HAVE_OPENGL=false +CARLA_EXTRA_ARGS += HAVE_X11=false +CARLA_EXTRA_ARGS += HAVE_XEXT=false +CARLA_EXTRA_ARGS += HAVE_XRANDR=false + endif endif diff --git a/plugins/Cardinal/res/Ildaeil.svg b/plugins/Cardinal/res/Ildaeil.svg new file mode 100644 index 0000000..7120e1c --- /dev/null +++ b/plugins/Cardinal/res/Ildaeil.svg @@ -0,0 +1,128 @@ + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + diff --git a/plugins/Cardinal/src/Ildaeil.cpp b/plugins/Cardinal/src/Ildaeil.cpp index b3bb020..36c6c37 100644 --- a/plugins/Cardinal/src/Ildaeil.cpp +++ b/plugins/Cardinal/src/Ildaeil.cpp @@ -15,10 +15,13 @@ * For a full copy of the GNU General Public License see the LICENSE file. */ -#include "ImGuiWidget.hpp" #include "plugincontext.hpp" -#include "extra/ScopedPointer.hpp" -#include "extra/Thread.hpp" + +#ifndef HEADLESS +# include "ImGuiWidget.hpp" +# include "extra/ScopedPointer.hpp" +# include "extra/Thread.hpp" +#endif #include "CarlaNativePlugin.h" #include "CarlaBackendUtils.hpp" @@ -350,6 +353,7 @@ static intptr_t host_dispatcher(const NativeHostHandle handle, const NativeHostD // -------------------------------------------------------------------------------------------------------------------- +#ifndef HEADLESS struct IldaeilWidget : ImGuiWidget, Thread { static constexpr const uint kButtonHeight = 20; @@ -1168,6 +1172,11 @@ struct IldaeilModuleWidget : ModuleWidget { addOutput(createOutput(Vec(3, 54 + 90), module, IldaeilModule::OUTPUT2)); } }; +#else +static void host_ui_parameter_changed(NativeHostHandle, uint32_t, float) {} +static const char* host_ui_open_file(NativeHostHandle, bool, const char*, const char*) { return nullptr; } +typedef ModuleWidget IldaeilModuleWidget; +#endif // -------------------------------------------------------------------------------------------------------------------- diff --git a/plugins/Cardinal/src/glBars.cpp b/plugins/Cardinal/src/glBars.cpp index 485d44e..2d2aed3 100644 --- a/plugins/Cardinal/src/glBars.cpp +++ b/plugins/Cardinal/src/glBars.cpp @@ -82,17 +82,12 @@ struct glBarsRendererWidget : OpenGlWidget { glBars->state.Render(); } }; -#endif struct glBarsWidget : ModuleWidget { -#ifndef HEADLESS glBarsRendererWidget* const glBarsRenderer; -#endif glBarsWidget(glBarsModule* const module) -#ifndef HEADLESS : glBarsRenderer(new glBarsRendererWidget(module)) -#endif { setModule(module); setPanel(APP->window->loadSvg(asset::plugin(pluginInstance, "res/glBars.svg"))); @@ -102,14 +97,15 @@ struct glBarsWidget : ModuleWidget { addChild(createWidget(Vec(RACK_GRID_WIDTH, 0))); addChild(createWidget(Vec(RACK_GRID_WIDTH, RACK_GRID_HEIGHT - RACK_GRID_WIDTH))); -#ifndef HEADLESS glBarsRenderer->box.pos = Vec(2 * RACK_GRID_WIDTH, 0); glBarsRenderer->box.size = Vec(box.size.x - 2 * RACK_GRID_WIDTH, box.size.y); addChild(glBarsRenderer); -#endif addInput(createInput(Vec(3, 54), module, glBarsModule::IN1_INPUT)); } }; +#else +typedef ModuleWidget glBarsWidget; +#endif Model* modelGlBars = createModel("glBars"); diff --git a/plugins/Makefile b/plugins/Makefile index 7db60b0..27e1cf0 100644 --- a/plugins/Makefile +++ b/plugins/Makefile @@ -177,8 +177,16 @@ PLUGIN_FILES = plugins.cpp # -------------------------------------------------------------- # Cardinal (built-in) -PLUGIN_FILES += $(wildcard Cardinal/src/*.cpp) -PLUGIN_FILES += $(wildcard Cardinal/src/*/*.cpp) +PLUGIN_FILES += Cardinal/src/Carla.cpp +PLUGIN_FILES += Cardinal/src/glBars.cpp +PLUGIN_FILES += Cardinal/src/HostParameters.cpp +PLUGIN_FILES += Cardinal/src/HostTime.cpp +PLUGIN_FILES += Cardinal/src/Ildaeil.cpp + +ifneq ($(HEADLESS),true) +PLUGIN_FILES += Cardinal/src/ImGuiWidget.cpp +PLUGIN_FILES += $(wildcard Cardinal/src/DearImGui/*.cpp) +endif ifneq ($(NOPLUGINS),true) # --------------------------------------------------------------