From 20c999ef218dfcc403fc4c42db677909f4e7a244 Mon Sep 17 00:00:00 2001 From: Armin Date: Thu, 1 Oct 2026 00:36:37 +0200 Subject: [PATCH] build for Linux: disable JUCE web browser (no gtk.h), vst3-only, linux install --- CMakeLists.txt | 15 ++++++++++++++- Makefile | 34 ++++++++++++++++++++++++++-------- README.md | 24 ++++++++++++++++++++---- 3 files changed, 60 insertions(+), 13 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 64bf2c6..b5ce8d5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -68,6 +68,19 @@ endif() add_subdirectory(${JUCE_ROOT} juce) +# RMX-19 has no web view. juce_audio_processors depends on juce_gui_extra, whose +# Linux source includes and the WebKit headers unless the browser +# component is switched off. Disabling it keeps the Linux build free of GTK and +# WebKit (and of native file-chooser dialogs, which this plug-in never uses). +add_compile_definitions(JUCE_WEB_BROWSER=0) + +# AU is only buildable on Apple; on Linux (and everywhere else) ship VST3. +if(APPLE) + set(RMX19_FORMATS AU VST3) +else() + set(RMX19_FORMATS VST3) +endif() + juce_add_plugin(RMX19 PRODUCT_NAME "RMX-19" PLUGIN_NAME "RMX-19" @@ -79,7 +92,7 @@ juce_add_plugin(RMX19 DESCRIPTION "19 inch rack digital sound module" PLUGIN_MANUFACTURER_CODE "Rmlb" PLUGIN_CODE "Rmx1" - FORMATS AU VST3 + FORMATS ${RMX19_FORMATS} IS_SYNTH TRUE NEEDS_MIDI_INPUT TRUE EDITOR_WANTS_KEYBOARD_FOCUS TRUE diff --git a/Makefile b/Makefile index ffc6863..6196e66 100644 --- a/Makefile +++ b/Makefile @@ -1,13 +1,14 @@ -# RMX-19 build & install Makefile (macOS arm64) +# RMX-19 build & install Makefile (macOS arm64 and Linux) # -# make configure + build VST3 and AU (Release, arm64) -# make install build, codesign (ad-hoc), install into ~/Library/Audio/Plug-Ins, -# strip the quarantine attribute from the installed bundles +# make configure + build (VST3 everywhere; AU additionally on macOS) +# make install build and install the VST3 (and AU on macOS). macOS bundles +# are ad-hoc codesigned and de-quarantined; on Linux the plug-in +# is copied to ~/.vst3 # make uninstall remove installed bundles # make clean delete the CMake build tree # -# Note: after install, restart (or cold-start) the audio host so macOS rescans -# AudioComponents. A fresh AU/AUv3 may first appear after a host relaunch. +# Note (macOS): after install, restart (or cold-start) the audio host so it +# rescans AudioComponents. A fresh AU/AUv3 may first appear after a host relaunch. BUILD_DIR ?= build CONFIG ?= Release @@ -24,10 +25,18 @@ JUCE_TAG := 8.0.4 VST3_SRC := $(ARTEFACTS)/VST3/$(PLUGIN_BASE).vst3 AU_SRC := $(ARTEFACTS)/AU/$(PLUGIN_BASE).component +UNAME_S := $(shell uname -s) + +ifeq ($(UNAME_S),Darwin) VST3_DEST := $(HOME)/Library/Audio/Plug-Ins/VST3/$(PLUGIN_BASE).vst3 AU_DEST := $(HOME)/Library/Audio/Plug-Ins/Components/$(PLUGIN_BASE).component - USER_PLUGIN_DIRS := $(HOME)/Library/Audio/Plug-Ins/VST3 $(HOME)/Library/Audio/Plug-Ins/Components +else +# Linux/BSD: the VST3 SDK scans ~/.vst3 by default. No AU, no codesigning. +VST3_DEST := $(HOME)/.vst3/$(PLUGIN_BASE).vst3 +AU_DEST := +USER_PLUGIN_DIRS := $(HOME)/.vst3 +endif .EXPORT_ALL_VARIABLES: CMAKE_BUILD_TYPE := $(CONFIG) @@ -52,6 +61,7 @@ juce: configure: juce $(CMAKE) -S . -B $(BUILD_DIR) -DCMAKE_BUILD_TYPE=$(CONFIG) -DJUCE_ROOT=$(JUCE_DIR) +ifeq ($(UNAME_S),Darwin) install: build @codesign --force --deep --sign - "$(VST3_SRC)" >/dev/null 2>&1 || true @codesign --force --deep --sign - "$(AU_SRC)" >/dev/null 2>&1 || true @@ -68,10 +78,18 @@ install: build @codesign -dv "$(VST3_DEST)" 2>&1 | head -1 @echo "" @echo "Restart your DAW / AudioHost to make the AU rescan." +else +install: build + @mkdir -p $(USER_PLUGIN_DIRS) + @rm -rf "$(VST3_DEST)" + @cp -Rf "$(VST3_SRC)" "$(USER_PLUGIN_DIRS)/" + @echo "installed:" + @echo " $(VST3_DEST)" +endif uninstall: @rm -rf "$(VST3_DEST)" "$(AU_DEST)" - @echo "removed RMX-19 from user Audio Plug-Ins." + @echo "removed RMX-19 from user plug-in folder(s)." clean: @rm -rf $(BUILD_DIR) diff --git a/README.md b/README.md index 800b88f..3dbace0 100644 --- a/README.md +++ b/README.md @@ -206,24 +206,40 @@ the host map onto the factory bank. ### Prerequisites -- macOS on Apple Silicon (arm64), macOS 12.0 or later +macOS on Apple Silicon (arm64), macOS 12.0 or later: + - CMake ≥ 3.22 - A C++17 compiler (Apple Clang via Xcode / Command Line Tools) - `git` (to fetch the JUCE framework) +Linux: + +- CMake ≥ 3.22, a C++17 compiler (GCC or Clang), `git`, `pkg-config` +- Development packages used by JUCE (Debian/Ubuntu): + `libasound2-dev libx11-dev libxext-dev libxinerama-dev libxrandr-dev` + `libxcursor-dev libxcomposite-dev libfreetype6-dev libfontconfig1-dev + libcurl4-openssl-dev libgl1-mesa-dev` +- No GTK/WebKit packages are needed: the plug-in does not use the web browser, + native file-chooser dialogs, or ``. + The build fetches **JUCE 8.0.4** automatically into `build/JUCE` on first configure - no manual JUCE setup is required. ### Commands ```sh -make # configure + build VST3 and AU (Release, arm64) -make install # build, ad-hoc codesign, and install into ~/Library/Audio/Plug-Ins +make # configure + build VST3 (and AU on macOS) +make install # build + install (~/Library/Audio/Plug-Ins on macOS, ~/.vst3 on Linux) make uninstall # remove installed bundles -make clean # delete the build tree (and the fetched JUCE) +make clean # delete the CMake build tree make info # print build paths ``` +On Linux the AU format is skipped automatically; only the VST3 is produced, and +`make install` copies it to `~/.vst3` (JUCE's default Linux VST3 scan path). +A plain `cmake -S . -B build -DJUCE_ROOT= && cmake --build build` +works on Linux as well. + `make` (configure) is designed to be cheap when nothing changed and refreshes the git branch/hash and timestamp embedded in the LCD footer on every configure, so the About screen always reflects the current source state.