Browse Source

Simplify plugin building and set up source tree run environment

This sets up LV2_PATH in waf tests so that tests can use specifications and
plugins from the source tree without installing.
zrythm_meson
David Robillard 3 years ago
parent
commit
cb046d7b5e
  1. 15
      plugins/eg-amp.lv2/wscript
  2. 15
      plugins/eg-fifths.lv2/wscript
  3. 15
      plugins/eg-metro.lv2/wscript
  4. 15
      plugins/eg-midigate.lv2/wscript
  5. 15
      plugins/eg-params.lv2/wscript
  6. 20
      plugins/eg-sampler.lv2/wscript
  7. 18
      plugins/eg-scope.lv2/wscript
  8. 2
      waflib
  9. 5
      wscript

15
plugins/eg-amp.lv2/wscript

@ -27,30 +27,25 @@ def configure(conf): @@ -27,30 +27,25 @@ def configure(conf):
def build(bld):
bundle = 'eg-amp.lv2'
# Make a pattern for shared objects without the 'lib' prefix
module_pat = re.sub('^lib', '', bld.env.cshlib_PATTERN)
module_ext = module_pat[module_pat.rfind('.'):]
# Build manifest.ttl by substitution (for portable lib extension)
bld(features = 'subst',
source = 'manifest.ttl.in',
target = '%s/%s' % (bundle, 'manifest.ttl'),
target = 'lv2/%s/%s' % (bundle, 'manifest.ttl'),
install_path = '${LV2DIR}/%s' % bundle,
LIB_EXT = module_ext)
LIB_EXT = bld.env.LV2_LIB_EXT)
# Copy other data files to build bundle (build/eg-amp.lv2)
for i in ['amp.ttl']:
bld(features = 'subst',
is_copy = True,
source = i,
target = '%s/%s' % (bundle, i),
target = 'lv2/%s/%s' % (bundle, i),
install_path = '${LV2DIR}/%s' % bundle)
# Build plugin library
obj = bld(features = 'c cshlib',
obj = bld(features = 'c cshlib lv2lib',
source = 'amp.c',
name = 'amp',
target = '%s/amp' % bundle,
target = 'lv2/%s/amp' % bundle,
install_path = '${LV2DIR}/%s' % bundle,
uselib = 'M LV2')
obj.env.cshlib_PATTERN = module_pat

15
plugins/eg-fifths.lv2/wscript

@ -25,30 +25,25 @@ def configure(conf): @@ -25,30 +25,25 @@ def configure(conf):
def build(bld):
bundle = 'eg-fifths.lv2'
# Make a pattern for shared objects without the 'lib' prefix
module_pat = re.sub('^lib', '', bld.env.cshlib_PATTERN)
module_ext = module_pat[module_pat.rfind('.'):]
# Build manifest.ttl by substitution (for portable lib extension)
bld(features = 'subst',
source = 'manifest.ttl.in',
target = '%s/%s' % (bundle, 'manifest.ttl'),
target = 'lv2/%s/%s' % (bundle, 'manifest.ttl'),
install_path = '${LV2DIR}/%s' % bundle,
LIB_EXT = module_ext)
LIB_EXT = bld.env.LV2_LIB_EXT)
# Copy other data files to build bundle (build/eg-fifths.lv2)
for i in ['fifths.ttl']:
bld(features = 'subst',
is_copy = True,
source = i,
target = '%s/%s' % (bundle, i),
target = 'lv2/%s/%s' % (bundle, i),
install_path = '${LV2DIR}/%s' % bundle)
# Build plugin library
obj = bld(features = 'c cshlib',
obj = bld(features = 'c cshlib lv2lib',
source = 'fifths.c',
name = 'fifths',
target = '%s/fifths' % bundle,
target = 'lv2/%s/fifths' % bundle,
install_path = '${LV2DIR}/%s' % bundle,
use = 'LV2')
obj.env.cshlib_PATTERN = module_pat

15
plugins/eg-metro.lv2/wscript

@ -27,29 +27,24 @@ def configure(conf): @@ -27,29 +27,24 @@ def configure(conf):
def build(bld):
bundle = 'eg-metro.lv2'
# Make a pattern for shared objects without the 'lib' prefix
module_pat = re.sub('^lib', '', bld.env.cshlib_PATTERN)
module_ext = module_pat[module_pat.rfind('.'):]
# Build manifest.ttl by substitution (for portable lib extension)
bld(features = 'subst',
source = 'manifest.ttl.in',
target = '%s/%s' % (bundle, 'manifest.ttl'),
target = 'lv2/%s/%s' % (bundle, 'manifest.ttl'),
install_path = '${LV2DIR}/%s' % bundle,
LIB_EXT = module_ext)
LIB_EXT = bld.env.LV2_LIB_EXT)
# Copy other data files to build bundle (build/eg-metro.lv2)
bld(features = 'subst',
is_copy = True,
source = 'metro.ttl',
target = '%s/metro.ttl' % bundle,
target = 'lv2/%s/metro.ttl' % bundle,
install_path = '${LV2DIR}/%s' % bundle)
# Build plugin library
obj = bld(features = 'c cshlib',
obj = bld(features = 'c cshlib lv2lib',
source = 'metro.c',
name = 'metro',
target = '%s/metro' % bundle,
target = 'lv2/%s/metro' % bundle,
install_path = '${LV2DIR}/%s' % bundle,
use = ['M', 'LV2'])
obj.env.cshlib_PATTERN = module_pat

15
plugins/eg-midigate.lv2/wscript

@ -25,30 +25,25 @@ def configure(conf): @@ -25,30 +25,25 @@ def configure(conf):
def build(bld):
bundle = 'eg-midigate.lv2'
# Make a pattern for shared objects without the 'lib' prefix
module_pat = re.sub('^lib', '', bld.env.cshlib_PATTERN)
module_ext = module_pat[module_pat.rfind('.'):]
# Build manifest.ttl by substitution (for portable lib extension)
bld(features = 'subst',
source = 'manifest.ttl.in',
target = '%s/%s' % (bundle, 'manifest.ttl'),
target = 'lv2/%s/%s' % (bundle, 'manifest.ttl'),
install_path = '${LV2DIR}/%s' % bundle,
LIB_EXT = module_ext)
LIB_EXT = bld.env.LV2_LIB_EXT)
# Copy other data files to build bundle (build/eg-midigate.lv2)
for i in ['midigate.ttl']:
bld(features = 'subst',
is_copy = True,
source = i,
target = '%s/%s' % (bundle, i),
target = 'lv2/%s/%s' % (bundle, i),
install_path = '${LV2DIR}/%s' % bundle)
# Build plugin library
obj = bld(features = 'c cshlib',
obj = bld(features = 'c cshlib lv2lib',
source = 'midigate.c',
name = 'midigate',
target = '%s/midigate' % bundle,
target = 'lv2/%s/midigate' % bundle,
install_path = '${LV2DIR}/%s' % bundle,
uselib = 'LV2')
obj.env.cshlib_PATTERN = module_pat

15
plugins/eg-params.lv2/wscript

@ -25,30 +25,25 @@ def configure(conf): @@ -25,30 +25,25 @@ def configure(conf):
def build(bld):
bundle = 'eg-params.lv2'
# Make a pattern for shared objects without the 'lib' prefix
module_pat = re.sub('^lib', '', bld.env.cshlib_PATTERN)
module_ext = module_pat[module_pat.rfind('.'):]
# Build manifest.ttl by substitution (for portable lib extension)
bld(features = 'subst',
source = 'manifest.ttl.in',
target = '%s/%s' % (bundle, 'manifest.ttl'),
target = 'lv2/%s/%s' % (bundle, 'manifest.ttl'),
install_path = '${LV2DIR}/%s' % bundle,
LIB_EXT = module_ext)
LIB_EXT = bld.env.LV2_LIB_EXT)
# Copy other data files to build bundle (build/eg-params.lv2)
for i in ['params.ttl']:
bld(features = 'subst',
is_copy = True,
source = i,
target = '%s/%s' % (bundle, i),
target = 'lv2/%s/%s' % (bundle, i),
install_path = '${LV2DIR}/%s' % bundle)
# Build plugin library
obj = bld(features = 'c cshlib',
obj = bld(features = 'c cshlib lv2lib',
source = 'params.c',
name = 'params',
target = '%s/params' % bundle,
target = 'lv2/%s/params' % bundle,
install_path = '${LV2DIR}/%s' % bundle,
use = 'LV2')
obj.env.cshlib_PATTERN = module_pat

20
plugins/eg-sampler.lv2/wscript

@ -31,40 +31,34 @@ def configure(conf): @@ -31,40 +31,34 @@ def configure(conf):
def build(bld):
bundle = 'eg-sampler.lv2'
# Make a pattern for shared objects without the 'lib' prefix
module_pat = re.sub('^lib', '', bld.env.cshlib_PATTERN)
module_ext = module_pat[module_pat.rfind('.'):]
# Build manifest.ttl by substitution (for portable lib extension)
bld(features = 'subst',
source = 'manifest.ttl.in',
target = '%s/%s' % (bundle, 'manifest.ttl'),
target = 'lv2/%s/%s' % (bundle, 'manifest.ttl'),
install_path = '${LV2DIR}/%s' % bundle,
LIB_EXT = module_ext)
LIB_EXT = bld.env.LV2_LIB_EXT)
# Copy other data files to build bundle (build/eg-sampler.lv2)
for i in ['sampler.ttl', 'click.wav']:
bld(features = 'subst',
is_copy = True,
source = i,
target = '%s/%s' % (bundle, i),
target = 'lv2/%s/%s' % (bundle, i),
install_path = '${LV2DIR}/%s' % bundle)
# Build plugin library
obj = bld(features = 'c cshlib',
obj = bld(features = 'c cshlib lv2lib',
source = 'sampler.c',
name = 'sampler',
target = '%s/sampler' % bundle,
target = 'lv2/%s/sampler' % bundle,
install_path = '${LV2DIR}/%s' % bundle,
use = ['M', 'SNDFILE', 'LV2'])
obj.env.cshlib_PATTERN = module_pat
# Build UI library
if bld.env.HAVE_GTK2:
obj = bld(features = 'c cshlib',
obj = bld(features = 'c cshlib lv2lib',
source = 'sampler_ui.c',
name = 'sampler_ui',
target = '%s/sampler_ui' % bundle,
target = 'lv2/%s/sampler_ui' % bundle,
install_path = '${LV2DIR}/%s' % bundle,
use = ['GTK2', 'LV2'])
obj.env.cshlib_PATTERN = module_pat

18
plugins/eg-scope.lv2/wscript

@ -30,33 +30,27 @@ def configure(conf): @@ -30,33 +30,27 @@ def configure(conf):
def build(bld):
bundle = 'eg-scope.lv2'
# Make a pattern for shared objects without the 'lib' prefix
module_pat = re.sub('^lib', '', bld.env.cshlib_PATTERN)
module_ext = module_pat[module_pat.rfind('.'):]
# Build manifest.ttl by substitution (for portable lib extension)
for i in ['manifest.ttl', 'examploscope.ttl']:
bld(features = 'subst',
source = i + '.in',
target = '%s/%s' % (bundle, i),
target = 'lv2/%s/%s' % (bundle, i),
install_path = '${LV2DIR}/%s' % bundle,
LIB_EXT = module_ext)
LIB_EXT = bld.env.LV2_LIB_EXT)
# Build plugin library
obj = bld(features = 'c cshlib',
obj = bld(features = 'c cshlib lv2lib',
source = 'examploscope.c',
name = 'examploscope',
target = '%s/examploscope' % bundle,
target = 'lv2/%s/examploscope' % bundle,
install_path = '${LV2DIR}/%s' % bundle,
use = 'LV2')
obj.env.cshlib_PATTERN = module_pat
# Build UI library
if bld.env.HAVE_GTK2:
obj = bld(features = 'c cshlib',
obj = bld(features = 'c cshlib lv2lib',
source = 'examploscope_ui.c',
name = 'examploscope_ui',
target = '%s/examploscope_ui' % bundle,
target = 'lv2/%s/examploscope_ui' % bundle,
install_path = '${LV2DIR}/%s' % bundle,
use = 'GTK2 CAIRO LV2')
obj.env.cshlib_PATTERN = module_pat

2
waflib

@ -1 +1 @@ @@ -1 +1 @@
Subproject commit de76b89dc1039e2f7d6c6b229a8950156b0e5c94
Subproject commit c87cc53c643c60867665b333d5999fe07196d543

5
wscript

@ -97,6 +97,9 @@ def configure(conf): @@ -97,6 +97,9 @@ def configure(conf):
autowaf.set_lib_env(conf, 'lv2', VERSION, has_objects=False)
autowaf.set_local_lib(conf, 'lv2', has_objects=False)
conf.run_env.append_unique('LV2_PATH',
[os.path.join(conf.path.abspath(), 'lv2')])
if conf.env.BUILD_PLUGINS:
for i in ['eg-amp.lv2',
'eg-fifths.lv2',
@ -109,6 +112,8 @@ def configure(conf): @@ -109,6 +112,8 @@ def configure(conf):
path = os.path.join('plugins', i)
conf.recurse(path)
conf.env.LV2_BUILD += [path]
conf.run_env.append_unique(
'LV2_PATH', [conf.build_path('plugins/%s/lv2' % i)])
except Exception as e:
Logs.warn('Configuration failed, not building %s (%s)' % (i, e))

Loading…
Cancel
Save