From 326a46ce9f5c9abe730da55a7f6f339578b41ae8 Mon Sep 17 00:00:00 2001 From: Nils <> Date: Sat, 20 Jun 2020 01:13:32 +0200 Subject: [PATCH] Meson build targets now options. Reflect in readme --- CHANGELOG | 1 + README.md | 24 ++++++++++++++--- meson.build | 65 ++++++++++++++++++++++++++++++++--------------- meson_options.txt | 6 +++++ 4 files changed, 72 insertions(+), 24 deletions(-) create mode 100644 meson_options.txt diff --git a/CHANGELOG b/CHANGELOG index 54dbbde..cedd7c2 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,6 @@ v1.3.1 Add header copyright even to unchanged files to adhere to stricter packaging requirements. +Meson can now switch off individual executables and will stop/error when trying to build without dependencies. v1.3 Rebranding to "new session manager" diff --git a/README.md b/README.md index eeb3783..65df995 100644 --- a/README.md +++ b/README.md @@ -61,16 +61,34 @@ See file COPYING ## Build The build system is meson. -This repository builds `nsmd` and `jackpatch`. Dependencies are `JACK Audio Connection Kit` and -`liblo`, the OSC library. If your system has `FLTK` installed (detected by the first step below) -meson will enable building of `nsm-proxy` and legacy GUI `new-session-manager` as well. +This is a software package that will compile and install multiple executables: +* `nsmd`, the daemon or server itself. It is mandatory. + * It has no GUI. + * Dependencies are `JACK Audio Connection Kit` and liblo`, the OSC library. +* `jackpatch`, NSM client to save and remember JACK connections. + * It has no GUI. + * Dependencies are `JACK Audio Connection Kit` and `liblo`, the OSC library. + * Can be deactivated (see below) `-Djackpatch=false` +* `new-session-manager`, Legacy GUI for the user + * Dependencies are `FLTK` and `liblo`, the OSC library. + * Can be deactivated (see below) `-Dnew-session-manager=false` +* `nsm-proxy`, NSM GUI Client to run any program without direct NSM support + * Dependencies are `FLTK`, `fluid` (FLTK Editor/compiler, maybe in the same package as FLTK, maybe not) and `liblo`, the OSC library. + * Can be deactivated (see below) `-Dnsm-proxy=false` + ``` meson build --prefix=/usr +#or disable individual build targets: +#meson build --prefix=/usr -Dnew-session-manager=false -Dnsm-proxy=false -Djackpatch=false cd build && ninja sudo ninja install ``` +Optionally you can skip `sudo ninja install` and run all executables from the build-dir. +In this case you need to add the build-dir to your PATH environment variable so that the tools +can find each other. + ## Names of Executable Files and Symlinks Some distributions (and possibly local laws) prevent a forked software project from creating diff --git a/meson.build b/meson.build index a7b6d69..a599fa2 100644 --- a/meson.build +++ b/meson.build @@ -17,27 +17,24 @@ # along with New-Session-Manager. If not, see . ############################################################################## -project('new-session-manager', 'c', 'cpp', version : '1.3.0', license : 'GPLv3') +project('new-session-manager', 'c', 'cpp', version : '1.3.1', license : 'GPLv3') + +############## +#Dependencies +############## liblodep = dependency('liblo') #and not 'lo' threaddep = dependency('threads') -jackdep = dependency('jack') #and not 'libjack' +jackdep = dependency('jack', required: get_option('jackpatch')) #and not 'libjack' cc = meson.get_compiler('c') -fluid = find_program('fluid', required: false) -fltkdep = cc.find_library('fltk', required: false) +fltkdep = cc.find_library('fltk', required: get_option('new-session-manager') or get_option('nsm-proxy')) +fluid = find_program('fluid', required: get_option('nsm-proxy')) -executable('jackpatch', - 'src/jackpatch.c', - dependencies: [liblodep, jackdep], - install: true, - ) -executable('nsm-proxy', - sources: ['src/nsm-proxy.cpp', 'src/debug.cpp'], - dependencies: [liblodep, threaddep], - install: true, - ) +############## +#Build Targets +############## executable('nsmd', sources: ['src/nsmd.cpp', 'src/debug.cpp', 'src/Endpoint.cpp', 'src/file.cpp', 'src/Thread.cpp'], @@ -45,7 +42,22 @@ executable('nsmd', install: true, ) -if fluid.found() and fltkdep.found() + +#For options see meson_options.txt +#All get_options are default=true + +if get_option('jackpatch') + + executable('jackpatch', + 'src/jackpatch.c', + dependencies: [liblodep, jackdep], + install: true, + ) +endif + + +if get_option('nsm-proxy') + NSM_Proxy_UI_cpp = custom_target( 'NSM_Proxy_UI.cpp', output : 'NSM_Proxy_UI.C', @@ -60,10 +72,26 @@ if fluid.found() and fltkdep.found() command : [fluid, '-c', '-h', '@OUTPUT@', '@INPUT@'], ) + + executable('nsm-proxy', + sources: ['src/nsm-proxy.cpp', 'src/debug.cpp'], + dependencies: [liblodep, threaddep], + install: true, + ) + + executable('nsm-proxy-gui', + sources: ['src/nsm-proxy-gui.cpp', [NSM_Proxy_UI_cpp, NSM_Proxy_UI_h]], + dependencies: [fltkdep, liblodep, threaddep], + install: true, + ) +endif + +if get_option('new-session-manager') + executable('new-session-manager', sources: ['src/session-manager.cpp', 'src/debug.cpp', 'src/Endpoint.cpp', 'src/Thread.cpp', 'src/FL/Fl_Scalepack.C'], dependencies: [fltkdep, liblodep, threaddep], - install: true, + install: true, ) install_data('src/org.linuxaudio.new-session-manager.desktop', install_dir : get_option('datadir') / 'applications') @@ -72,9 +100,4 @@ if fluid.found() and fltkdep.found() 'ln -sf new-session-manager ${DESTDIR}@0@/@1@/non-session-manager'.format( get_option('prefix'), get_option('bindir'))) - executable('nsm-proxy-gui', - sources: ['src/nsm-proxy-gui.cpp', [NSM_Proxy_UI_cpp, NSM_Proxy_UI_h]], - dependencies: [fltkdep, liblodep, threaddep], - install: true, - ) endif diff --git a/meson_options.txt b/meson_options.txt new file mode 100644 index 0000000..1800be3 --- /dev/null +++ b/meson_options.txt @@ -0,0 +1,6 @@ +option('new-session-manager', type : 'boolean', value : true, description : 'Build new-session-manager GUI') +option('jackpatch', type : 'boolean', value : true, description : 'Build jackpatch client') +option('nsm-proxy', type : 'boolean', value : true, description : 'Build nsm-proxy client with GUI.') + + +