From b72d0964dd33b9084a0fc02d7fb365850c5606c6 Mon Sep 17 00:00:00 2001 From: Peter Newman Date: Wed, 6 Mar 2019 13:36:22 +0000 Subject: Add Travis CI (#15) * Add and enable Travis CI builds * Add build status to readme --- .travis.yml | 170 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 170 insertions(+) create mode 100644 .travis.yml (limited to '.travis.yml') diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..1b7c2e2 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,170 @@ +language: c +# Use the latest Travis images since they are more up to date than the stable release. +group: edge + +before_script: + - export -f travis_fold + +script: + - "bash -ex .travis-ci.sh" + +addons: + apt: + packages: &base_build + # This is the absolute minimum for configure to pass + # Non C++ based tasks use it so they can run make builtfiles + - ccache + packages: &core_build + # This is all the bits we need to enable all options + - *base_build + - libasound2-dev + - libevdev-dev + packages: &core_build_gpp_latest + - *core_build + - gcc-8 + packages: &core_build_clang_latest + - *core_build + - clang-6.0 + +matrix: + fast_finish: true + include: + - os: osx + osx_image: xcode10.2 + compiler: clang + env: + - TASK='compile' + - os: osx + osx_image: xcode10.2 + compiler: gcc + env: + - TASK='compile' + - os: osx + osx_image: xcode10.2 + compiler: clang + env: + - TASK='sanitize' + - os: linux + dist: xenial + compiler: clang + env: TASK='compile' + addons: + apt: + packages: + - *core_build_clang_latest + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-xenial-6.0 + - os: linux + dist: xenial + compiler: gcc + env: TASK='compile' + addons: + apt: + packages: + - *core_build_gpp_latest + sources: + - ubuntu-toolchain-r-test + - os: linux + dist: xenial + compiler: clang + env: TASK='sanitize' + addons: + apt: + packages: + - *core_build_clang_latest + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-xenial-6.0 + - os: linux + dist: xenial + compiler: gcc + env: TASK='coverity' + addons: + apt: + packages: + # Coverity doesn't work with g++-5 or g++-6 yet + - *core_build + - gcc-4.9 + sources: + - ubuntu-toolchain-r-test + - os: linux + dist: xenial + env: TASK='spellintian' + addons: + apt: + packages: + - *core_build + - moreutils + - os: linux + dist: xenial + env: TASK='spellintian-duplicates' + addons: + apt: + packages: + - *core_build + - moreutils + - os: linux + dist: xenial + env: TASK='codespell' + addons: + apt: + packages: + - *core_build + - moreutils + allow_failures: + - os: linux + dist: xenial + compiler: gcc + env: TASK='coverity' + - os: linux + dist: xenial + env: TASK='spellintian-duplicates' + +env: + global: + # No colours in terminal (to reduce log file size) + - TERM=dumb + # Parallel make build + - MAKEFLAGS="-j 2" + # -- BEGIN Coverity Scan ENV + - COVERITY_SCAN_BUILD_COMMAND_PREPEND="cov-configure --comptype gcc --compiler gcc-4.9 --template" + # The build command with all of the arguments that you would apply to a manual `cov-build` + # Usually this is the same as STANDARD_BUILD_COMMAND, excluding the automated test arguments + - COVERITY_SCAN_BUILD_COMMAND="make" + # Name of the project + - COVERITY_SCAN_PROJECT_NAME="$TRAVIS_REPO_SLUG" + # Email address for notifications related to this build + # - COVERITY_SCAN_NOTIFICATION_EMAIL="" + # Regular expression selects on which branches to run analysis + # Be aware of quotas. Do not run on every branch/commit + - COVERITY_SCAN_BRANCH_PATTERN=".*" + # COVERITY_SCAN_TOKEN via "travis encrypt" using the repo's public key + # - secure: "" + # -- END Coverity Scan ENV + +cache: + apt: true + directories: + - $HOME/.ccache # ccache cache + +before_cache: + - ccache -s # see how many hits ccache got + +install: + - if [ "$TASK" = "codespell" ]; then pip install --user git+https://github.com/codespell-project/codespell.git; fi + +before_install: + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; fi + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install ccache; fi + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then PATH=/usr/local/opt/ccache/libexec:$PATH; fi # Use ccache on Mac too +#Coverity doesn't work with g++ 5 or 6, so only upgrade to g++ 4.9 for that + - if [ "$TRAVIS_OS_NAME" == "linux" -a \( "$TASK" = "compile" -o "$TASK" = "sanitize" \) -a "$CC" = "gcc" ]; then export CC="ccache gcc-8"; fi +#Use the latest clang if we're compiling with clang + - if [ "$TRAVIS_OS_NAME" == "linux" -a "$CC" = "clang" ]; then export CC="clang-6.0"; fi +#Report the compiler version + - $CC --version + - if [ "$TASK" == "spellintian" -o "$TASK" == "spellintian-duplicates" ]; then wget "http://archive.ubuntu.com/ubuntu/pool/main/l/lintian/lintian_2.5.104_all.deb"; sudo dpkg -i lintian_*.deb; sudo apt-get install -f -y; fi # Install a later lintian + +after_script: + - if [ "$TASK" = "coverity" ]; then tail -n 10000 ${TRAVIS_BUILD_DIR}/cov-int/build-log.txt; cat ${TRAVIS_BUILD_DIR}/cov-int/scm_log.txt; fi -- cgit v1.2.3 From 7086cf6514462512ffcca6cb72876bd76b193cab Mon Sep 17 00:00:00 2001 From: Peter Newman Date: Tue, 26 Mar 2019 00:31:29 +0000 Subject: Build OLA plugin too --- .travis.yml | 1 + 1 file changed, 1 insertion(+) (limited to '.travis.yml') diff --git a/.travis.yml b/.travis.yml index 1b7c2e2..7ad9dc3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,6 +19,7 @@ addons: - *base_build - libasound2-dev - libevdev-dev + - libola-dev packages: &core_build_gpp_latest - *core_build - gcc-8 -- cgit v1.2.3 From d4663f39bf3272316d5c9e8480e981f54d4f48fb Mon Sep 17 00:00:00 2001 From: Peter Newman Date: Tue, 26 Mar 2019 00:44:19 +0000 Subject: Install the ola libs on Mac, use the latest C++ compiler too --- .travis.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to '.travis.yml') diff --git a/.travis.yml b/.travis.yml index 7ad9dc3..e01cb2a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -157,14 +157,15 @@ install: before_install: - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; fi - - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install ccache; fi + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install ccache ola; fi - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then PATH=/usr/local/opt/ccache/libexec:$PATH; fi # Use ccache on Mac too #Coverity doesn't work with g++ 5 or 6, so only upgrade to g++ 4.9 for that - - if [ "$TRAVIS_OS_NAME" == "linux" -a \( "$TASK" = "compile" -o "$TASK" = "sanitize" \) -a "$CC" = "gcc" ]; then export CC="ccache gcc-8"; fi + - if [ "$TRAVIS_OS_NAME" == "linux" -a \( "$TASK" = "compile" -o "$TASK" = "sanitize" \) -a "$CC" = "gcc" ]; then export CC="ccache gcc-8"; export CXX="ccache g++-8"; fi #Use the latest clang if we're compiling with clang - - if [ "$TRAVIS_OS_NAME" == "linux" -a "$CC" = "clang" ]; then export CC="clang-6.0"; fi -#Report the compiler version + - if [ "$TRAVIS_OS_NAME" == "linux" -a "$CC" = "clang" ]; then export CC="clang-6.0"; export CXX="clang-6.0"; fi +#Report the compiler versions - $CC --version + - $CXX --version - if [ "$TASK" == "spellintian" -o "$TASK" == "spellintian-duplicates" ]; then wget "http://archive.ubuntu.com/ubuntu/pool/main/l/lintian/lintian_2.5.104_all.deb"; sudo dpkg -i lintian_*.deb; sudo apt-get install -f -y; fi # Install a later lintian after_script: -- cgit v1.2.3 From 558a4b135cfbc9e72648cfbbc402dde22a36d632 Mon Sep 17 00:00:00 2001 From: Peter Newman Date: Tue, 26 Mar 2019 01:02:43 +0000 Subject: Install g++8 too, for the C++ compiles --- .travis.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to '.travis.yml') diff --git a/.travis.yml b/.travis.yml index e01cb2a..df4a97a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,6 +23,7 @@ addons: packages: &core_build_gpp_latest - *core_build - gcc-8 + - g++-8 packages: &core_build_clang_latest - *core_build - clang-6.0 @@ -165,7 +166,8 @@ before_install: - if [ "$TRAVIS_OS_NAME" == "linux" -a "$CC" = "clang" ]; then export CC="clang-6.0"; export CXX="clang-6.0"; fi #Report the compiler versions - $CC --version - - $CXX --version +#OS X uses something other than $CXX variable + - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then $CXX --version; fi - if [ "$TASK" == "spellintian" -o "$TASK" == "spellintian-duplicates" ]; then wget "http://archive.ubuntu.com/ubuntu/pool/main/l/lintian/lintian_2.5.104_all.deb"; sudo dpkg -i lintian_*.deb; sudo apt-get install -f -y; fi # Install a later lintian after_script: -- cgit v1.2.3 From d682a8df9a151538d70c8a7a23a68636284b1b94 Mon Sep 17 00:00:00 2001 From: Peter Newman Date: Tue, 26 Mar 2019 01:18:38 +0000 Subject: Only run $CXX version when necessary --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to '.travis.yml') diff --git a/.travis.yml b/.travis.yml index df4a97a..ab047ce 100644 --- a/.travis.yml +++ b/.travis.yml @@ -167,7 +167,7 @@ before_install: #Report the compiler versions - $CC --version #OS X uses something other than $CXX variable - - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then $CXX --version; fi + - if [ "$TRAVIS_OS_NAME" == "linux" -a \( "$TASK" = "compile" -o "$TASK" = "sanitize" \) ]; then $CXX --version; fi - if [ "$TASK" == "spellintian" -o "$TASK" == "spellintian-duplicates" ]; then wget "http://archive.ubuntu.com/ubuntu/pool/main/l/lintian/lintian_2.5.104_all.deb"; sudo dpkg -i lintian_*.deb; sudo apt-get install -f -y; fi # Install a later lintian after_script: -- cgit v1.2.3 From b618c4a6b74a52f830ca53029e1cc680d56a2501 Mon Sep 17 00:00:00 2001 From: cbdev Date: Sat, 6 Jul 2019 17:25:12 +0200 Subject: Implement Lua backend --- .travis.yml | 1 + README.md | 13 ++-- backends/Makefile | 4 +- backends/lua.c | 202 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ backends/lua.h | 21 ++++++ backends/lua.md | 49 +++++++++++++ configs/demo.lua | 21 ++++++ configs/lua.cfg | 35 ++++++++++ midimonster.h | 1 + 9 files changed, 342 insertions(+), 5 deletions(-) create mode 100644 backends/lua.c create mode 100644 backends/lua.h create mode 100644 backends/lua.md create mode 100644 configs/demo.lua create mode 100644 configs/lua.cfg (limited to '.travis.yml') diff --git a/.travis.yml b/.travis.yml index ab047ce..66bfd9a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,6 +20,7 @@ addons: - libasound2-dev - libevdev-dev - libola-dev + - liblua5.3-dev packages: &core_build_gpp_latest - *core_build - gcc-8 diff --git a/README.md b/README.md index 6265581..ee907a6 100644 --- a/README.md +++ b/README.md @@ -12,12 +12,15 @@ Currently, the MIDIMonster supports the following protocols: * evdev input devices (Linux) * Open Lighting Architecture (OLA) +with additional flexibility provided by a Lua scripting environment. + The MIDIMonster allows the user to translate any channel on one protocol into channel(s) on any other (or the same) supported protocol, for example to: * Translate MIDI Control Changes into Notes ([Example configuration](configs/unifest-17.cfg)) * Translate MIDI Notes into ArtNet or sACN ([Example configuration](configs/launchctl-sacn.cfg)) * Translate OSC messages into MIDI ([Example configuration](configs/midi-osc.cfg)) +* Dynamically route and modify events using the Lua programming language ([Example configuration](configs/lua.cfg) and [Script](configs/demo.lua)) to create your own lighting controller * Use an OSC app as a simple lighting controller via ArtNet or sACN * Visualize ArtNet data using OSC tools * Control lighting fixtures or DAWs using gamepad controllers ([Example configuration](configs/evdev.conf)) @@ -88,6 +91,7 @@ special information. These documentation files are located in the `backends/` di * [`loopback` backend documentation](backends/loopback.md) * [`ola` backend documentation](backends/ola.md) * [`osc` backend documentation](backends/osc.md) +* [`lua` backend documentation](backends/lua.md) ## Building @@ -99,10 +103,11 @@ This section will explain how to build the provided sources to be able to run In order to build the MIDIMonster, you'll need some libraries that provide support for the protocols to translate. -* libasound2-dev (for the MIDI backend) -* libevdev-dev (for the evdev backend) -* libola-dev (for the optional OLA backend) -* pkg-config (as some projects and systems like to spread their files around) +* `libasound2-dev` (for the MIDI backend) +* `libevdev-dev` (for the evdev backend) +* `liblua5.3-dev` (for the lua backend) +* `libola-dev` (for the optional OLA backend) +* `pkg-config` (as some projects and systems like to spread their files around) * A C compiler * GNUmake diff --git a/backends/Makefile b/backends/Makefile index c11de56..fe88669 100644 --- a/backends/Makefile +++ b/backends/Makefile @@ -1,7 +1,7 @@ .PHONY: all clean full OPTIONAL_BACKENDS = ola.so LINUX_BACKENDS = midi.so evdev.so -BACKENDS = artnet.so osc.so loopback.so sacn.so +BACKENDS = artnet.so osc.so loopback.so sacn.so lua.so BACKEND_LIB = libmmbackend.o SYSTEM := $(shell uname -s) @@ -27,6 +27,8 @@ evdev.so: CFLAGS += $(shell pkg-config --cflags libevdev) evdev.so: LDLIBS = $(shell pkg-config --libs libevdev) ola.so: LDLIBS = -lola ola.so: CPPFLAGS += -Wno-write-strings +lua.so: CFLAGS += $(shell pkg-config --cflags lua5.3) +lua.so: LDLIBS += $(shell pkg-config --libs lua5.3) %.so :: %.c %.h $(BACKEND_LIB) $(CC) $(CFLAGS) $(LDLIBS) $< $(ADDITIONAL_OBJS) -o $@ $(LDFLAGS) diff --git a/backends/lua.c b/backends/lua.c new file mode 100644 index 0000000..ae2d460 --- /dev/null +++ b/backends/lua.c @@ -0,0 +1,202 @@ +#include +#include "lua.h" + +#define BACKEND_NAME "lua" +#define LUA_REGISTRY_KEY "_midimonster_lua_instance" + +//TODO instance identification for callvacks + +int init(){ + backend lua = { + .name = BACKEND_NAME, + .conf = lua_configure, + .create = lua_instance, + .conf_instance = lua_configure_instance, + .channel = lua_channel, + .handle = lua_set, + .process = lua_handle, + .start = lua_start, + .shutdown = lua_shutdown + }; + + //register backend + if(mm_backend_register(lua)){ + fprintf(stderr, "Failed to register lua backend\n"); + return 1; + } + return 0; +} + +static int lua_callback_output(lua_State* interpreter){ + int arguments = lua_gettop(interpreter); + size_t n; + channel_value val; + const char* channel_name = NULL; + channel* channel = NULL; + instance* inst = NULL; + lua_instance_data* data = NULL; + + if(arguments != 2){ + fprintf(stderr, "Lua output function called with %d arguments, expected 2\n", arguments); + return 0; + } + + channel_name = lua_tostring(interpreter, 1); + val.normalised = clamp(lua_tonumber(interpreter, 2), 1.0, 0.0); + + lua_pushstring(interpreter, LUA_REGISTRY_KEY); + lua_gettable(interpreter, LUA_REGISTRYINDEX); + inst = (instance *) lua_touserdata(interpreter, -1); + data = (lua_instance_data*) inst->impl; + + for(n = 0; n < data->channels; n++){ + if(!strcmp(channel_name, data->channel_name[n])){ + channel = mm_channel(inst, n, 0); + if(!channel){ + return 0; + } + mm_channel_event(channel, val); + return 0; + } + } + + fprintf(stderr, "Tried to set unknown channel %s.%s\n", inst->name, channel_name); + return 0; +} + +static int lua_configure(char* option, char* value){ + fprintf(stderr, "The lua backend does not take any global configuration\n"); + return 1; +} + +static int lua_configure_instance(instance* inst, char* option, char* value){ + lua_instance_data* data = (lua_instance_data*) inst->impl; + + if(!strcmp(option, "script")){ + if(luaL_dofile(data->interpreter, value)){ + fprintf(stderr, "Failed to load lua source file %s for instance %s: %s\n", value, inst->name, lua_tostring(data->interpreter, -1)); + return 1; + } + return 0; + } + + fprintf(stderr, "Unknown configuration parameter %s for lua backend\n", option); + return 1; +} + +static instance* lua_instance(){ + instance* inst = mm_instance(); + if(!inst){ + return NULL; + } + + lua_instance_data* data = calloc(1, sizeof(lua_instance_data)); + if(!data){ + fprintf(stderr, "Failed to allocate memory\n"); + return NULL; + } + + //load the interpreter + data->interpreter = luaL_newstate(); + if(!data->interpreter){ + fprintf(stderr, "Failed to initialize LUA\n"); + free(data); + return NULL; + } + luaL_openlibs(data->interpreter); + + //register lua api functions + lua_register(data->interpreter, "output", lua_callback_output); + + //store instance pointer to the lua state + lua_pushstring(data->interpreter, LUA_REGISTRY_KEY); + lua_pushlightuserdata(data->interpreter, (void *) inst); + lua_settable(data->interpreter, LUA_REGISTRYINDEX); + + inst->impl = data; + return inst; +} + +static channel* lua_channel(instance* inst, char* spec){ + size_t u; + lua_instance_data* data = (lua_instance_data*) inst->impl; + + //find matching channel + for(u = 0; u < data->channels; u++){ + if(!strcmp(spec, data->channel_name[u])){ + break; + } + } + + //allocate new channel + if(u == data->channels){ + data->channel_name = realloc(data->channel_name, (u + 1) * sizeof(char*)); + if(!data->channel_name){ + fprintf(stderr, "Failed to allocate memory\n"); + return NULL; + } + + data->channel_name[u] = strdup(spec); + if(!data->channel_name[u]){ + fprintf(stderr, "Failed to allocate memory\n"); + return NULL; + } + data->channels++; + } + + return mm_channel(inst, u, 1); +} + +static int lua_set(instance* inst, size_t num, channel** c, channel_value* v){ + size_t n = 0; + lua_instance_data* data = (lua_instance_data*) inst->impl; + + for(n = 0; n < num; n++){ + //call lua channel handlers + lua_getglobal(data->interpreter, data->channel_name[c[n]->ident]); + lua_pushnumber(data->interpreter, v[n].normalised); + if(lua_pcall(data->interpreter, 1, 0, 0) != LUA_OK){ + fprintf(stderr, "Failed to call handler for %s.%s: %s\n", inst->name, data->channel_name[c[n]->ident], lua_tostring(data->interpreter, -1)); + lua_pop(data->interpreter, 1); + } + } + return 0; +} + +static int lua_handle(size_t num, managed_fd* fds){ + //TODO call timer callbacks + return 0; +} + +static int lua_start(){ + //TODO start timers / register fds + return 0; +} + +static int lua_shutdown(){ + size_t n, u, p; + instance** inst = NULL; + lua_instance_data* data = NULL; + + if(mm_backend_instances(BACKEND_NAME, &n, &inst)){ + fprintf(stderr, "Failed to fetch instance list\n"); + return 1; + } + + for(u = 0; u < n; u++){ + data = (lua_instance_data*) inst[u]->impl; + //stop the interpreter + lua_close(data->interpreter); + //cleanup channel data + for(p = 0; p < data->channels; p++){ + free(data->channel_name[p]); + } + free(data->channel_name); + free(inst[u]->impl); + } + + free(inst); + + fprintf(stderr, "Lua backend shut down\n"); + return 0; +} diff --git a/backends/lua.h b/backends/lua.h new file mode 100644 index 0000000..27e1afd --- /dev/null +++ b/backends/lua.h @@ -0,0 +1,21 @@ +#include "midimonster.h" + +#include +#include +#include + +int init(); +static int lua_configure(char* option, char* value); +static int lua_configure_instance(instance* inst, char* option, char* value); +static instance* lua_instance(); +static channel* lua_channel(instance* inst, char* spec); +static int lua_set(instance* inst, size_t num, channel** c, channel_value* v); +static int lua_handle(size_t num, managed_fd* fds); +static int lua_start(); +static int lua_shutdown(); + +typedef struct /*_lua_instance_data*/ { + size_t channels; + char** channel_name; + lua_State* interpreter; +} lua_instance_data; diff --git a/backends/lua.md b/backends/lua.md new file mode 100644 index 0000000..91e8fe2 --- /dev/null +++ b/backends/lua.md @@ -0,0 +1,49 @@ +### The `lua` backend + +The `lua` backend provides a flexible programming environment, allowing users to route and manipulate +events using the Lua programming language. + +Every instance has it's own interpreter state which can be loaded with custom handler scripts. + +To process incoming channel events, the MIDIMonster calls corresponding Lua functions with +the value (as a Lua `number` type) as parameter. To send output on a channel, the Lua environment +provides the function `output(channel-name, value)`. + +Example script: +``` +function bar(value) + output("foo", value / 2) +end +``` + +Input values range between 0.0 and 1.0, output values are clamped to the same range. + +#### Global configuration + +The backend does not take any global configuration. + +#### Instance configuration + +| Option | Example value | Default value | Description | +|---------------|-----------------------|-----------------------|-----------------------| +| `source` | `script.lua` | none | Lua source file | + +A single instance may have multiple `source` options specified, which will all be read cumulatively. + +#### Channel specification + +Channel names may be any valid Lua function name. + +Example mapping: +``` +lua1.foo > lua2.bar +``` + +#### Known bugs / problems + +Using `output` as an input channel name to a Lua instance does not work, as the interpreter has +`output` globally assigned to the event output function. Using `output` as an output channel name +via `output("output", value)` works as intended. + +The path to the Lua source files is relative to the current working directory. This may lead +to problems when copying configuration between installations. diff --git a/configs/demo.lua b/configs/demo.lua new file mode 100644 index 0000000..e816ac4 --- /dev/null +++ b/configs/demo.lua @@ -0,0 +1,21 @@ +-- This example MIDIMonstaer Lua script spreads one input channel onto multiple output +-- channels using a polynomial function evaluated at multiple points. This effect can +-- be visualized e.g. with martrix (https://github.com/cbdevnet/martrix). + +-- This is just a demonstration of global variables +foo = 0 + +-- The polynomial to evaluate +function polynomial(offset, x) + return math.exp(-20 * (x - offset) ^ 2) +end + +-- Handler function for the input channel +function input(value) + foo = foo + 1 + print("input at ", value, foo) + + for chan=0,10 do + output("out" .. chan, polynomial(value, (1 / 10) * chan)) + end +end diff --git a/configs/lua.cfg b/configs/lua.cfg new file mode 100644 index 0000000..9182122 --- /dev/null +++ b/configs/lua.cfg @@ -0,0 +1,35 @@ +; This configuration uses a Lua script to distribute one input channel (from either a mouse +; button or an axis control) onto multiple output channels (on ArtNet). + +[backend artnet] +bind = 0.0.0.0 + +[evdev mouse] +device = /dev/input/by-path/platform-i8042-serio-2-event-mouse + +[evdev xbox] +input = Xbox Wireless +axis.ABS_X = 34300 0 65535 255 4095 + +[lua lua] +script = configs/demo.lua + +[artnet art] +universe = 0 +destination = 255.255.255.255 + +[map] +mouse.EV_KEY.BTN_LEFT > lua.input +xbox.EV_ABS.ABS_X > lua.input + +art.1 < lua.out0 +art.2 < lua.out1 +art.3 < lua.out2 +art.4 < lua.out3 +art.5 < lua.out4 +art.6 < lua.out5 +art.7 < lua.out6 +art.8 < lua.out7 +art.9 < lua.out8 +art.10 < lua.out9 +art.11 < lua.out10 diff --git a/midimonster.h b/midimonster.h index 572b5fb..8a18155 100644 --- a/midimonster.h +++ b/midimonster.h @@ -5,6 +5,7 @@ #include #define max(a,b) (((a) > (b)) ? (a) : (b)) #define min(a,b) (((a) < (b)) ? (a) : (b)) +#define clamp(val,max,min) (((val) > (max)) ? (max) : (((val) < (min)) ? (min) : (val))) #ifdef DEBUG #define DBGPF(format, ...) fprintf(stderr, (format), __VA_ARGS__) #define DBG(message) fprintf(stderr, "%s", (message)) -- cgit v1.2.3 From 4681120c21567df21d09903cdb2d3d8387786421 Mon Sep 17 00:00:00 2001 From: cbdev Date: Sun, 7 Jul 2019 10:15:32 +0200 Subject: Add lua dependency to macos for travis --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to '.travis.yml') diff --git a/.travis.yml b/.travis.yml index 66bfd9a..74af4c3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -159,7 +159,7 @@ install: before_install: - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; fi - - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install ccache ola; fi + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install ccache ola lua; fi - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then PATH=/usr/local/opt/ccache/libexec:$PATH; fi # Use ccache on Mac too #Coverity doesn't work with g++ 5 or 6, so only upgrade to g++ 4.9 for that - if [ "$TRAVIS_OS_NAME" == "linux" -a \( "$TASK" = "compile" -o "$TASK" = "sanitize" \) -a "$CC" = "gcc" ]; then export CC="ccache gcc-8"; export CXX="ccache g++-8"; fi -- cgit v1.2.3 From c2bf894835d01c648e3f64826e69944a2a27373f Mon Sep 17 00:00:00 2001 From: cbdev Date: Thu, 15 Aug 2019 10:55:23 +0200 Subject: Fix CI, add dot2 detection to maweb --- .travis.yml | 3 +++ backends/maweb.c | 7 +++++ backends/maweb.md | 81 +++++++++---------------------------------------------- 3 files changed, 23 insertions(+), 68 deletions(-) (limited to '.travis.yml') diff --git a/.travis.yml b/.travis.yml index 74af4c3..8d21ef3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -123,6 +123,9 @@ matrix: - os: linux dist: xenial env: TASK='spellintian-duplicates' + - os: linux + dist: xenial + env: TASK='codespell' env: global: diff --git a/backends/maweb.c b/backends/maweb.c index b708015..07fce12 100644 --- a/backends/maweb.c +++ b/backends/maweb.c @@ -303,6 +303,12 @@ static int maweb_handle_message(instance* inst, char* payload, size_t payload_le if(json_obj(payload, "status") && json_obj(payload, "appType")){ fprintf(stderr, "maweb connection established\n"); + field = json_obj_str(payload, "appType", NULL); + if(!strncmp(field, "dot2", 4)){ + fprintf(stderr, "maweb peer detected as dot2, forcing user name 'remote'\n"); + free(data->user); + data->user = strdup("remote"); + } maweb_send_frame(inst, ws_text, (uint8_t*) "{\"session\":0}", 13); } @@ -535,6 +541,7 @@ static int maweb_set(instance* inst, size_t num, channel** c, channel_value* v){ if(num && !data->login){ fprintf(stderr, "maweb instance %s can not send output, not logged in\n", inst->name); + return 0; } for(n = 0; n < num; n++){ diff --git a/backends/maweb.md b/backends/maweb.md index b54f1c3..dd13db9 100644 --- a/backends/maweb.md +++ b/backends/maweb.md @@ -15,10 +15,10 @@ The `maweb` backend does not take any global configuration. #### Instance configuration -| Option | Example value | Default value | Description | +| Option | Example value | Default value | Description | |---------------|-----------------------|-----------------------|---------------------------------------------------------------| -| `host` | `10.23.42.21 80` | none | Host address (and optional port) of the MA Web Remote | -| `user` | `midimonster` | none | User for the remote session | +| `host` | `10.23.42.21 80` | none | Host address (and optional port) of the MA Web Remote | +| `user` | `midimonster` | none | User for the remote session (GrandMA2) | | `password` | `midimonster` | `midimonster` | Password for the remote session | #### Channel specification @@ -58,71 +58,16 @@ mw1. The following button names are recognized by the backend: -* `SET` -* `PREV` -* `NEXT` -* `CLEAR` -* `FIXTURE_CHANNEL` -* `FIXTURE_GROUP_PRESET` -* `EXEC_CUE` -* `STORE_UPDATE` -* `OOPS` -* `ESC` -* `0` -* `1` -* `2` -* `3` -* `4` -* `5` -* `6` -* `7` -* `8` -* `9` -* `PUNKT` -* `PLUS` -* `MINUS` -* `THRU` -* `IF` -* `AT` -* `FULL` -* `HIGH` -* `ENTER` -* `OFF` -* `ON` -* `ASSIGN` -* `LABEL` -* `COPY` -* `TIME` -* `PAGE` -* `MACRO` -* `DELETE` -* `GOTO` -* `GO_PLUS` -* `GO_MINUS` -* `PAUSE` -* `SELECT` -* `FIXTURE` -* `SEQU` -* `CUE` -* `PRESET` -* `EDIT` -* `UPDATE` -* `EXEC` -* `STORE` -* `GROUP` -* `PROG_ONLY` -* `SPECIAL_DIALOGUE` -* `SOLO` -* `ODD` -* `EVEN` -* `WINGS` -* `RESET` -* `MA` -* `layerMode` -* `featureSort` -* `fixtureSort` -* `channelSort` -* `hideName` +| `SET` | `PREV` | `NEXT` | `CLEAR` | `FIXTURE_CHANNEL` | `FIXTURE_GROUP_PRESET` | `EXEC_CUE` | +| `STORE_UPDATE`| `OOPS` | `ESC` | `OFF` | `ON` | `MA` | `STORE` | +| `0` | `1` | `2` | `3` | `4` | `5` | `6` | +| `7` | `8` | `9` | `PUNKT` | `PLUS` | `MINUS` | `THRU` | +| `IF` | `AT` | `FULL` | `HIGH` | `ENTER` | `ASSIGN` | `LABEL` | +| `COPY` | `TIME` | `PAGE` | `MACRO` | `DELETE` | `GOTO` | `GO_PLUS` | +| `GO_MINUS` | `PAUSE` | `SELECT` | `FIXTURE` | `SEQU` | `CUE` | `PRESET` | +| `EDIT` | `UPDATE` | `EXEC` | `GROUP` | `PROG_ONLY` | `SPECIAL_DIALOGUE` | `SOLO` | +| `ODD` | `EVEN` | `WINGS` | `RESET` | `layerMode` | `featureSort` | `fixtureSort` | +| `channelSort` | `hideName` | | | | | | Note that each Web Remote connection has it's own command line, as such commands entered using this backend will not affect the command line on the main console. To do that, you will need to use another backend to feed input to the MA, such as -- cgit v1.2.3 From bfa4cbb012ce49f59d983d275da8837b50872c16 Mon Sep 17 00:00:00 2001 From: cbdev Date: Thu, 22 Aug 2019 21:38:06 +0200 Subject: Update travis dependencies --- .travis.yml | 3 ++- backends/maweb.c | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) (limited to '.travis.yml') diff --git a/.travis.yml b/.travis.yml index 8d21ef3..305dc61 100644 --- a/.travis.yml +++ b/.travis.yml @@ -21,6 +21,7 @@ addons: - libevdev-dev - libola-dev - liblua5.3-dev + - libssl-dev packages: &core_build_gpp_latest - *core_build - gcc-8 @@ -162,7 +163,7 @@ install: before_install: - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; fi - - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install ccache ola lua; fi + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install ccache ola lua openssl; fi - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then PATH=/usr/local/opt/ccache/libexec:$PATH; fi # Use ccache on Mac too #Coverity doesn't work with g++ 5 or 6, so only upgrade to g++ 4.9 for that - if [ "$TRAVIS_OS_NAME" == "linux" -a \( "$TASK" = "compile" -o "$TASK" = "sanitize" \) -a "$CC" = "gcc" ]; then export CC="ccache gcc-8"; export CXX="ccache g++-8"; fi diff --git a/backends/maweb.c b/backends/maweb.c index 07595be..9ba04fa 100644 --- a/backends/maweb.c +++ b/backends/maweb.c @@ -475,7 +475,6 @@ static int maweb_request_playbacks(instance* inst){ channels = data->input_channel[channel + channel_offset - 1].fields.index - (data->input_channel[channel].fields.index / 5) * 5; - snprintf(item_counts, sizeof(item_indices), "[%lu]", ((channels / 5) * 5 + 5)); channel += channel_offset - 1; } -- cgit v1.2.3 From 6464a418f2bf13c8c04b10abf5ebdc4c95aae861 Mon Sep 17 00:00:00 2001 From: cbdev Date: Thu, 22 Aug 2019 22:28:25 +0200 Subject: Try to fix failing build by providing additional hints to MacOS --- .travis.yml | 3 +++ backends/maweb.md | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to '.travis.yml') diff --git a/.travis.yml b/.travis.yml index 305dc61..9f2034c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -164,6 +164,9 @@ install: before_install: - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; fi - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install ccache ola lua openssl; fi +# OpenSSL is not a proper install due to some Apple bull, so provide additional locations via the environment... + - export CPPFLAGS="$CPPFLAGS -I/usr/local/opt/openssl/include" + - export LDFLAGS="$LDFLAGS -L/usr/local/opt/openssl/lib" - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then PATH=/usr/local/opt/ccache/libexec:$PATH; fi # Use ccache on Mac too #Coverity doesn't work with g++ 5 or 6, so only upgrade to g++ 4.9 for that - if [ "$TRAVIS_OS_NAME" == "linux" -a \( "$TASK" = "compile" -o "$TASK" = "sanitize" \) -a "$CC" = "gcc" ]; then export CC="ccache gcc-8"; export CXX="ccache g++-8"; fi diff --git a/backends/maweb.md b/backends/maweb.md index fe430db..f3b40b6 100644 --- a/backends/maweb.md +++ b/backends/maweb.md @@ -53,8 +53,8 @@ Currently, three types of MA controls can be assigned, with each having some sub * B-Wing 2 has 316 to 309 (top row) through 816 to 809 (bottom row) When creating a new show, only the first page is created and active. Additional pages have to be created explicitly within -the console before being usable. `fader` controls, when mapped as outputs from the MA, output their value, `button` controls -output 1 when the corresponding executor is running, 0 otherwise. +the console before being usable. When mapped as outputs, `fader` controls output their value, `button` controls output 1 when the corresponding +executor is running, 0 otherwise. These controls can be addressed like -- cgit v1.2.3 From 93de82b8ccab8fdbeaa2b1847c75488a03340bcc Mon Sep 17 00:00:00 2001 From: cbdev Date: Thu, 22 Aug 2019 22:41:28 +0200 Subject: Update travis config for openssl, using CFLAGS this time --- .travis.yml | 2 +- backends/lua.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to '.travis.yml') diff --git a/.travis.yml b/.travis.yml index 9f2034c..864c628 100644 --- a/.travis.yml +++ b/.travis.yml @@ -165,7 +165,7 @@ before_install: - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; fi - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install ccache ola lua openssl; fi # OpenSSL is not a proper install due to some Apple bull, so provide additional locations via the environment... - - export CPPFLAGS="$CPPFLAGS -I/usr/local/opt/openssl/include" + - export CFLAGS="$CFLAGS -I/usr/local/opt/openssl/include" - export LDFLAGS="$LDFLAGS -L/usr/local/opt/openssl/lib" - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then PATH=/usr/local/opt/ccache/libexec:$PATH; fi # Use ccache on Mac too #Coverity doesn't work with g++ 5 or 6, so only upgrade to g++ 4.9 for that diff --git a/backends/lua.c b/backends/lua.c index ec02575..365cf3e 100644 --- a/backends/lua.c +++ b/backends/lua.c @@ -384,11 +384,11 @@ static int lua_set(instance* inst, size_t num, channel** c, channel_value* v){ } static int lua_handle(size_t num, managed_fd* fds){ - uint8_t read_buffer[100]; uint64_t delta = timer_interval; size_t n; #ifdef MMBACKEND_LUA_TIMERFD + uint8_t read_buffer[100]; if(!num){ return 0; } -- cgit v1.2.3 From 69f3115df4ff60fdef28408eb89d1b505633fcb4 Mon Sep 17 00:00:00 2001 From: cbdev Date: Tue, 17 Sep 2019 22:17:43 +0200 Subject: Add windows build to CI --- .travis-ci.sh | 5 +++++ .travis.yml | 14 ++++++++++++++ 2 files changed, 19 insertions(+) (limited to '.travis.yml') diff --git a/.travis-ci.sh b/.travis-ci.sh index ddfa93d..da36c17 100644 --- a/.travis-ci.sh +++ b/.travis-ci.sh @@ -71,6 +71,11 @@ elif [[ $TASK = 'sanitize' ]]; then travis_fold start "make_sanitize" make sanitize; travis_fold end "make_sanitize" +elif [[ $TASK = 'windows' ]]; then + # Run sanitized compile + travis_fold start "make_windows" + make windows; + travis_fold end "make_windows" else # Otherwise compile as normal travis_fold start "make" diff --git a/.travis.yml b/.travis.yml index 864c628..ced21ef 100644 --- a/.travis.yml +++ b/.travis.yml @@ -29,6 +29,10 @@ addons: packages: &core_build_clang_latest - *core_build - clang-6.0 + packages: &core_build_windows + - *core_build + - mingw-w64 + matrix: fast_finish: true @@ -69,6 +73,16 @@ matrix: - *core_build_gpp_latest sources: - ubuntu-toolchain-r-test + - os: linux + dist: xenial + compiler: mingw-gcc + env: TASK='windows' + addons: + apt: + packages: + - *core_build_windows + sources: + - ubuntu-toolchain-r-test - os: linux dist: xenial compiler: clang -- cgit v1.2.3 From cd59a560d8b182ce50ea1edae1c0f2a0a89e76c0 Mon Sep 17 00:00:00 2001 From: cbdev Date: Wed, 18 Sep 2019 00:57:35 +0200 Subject: Fix winmidi feedback connection --- .travis.yml | 2 +- backends/maweb.c | 2 +- backends/winmidi.c | 39 +++++++++++++++++++++++++++++++++++---- 3 files changed, 37 insertions(+), 6 deletions(-) (limited to '.travis.yml') diff --git a/.travis.yml b/.travis.yml index ced21ef..ea4bd94 100644 --- a/.travis.yml +++ b/.travis.yml @@ -75,7 +75,7 @@ matrix: - ubuntu-toolchain-r-test - os: linux dist: xenial - compiler: mingw-gcc + compiler: x86_64-w64-mingw32-gcc env: TASK='windows' addons: apt: diff --git a/backends/maweb.c b/backends/maweb.c index 88f7b9a..c88ca8c 100644 --- a/backends/maweb.c +++ b/backends/maweb.c @@ -591,7 +591,7 @@ static int maweb_handle_message(instance* inst, char* payload, size_t payload_le fprintf(stderr, "maweb sending user credentials\n"); snprintf(xmit_buffer, sizeof(xmit_buffer), "{\"requestType\":\"login\",\"username\":\"%s\",\"password\":\"%s\",\"session\":%" PRIu64 "}", - (data->peer_type == peer_dot2) ? "remote" : data->user, data->pass, data->session); + (data->peer_type == peer_dot2) ? "remote" : data->user, data->pass ? data->pass : MAWEB_DEFAULT_PASSWORD, data->session); maweb_send_frame(inst, ws_text, (uint8_t*) xmit_buffer, strlen(xmit_buffer)); } if(json_obj(payload, "status") && json_obj(payload, "appType")){ diff --git a/backends/winmidi.c b/backends/winmidi.c index 2c52a22..4c72c32 100644 --- a/backends/winmidi.c +++ b/backends/winmidi.c @@ -181,6 +181,11 @@ static int winmidi_set(instance* inst, size_t num, channel** c, channel_value* v }; size_t u; + //early exit + if(!num){ + return 0; + } + if(!data->device_out){ fprintf(stderr, "winmidi instance %s has no output device\n", inst->name); return 0; @@ -433,9 +438,12 @@ static int winmidi_start(){ int device, rv = -1; instance** inst = NULL; winmidi_instance_data* data = NULL; - struct sockaddr_storage sockadd; + struct sockaddr_storage sockadd = { + 0 + }; //this really should be a size_t but getsockname specifies int* for some reason int sockadd_len = sizeof(sockadd); + char* error = NULL; DBGPF("winmidi main thread ID is %ld\n", GetCurrentThreadId()); //fetch all instances @@ -457,18 +465,41 @@ static int winmidi_start(){ } //open the feedback sockets - backend_config.socket_pair[0] = mmbackend_socket(NULL, "0", SOCK_DGRAM, 1, 0); + //for some reason this while construct fails to work on 'real' windows with ipv6 + backend_config.socket_pair[0] = mmbackend_socket("127.0.0.1", "0", SOCK_DGRAM, 1, 0); if(backend_config.socket_pair[0] < 0){ fprintf(stderr, "winmidi failed to open feedback socket\n"); return 1; } if(getsockname(backend_config.socket_pair[0], (struct sockaddr*) &sockadd, &sockadd_len)){ - fprintf(stderr, "winmidi failed to query feedback socket information\n"); + FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, + NULL, WSAGetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR) &error, 0, NULL); + fprintf(stderr, "winmidi failed to query feedback socket information: %s\n", error); + LocalFree(error); return 1; } + //getsockname on 'real' windows may not set the adress - works on wine, though + switch(sockadd.ss_family){ + case AF_INET: + case AF_INET6: + ((struct sockaddr_in*) &sockadd)->sin_family = AF_INET; + ((struct sockaddr_in*) &sockadd)->sin_addr.s_addr = htobe32(INADDR_LOOPBACK); + break; + //for some absurd reason 'real' windows announces the socket as AF_INET6 but rejects any connection unless its AF_INET +// case AF_INET6: +// ((struct sockaddr_in6*) &sockadd)->sin6_addr = in6addr_any; +// break; + default: + fprintf(stderr, "winmidi invalid feedback socket family\n"); + return 1; + } + DBGPF("winmidi feedback socket family %d port %d\n", sockadd.ss_family, be16toh(((struct sockaddr_in*)&sockadd)->sin_port)); backend_config.socket_pair[1] = socket(sockadd.ss_family, SOCK_DGRAM, IPPROTO_UDP); if(backend_config.socket_pair[1] < 0 || connect(backend_config.socket_pair[1], (struct sockaddr*) &sockadd, sockadd_len)){ - fprintf(stderr, "winmidi failed to connect to feedback socket\n"); + FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, + NULL, WSAGetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR) &error, 0, NULL); + fprintf(stderr, "winmidi failed to connect to feedback socket: %s\n", error); + LocalFree(error); return 1; } -- cgit v1.2.3 From 82f6b03929315d65693155d3274a79d4a6285896 Mon Sep 17 00:00:00 2001 From: cbdev Date: Wed, 18 Sep 2019 01:10:26 +0200 Subject: Fix spelling & optics --- .travis.yml | 6 ++++-- backends/winmidi.c | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to '.travis.yml') diff --git a/.travis.yml b/.travis.yml index ea4bd94..12de8c3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -75,8 +75,10 @@ matrix: - ubuntu-toolchain-r-test - os: linux dist: xenial - compiler: x86_64-w64-mingw32-gcc - env: TASK='windows' + compiler: mingw32-gcc + env: + - TASK='windows' + - CC='x86_64-w64-mingw32-gcc' addons: apt: packages: diff --git a/backends/winmidi.c b/backends/winmidi.c index 4c72c32..67187ac 100644 --- a/backends/winmidi.c +++ b/backends/winmidi.c @@ -478,7 +478,7 @@ static int winmidi_start(){ LocalFree(error); return 1; } - //getsockname on 'real' windows may not set the adress - works on wine, though + //getsockname on 'real' windows may not set the address - works on wine, though switch(sockadd.ss_family){ case AF_INET: case AF_INET6: -- cgit v1.2.3 From 92516e0990145b2b42a9caf7af454d668f56d0cb Mon Sep 17 00:00:00 2001 From: cbdev Date: Wed, 6 Nov 2019 19:03:24 +0100 Subject: Add libjack-jackd2-dev to build dependencies for CI --- .travis.yml | 1 + 1 file changed, 1 insertion(+) (limited to '.travis.yml') diff --git a/.travis.yml b/.travis.yml index 12de8c3..59274e4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,6 +20,7 @@ addons: - libasound2-dev - libevdev-dev - libola-dev + - libjack-jackd2-dev - liblua5.3-dev - libssl-dev packages: &core_build_gpp_latest -- cgit v1.2.3 From be38eb9ddd1b82a87cf26884dd13ccb6dff5eebf Mon Sep 17 00:00:00 2001 From: cbdev Date: Wed, 6 Nov 2019 21:09:16 +0100 Subject: Try to build the JACK backend on OSX --- .travis.yml | 2 +- backends/Makefile | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to '.travis.yml') diff --git a/.travis.yml b/.travis.yml index 59274e4..e1cef00 100644 --- a/.travis.yml +++ b/.travis.yml @@ -180,7 +180,7 @@ install: before_install: - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; fi - - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install ccache ola lua openssl; fi + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install ccache ola lua openssl jack; fi # OpenSSL is not a proper install due to some Apple bull, so provide additional locations via the environment... - export CFLAGS="$CFLAGS -I/usr/local/opt/openssl/include" - export LDFLAGS="$LDFLAGS -L/usr/local/opt/openssl/lib" diff --git a/backends/Makefile b/backends/Makefile index c5755c9..901ec49 100644 --- a/backends/Makefile +++ b/backends/Makefile @@ -1,7 +1,7 @@ .PHONY: all clean full -LINUX_BACKENDS = midi.so evdev.so jack.so +LINUX_BACKENDS = midi.so evdev.so WINDOWS_BACKENDS = artnet.dll osc.dll loopback.dll sacn.dll maweb.dll winmidi.dll -BACKENDS = artnet.so osc.so loopback.so sacn.so lua.so maweb.so +BACKENDS = artnet.so osc.so loopback.so sacn.so lua.so maweb.so jack.so OPTIONAL_BACKENDS = ola.so BACKEND_LIB = libmmbackend.o -- cgit v1.2.3 From dadadbe4aa8028197cfaaedc37bceb920923b803 Mon Sep 17 00:00:00 2001 From: cbdev Date: Fri, 22 Nov 2019 20:21:25 +0100 Subject: Fix OSX build by yet again hardcoding things that should have been unnecessary --- .travis.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to '.travis.yml') diff --git a/.travis.yml b/.travis.yml index e1cef00..bdaf63a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -182,8 +182,10 @@ before_install: - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; fi - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install ccache ola lua openssl jack; fi # OpenSSL is not a proper install due to some Apple bull, so provide additional locations via the environment... - - export CFLAGS="$CFLAGS -I/usr/local/opt/openssl/include" - - export LDFLAGS="$LDFLAGS -L/usr/local/opt/openssl/lib" +# Additionally, newer versions of this "recipe" seem to use the name 'openssl@1.1' instead of plain 'openssl' and there seems to be +# no way to programmatically get the link and include paths. Genius! Hardcoding the new version for the time being... + - export CFLAGS="$CFLAGS -I/usr/local/opt/openssl@1.1/include" + - export LDFLAGS="$LDFLAGS -L/usr/local/opt/openssl@1.1/lib" - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then PATH=/usr/local/opt/ccache/libexec:$PATH; fi # Use ccache on Mac too #Coverity doesn't work with g++ 5 or 6, so only upgrade to g++ 4.9 for that - if [ "$TRAVIS_OS_NAME" == "linux" -a \( "$TASK" = "compile" -o "$TASK" = "sanitize" \) -a "$CC" = "gcc" ]; then export CC="ccache gcc-8"; export CXX="ccache g++-8"; fi -- cgit v1.2.3