diff options
95 files changed, 241 insertions, 151 deletions
diff --git a/ext.pc.template b/ext.pc.in index 88ea421..88ea421 100644 --- a/ext.pc.template +++ b/ext.pc.in diff --git a/ext.wscript b/ext.wscript new file mode 100644 index 0000000..43f04c0 --- /dev/null +++ b/ext.wscript @@ -0,0 +1,116 @@ +#!/usr/bin/env python +import os +import sys +import shutil +from waflib.extras import autowaf as autowaf +import waflib.Scripting as Scripting +import waflib.Logs as Logs +import waflib.Options as Options +import waflib.Context as Context +import waflib.Utils as Utils + +info = None + +try: + import lv2extinfo + info = lv2extinfo +except: + try: + import rdflib + doap = rdflib.Namespace('http://usefulinc.com/ns/doap#') + rdf = rdflib.Namespace('http://www.w3.org/1999/02/22-rdf-syntax-ns#') + lv2 = rdflib.Namespace('http://lv2plug.in/ns/lv2core#') + + dir = sys.path[0] + + m = rdflib.ConjunctiveGraph() + m.parse(os.path.join(dir, 'manifest.ttl'), format='n3') + + spec = m.value(None, rdf.type, lv2.Specification) + uri = str(spec) + name = os.path.basename(uri.replace('http://', '')) + + m.parse(os.path.join(dir, name + '.ttl'), format='n3') + + pkgname = 'lv2-' + uri.replace('http://', '').replace('/', '-') + info = type('lv2extinfo', (object,), + {'NAME' : name, + 'MINOR' : int(m.value(spec, lv2.minorVersion, None)), + 'MICRO' : int(m.value(spec, lv2.microVersion, None)), + 'URI' : str(spec), + 'PKGCONFIG_NAME' : pkgname, + 'SHORTDESC' : str(m.value(spec, doap.shortdesc, None))}) + except: + e = sys.exc_info()[1] + Logs.error('Error reading version information: ' + str(e)) + +if not info: + Logs.error("Failed to find version information from lv2extinfo.py or RDF") + sys.exit(1) + +# Variables for 'waf dist' +APPNAME = 'lv2-' + info.NAME +VERSION = '%d.%d' % (info.MINOR, info.MICRO) + +# Mandatory variables +top = '.' +out = 'build' + +def options(opt): + autowaf.set_options(opt) + opt.add_option('--copy-headers', action='store_true', default=False, + dest='copy_headers', + help='Copy headers instead of linking to bundle') + opt.add_option('--experimental', action='store_true', default=False, + dest='experimental', + help='Install unreleased experimental extensions') + +def should_build(ctx): + top_level = (len(ctx.stack_path) <= 1) + return top_level or Options.options.experimental or ( + info.MINOR > 0 and info.MICRO % 2 == 0) + +def configure(conf): + if not should_build(conf): + return + + autowaf.configure(conf) + autowaf.display_header('LV2 %s Configuration' % info.NAME) + conf.env['COPY_HEADERS'] = Options.options.copy_headers + autowaf.display_msg(conf, 'LV2 bundle directory', conf.env['LV2DIR']) + autowaf.display_msg(conf, 'URI', info.URI) + autowaf.display_msg(conf, 'Version', VERSION) + autowaf.display_msg(conf, 'Pkgconfig name', info.PKGCONFIG_NAME) + print('') + +def build(bld): + if not should_build(bld): + return + + uri = info.URI + include_base = os.path.dirname(uri[uri.find('://') + 3:]) + bundle_dir = os.path.join(bld.env['LV2DIR'], info.NAME + '.lv2') + include_dir = os.path.join(bld.env['INCLUDEDIR'], 'lv2', include_base) + + # Pkgconfig file + obj = bld(features = 'subst', + source = 'ext.pc.in', + target = info.PKGCONFIG_NAME + '.pc', + install_path = '${LIBDIR}/pkgconfig', + INCLUDEDIR = bld.env['INCLUDEDIR'], + INCLUDE_PATH = uri.replace('http://', 'lv2/'), + NAME = info.NAME, + VERSION = VERSION, + DESCRIPTION = info.SHORTDESC) + + # Install bundle + bld.install_files(bundle_dir, + bld.path.ant_glob('?*.*', excl='*.pc.in')) + + # Install URI-like includes + if bld.env['COPY_HEADERS']: + bld.install_files(os.path.join(include_dir, info.NAME), + bld.path.ant_glob('*.h')) + else: + bld.symlink_as(os.path.join(include_dir, info.NAME), + os.path.relpath(bundle_dir, include_dir)) diff --git a/ext/atom.lv2/ext.pc.in b/ext/atom.lv2/ext.pc.in new file mode 120000 index 0000000..950cb3b --- /dev/null +++ b/ext/atom.lv2/ext.pc.in @@ -0,0 +1 @@ +../../ext.pc.in
\ No newline at end of file diff --git a/ext/atom.lv2/waf b/ext/atom.lv2/waf new file mode 120000 index 0000000..59a1ac9 --- /dev/null +++ b/ext/atom.lv2/waf @@ -0,0 +1 @@ +../../waf
\ No newline at end of file diff --git a/ext/atom.lv2/wscript b/ext/atom.lv2/wscript new file mode 120000 index 0000000..b82a3d0 --- /dev/null +++ b/ext/atom.lv2/wscript @@ -0,0 +1 @@ +../../ext.wscript
\ No newline at end of file diff --git a/ext/contexts.lv2/ext.pc.in b/ext/contexts.lv2/ext.pc.in new file mode 120000 index 0000000..950cb3b --- /dev/null +++ b/ext/contexts.lv2/ext.pc.in @@ -0,0 +1 @@ +../../ext.pc.in
\ No newline at end of file diff --git a/ext/contexts.lv2/waf b/ext/contexts.lv2/waf new file mode 120000 index 0000000..59a1ac9 --- /dev/null +++ b/ext/contexts.lv2/waf @@ -0,0 +1 @@ +../../waf
\ No newline at end of file diff --git a/ext/contexts.lv2/wscript b/ext/contexts.lv2/wscript new file mode 120000 index 0000000..b82a3d0 --- /dev/null +++ b/ext/contexts.lv2/wscript @@ -0,0 +1 @@ +../../ext.wscript
\ No newline at end of file diff --git a/ext/cv-port.lv2/ext.pc.in b/ext/cv-port.lv2/ext.pc.in new file mode 120000 index 0000000..950cb3b --- /dev/null +++ b/ext/cv-port.lv2/ext.pc.in @@ -0,0 +1 @@ +../../ext.pc.in
\ No newline at end of file diff --git a/ext/cv-port.lv2/waf b/ext/cv-port.lv2/waf new file mode 120000 index 0000000..59a1ac9 --- /dev/null +++ b/ext/cv-port.lv2/waf @@ -0,0 +1 @@ +../../waf
\ No newline at end of file diff --git a/ext/cv-port.lv2/wscript b/ext/cv-port.lv2/wscript new file mode 120000 index 0000000..b82a3d0 --- /dev/null +++ b/ext/cv-port.lv2/wscript @@ -0,0 +1 @@ +../../ext.wscript
\ No newline at end of file diff --git a/ext/data-access.lv2/ext.pc.in b/ext/data-access.lv2/ext.pc.in new file mode 120000 index 0000000..950cb3b --- /dev/null +++ b/ext/data-access.lv2/ext.pc.in @@ -0,0 +1 @@ +../../ext.pc.in
\ No newline at end of file diff --git a/ext/data-access.lv2/waf b/ext/data-access.lv2/waf new file mode 120000 index 0000000..59a1ac9 --- /dev/null +++ b/ext/data-access.lv2/waf @@ -0,0 +1 @@ +../../waf
\ No newline at end of file diff --git a/ext/data-access.lv2/wscript b/ext/data-access.lv2/wscript new file mode 120000 index 0000000..b82a3d0 --- /dev/null +++ b/ext/data-access.lv2/wscript @@ -0,0 +1 @@ +../../ext.wscript
\ No newline at end of file diff --git a/ext/dyn-manifest.lv2/ext.pc.in b/ext/dyn-manifest.lv2/ext.pc.in new file mode 120000 index 0000000..950cb3b --- /dev/null +++ b/ext/dyn-manifest.lv2/ext.pc.in @@ -0,0 +1 @@ +../../ext.pc.in
\ No newline at end of file diff --git a/ext/dyn-manifest.lv2/waf b/ext/dyn-manifest.lv2/waf new file mode 120000 index 0000000..59a1ac9 --- /dev/null +++ b/ext/dyn-manifest.lv2/waf @@ -0,0 +1 @@ +../../waf
\ No newline at end of file diff --git a/ext/dyn-manifest.lv2/wscript b/ext/dyn-manifest.lv2/wscript new file mode 120000 index 0000000..b82a3d0 --- /dev/null +++ b/ext/dyn-manifest.lv2/wscript @@ -0,0 +1 @@ +../../ext.wscript
\ No newline at end of file diff --git a/ext/event.lv2/ext.pc.in b/ext/event.lv2/ext.pc.in new file mode 120000 index 0000000..950cb3b --- /dev/null +++ b/ext/event.lv2/ext.pc.in @@ -0,0 +1 @@ +../../ext.pc.in
\ No newline at end of file diff --git a/ext/event.lv2/waf b/ext/event.lv2/waf new file mode 120000 index 0000000..59a1ac9 --- /dev/null +++ b/ext/event.lv2/waf @@ -0,0 +1 @@ +../../waf
\ No newline at end of file diff --git a/ext/event.lv2/wscript b/ext/event.lv2/wscript new file mode 120000 index 0000000..b82a3d0 --- /dev/null +++ b/ext/event.lv2/wscript @@ -0,0 +1 @@ +../../ext.wscript
\ No newline at end of file diff --git a/ext/files.lv2/ext.pc.in b/ext/files.lv2/ext.pc.in new file mode 120000 index 0000000..950cb3b --- /dev/null +++ b/ext/files.lv2/ext.pc.in @@ -0,0 +1 @@ +../../ext.pc.in
\ No newline at end of file diff --git a/ext/files.lv2/waf b/ext/files.lv2/waf new file mode 120000 index 0000000..59a1ac9 --- /dev/null +++ b/ext/files.lv2/waf @@ -0,0 +1 @@ +../../waf
\ No newline at end of file diff --git a/ext/files.lv2/wscript b/ext/files.lv2/wscript new file mode 120000 index 0000000..b82a3d0 --- /dev/null +++ b/ext/files.lv2/wscript @@ -0,0 +1 @@ +../../ext.wscript
\ No newline at end of file diff --git a/ext/host-info.lv2/ext.pc.in b/ext/host-info.lv2/ext.pc.in new file mode 120000 index 0000000..950cb3b --- /dev/null +++ b/ext/host-info.lv2/ext.pc.in @@ -0,0 +1 @@ +../../ext.pc.in
\ No newline at end of file diff --git a/ext/host-info.lv2/waf b/ext/host-info.lv2/waf new file mode 120000 index 0000000..59a1ac9 --- /dev/null +++ b/ext/host-info.lv2/waf @@ -0,0 +1 @@ +../../waf
\ No newline at end of file diff --git a/ext/host-info.lv2/wscript b/ext/host-info.lv2/wscript new file mode 120000 index 0000000..b82a3d0 --- /dev/null +++ b/ext/host-info.lv2/wscript @@ -0,0 +1 @@ +../../ext.wscript
\ No newline at end of file diff --git a/ext/instance-access.lv2/ext.pc.in b/ext/instance-access.lv2/ext.pc.in new file mode 120000 index 0000000..950cb3b --- /dev/null +++ b/ext/instance-access.lv2/ext.pc.in @@ -0,0 +1 @@ +../../ext.pc.in
\ No newline at end of file diff --git a/ext/instance-access.lv2/waf b/ext/instance-access.lv2/waf new file mode 120000 index 0000000..59a1ac9 --- /dev/null +++ b/ext/instance-access.lv2/waf @@ -0,0 +1 @@ +../../waf
\ No newline at end of file diff --git a/ext/instance-access.lv2/wscript b/ext/instance-access.lv2/wscript new file mode 120000 index 0000000..b82a3d0 --- /dev/null +++ b/ext/instance-access.lv2/wscript @@ -0,0 +1 @@ +../../ext.wscript
\ No newline at end of file diff --git a/ext/midi.lv2/ext.pc.in b/ext/midi.lv2/ext.pc.in new file mode 120000 index 0000000..950cb3b --- /dev/null +++ b/ext/midi.lv2/ext.pc.in @@ -0,0 +1 @@ +../../ext.pc.in
\ No newline at end of file diff --git a/ext/midi.lv2/waf b/ext/midi.lv2/waf new file mode 120000 index 0000000..59a1ac9 --- /dev/null +++ b/ext/midi.lv2/waf @@ -0,0 +1 @@ +../../waf
\ No newline at end of file diff --git a/ext/midi.lv2/wscript b/ext/midi.lv2/wscript new file mode 120000 index 0000000..b82a3d0 --- /dev/null +++ b/ext/midi.lv2/wscript @@ -0,0 +1 @@ +../../ext.wscript
\ No newline at end of file diff --git a/ext/osc.lv2/ext.pc.in b/ext/osc.lv2/ext.pc.in new file mode 120000 index 0000000..950cb3b --- /dev/null +++ b/ext/osc.lv2/ext.pc.in @@ -0,0 +1 @@ +../../ext.pc.in
\ No newline at end of file diff --git a/ext/osc.lv2/waf b/ext/osc.lv2/waf new file mode 120000 index 0000000..59a1ac9 --- /dev/null +++ b/ext/osc.lv2/waf @@ -0,0 +1 @@ +../../waf
\ No newline at end of file diff --git a/ext/osc.lv2/wscript b/ext/osc.lv2/wscript new file mode 120000 index 0000000..b82a3d0 --- /dev/null +++ b/ext/osc.lv2/wscript @@ -0,0 +1 @@ +../../ext.wscript
\ No newline at end of file diff --git a/ext/parameter.lv2/ext.pc.in b/ext/parameter.lv2/ext.pc.in new file mode 120000 index 0000000..950cb3b --- /dev/null +++ b/ext/parameter.lv2/ext.pc.in @@ -0,0 +1 @@ +../../ext.pc.in
\ No newline at end of file diff --git a/ext/parameter.lv2/waf b/ext/parameter.lv2/waf new file mode 120000 index 0000000..59a1ac9 --- /dev/null +++ b/ext/parameter.lv2/waf @@ -0,0 +1 @@ +../../waf
\ No newline at end of file diff --git a/ext/parameter.lv2/wscript b/ext/parameter.lv2/wscript new file mode 120000 index 0000000..b82a3d0 --- /dev/null +++ b/ext/parameter.lv2/wscript @@ -0,0 +1 @@ +../../ext.wscript
\ No newline at end of file diff --git a/ext/persist.lv2/ext.pc.in b/ext/persist.lv2/ext.pc.in new file mode 120000 index 0000000..950cb3b --- /dev/null +++ b/ext/persist.lv2/ext.pc.in @@ -0,0 +1 @@ +../../ext.pc.in
\ No newline at end of file diff --git a/ext/persist.lv2/waf b/ext/persist.lv2/waf new file mode 120000 index 0000000..59a1ac9 --- /dev/null +++ b/ext/persist.lv2/waf @@ -0,0 +1 @@ +../../waf
\ No newline at end of file diff --git a/ext/persist.lv2/wscript b/ext/persist.lv2/wscript new file mode 120000 index 0000000..b82a3d0 --- /dev/null +++ b/ext/persist.lv2/wscript @@ -0,0 +1 @@ +../../ext.wscript
\ No newline at end of file diff --git a/ext/port-groups.lv2/ext.pc.in b/ext/port-groups.lv2/ext.pc.in new file mode 120000 index 0000000..950cb3b --- /dev/null +++ b/ext/port-groups.lv2/ext.pc.in @@ -0,0 +1 @@ +../../ext.pc.in
\ No newline at end of file diff --git a/ext/port-groups.lv2/waf b/ext/port-groups.lv2/waf new file mode 120000 index 0000000..59a1ac9 --- /dev/null +++ b/ext/port-groups.lv2/waf @@ -0,0 +1 @@ +../../waf
\ No newline at end of file diff --git a/ext/port-groups.lv2/wscript b/ext/port-groups.lv2/wscript new file mode 120000 index 0000000..b82a3d0 --- /dev/null +++ b/ext/port-groups.lv2/wscript @@ -0,0 +1 @@ +../../ext.wscript
\ No newline at end of file diff --git a/ext/port-props.lv2/ext.pc.in b/ext/port-props.lv2/ext.pc.in new file mode 120000 index 0000000..950cb3b --- /dev/null +++ b/ext/port-props.lv2/ext.pc.in @@ -0,0 +1 @@ +../../ext.pc.in
\ No newline at end of file diff --git a/ext/port-props.lv2/waf b/ext/port-props.lv2/waf new file mode 120000 index 0000000..59a1ac9 --- /dev/null +++ b/ext/port-props.lv2/waf @@ -0,0 +1 @@ +../../waf
\ No newline at end of file diff --git a/ext/port-props.lv2/wscript b/ext/port-props.lv2/wscript new file mode 120000 index 0000000..b82a3d0 --- /dev/null +++ b/ext/port-props.lv2/wscript @@ -0,0 +1 @@ +../../ext.wscript
\ No newline at end of file diff --git a/ext/presets.lv2/ext.pc.in b/ext/presets.lv2/ext.pc.in new file mode 120000 index 0000000..950cb3b --- /dev/null +++ b/ext/presets.lv2/ext.pc.in @@ -0,0 +1 @@ +../../ext.pc.in
\ No newline at end of file diff --git a/ext/presets.lv2/waf b/ext/presets.lv2/waf new file mode 120000 index 0000000..59a1ac9 --- /dev/null +++ b/ext/presets.lv2/waf @@ -0,0 +1 @@ +../../waf
\ No newline at end of file diff --git a/ext/presets.lv2/wscript b/ext/presets.lv2/wscript new file mode 120000 index 0000000..b82a3d0 --- /dev/null +++ b/ext/presets.lv2/wscript @@ -0,0 +1 @@ +../../ext.wscript
\ No newline at end of file diff --git a/ext/pui-event.lv2/ext.pc.in b/ext/pui-event.lv2/ext.pc.in new file mode 120000 index 0000000..950cb3b --- /dev/null +++ b/ext/pui-event.lv2/ext.pc.in @@ -0,0 +1 @@ +../../ext.pc.in
\ No newline at end of file diff --git a/ext/pui-event.lv2/waf b/ext/pui-event.lv2/waf new file mode 120000 index 0000000..59a1ac9 --- /dev/null +++ b/ext/pui-event.lv2/waf @@ -0,0 +1 @@ +../../waf
\ No newline at end of file diff --git a/ext/pui-event.lv2/wscript b/ext/pui-event.lv2/wscript new file mode 120000 index 0000000..b82a3d0 --- /dev/null +++ b/ext/pui-event.lv2/wscript @@ -0,0 +1 @@ +../../ext.wscript
\ No newline at end of file diff --git a/ext/pui-gtk.lv2/ext.pc.in b/ext/pui-gtk.lv2/ext.pc.in new file mode 120000 index 0000000..950cb3b --- /dev/null +++ b/ext/pui-gtk.lv2/ext.pc.in @@ -0,0 +1 @@ +../../ext.pc.in
\ No newline at end of file diff --git a/ext/pui-gtk.lv2/waf b/ext/pui-gtk.lv2/waf new file mode 120000 index 0000000..59a1ac9 --- /dev/null +++ b/ext/pui-gtk.lv2/waf @@ -0,0 +1 @@ +../../waf
\ No newline at end of file diff --git a/ext/pui-gtk.lv2/wscript b/ext/pui-gtk.lv2/wscript new file mode 120000 index 0000000..b82a3d0 --- /dev/null +++ b/ext/pui-gtk.lv2/wscript @@ -0,0 +1 @@ +../../ext.wscript
\ No newline at end of file diff --git a/ext/pui.lv2/ext.pc.in b/ext/pui.lv2/ext.pc.in new file mode 120000 index 0000000..950cb3b --- /dev/null +++ b/ext/pui.lv2/ext.pc.in @@ -0,0 +1 @@ +../../ext.pc.in
\ No newline at end of file diff --git a/ext/pui.lv2/waf b/ext/pui.lv2/waf new file mode 120000 index 0000000..59a1ac9 --- /dev/null +++ b/ext/pui.lv2/waf @@ -0,0 +1 @@ +../../waf
\ No newline at end of file diff --git a/ext/pui.lv2/wscript b/ext/pui.lv2/wscript new file mode 120000 index 0000000..b82a3d0 --- /dev/null +++ b/ext/pui.lv2/wscript @@ -0,0 +1 @@ +../../ext.wscript
\ No newline at end of file diff --git a/ext/reference.lv2/ext.pc.in b/ext/reference.lv2/ext.pc.in new file mode 120000 index 0000000..950cb3b --- /dev/null +++ b/ext/reference.lv2/ext.pc.in @@ -0,0 +1 @@ +../../ext.pc.in
\ No newline at end of file diff --git a/ext/reference.lv2/waf b/ext/reference.lv2/waf new file mode 120000 index 0000000..59a1ac9 --- /dev/null +++ b/ext/reference.lv2/waf @@ -0,0 +1 @@ +../../waf
\ No newline at end of file diff --git a/ext/reference.lv2/wscript b/ext/reference.lv2/wscript new file mode 120000 index 0000000..b82a3d0 --- /dev/null +++ b/ext/reference.lv2/wscript @@ -0,0 +1 @@ +../../ext.wscript
\ No newline at end of file diff --git a/ext/resize-port.lv2/ext.pc.in b/ext/resize-port.lv2/ext.pc.in new file mode 120000 index 0000000..950cb3b --- /dev/null +++ b/ext/resize-port.lv2/ext.pc.in @@ -0,0 +1 @@ +../../ext.pc.in
\ No newline at end of file diff --git a/ext/resize-port.lv2/waf b/ext/resize-port.lv2/waf new file mode 120000 index 0000000..59a1ac9 --- /dev/null +++ b/ext/resize-port.lv2/waf @@ -0,0 +1 @@ +../../waf
\ No newline at end of file diff --git a/ext/resize-port.lv2/wscript b/ext/resize-port.lv2/wscript new file mode 120000 index 0000000..b82a3d0 --- /dev/null +++ b/ext/resize-port.lv2/wscript @@ -0,0 +1 @@ +../../ext.wscript
\ No newline at end of file diff --git a/ext/state.lv2/ext.pc.in b/ext/state.lv2/ext.pc.in new file mode 120000 index 0000000..950cb3b --- /dev/null +++ b/ext/state.lv2/ext.pc.in @@ -0,0 +1 @@ +../../ext.pc.in
\ No newline at end of file diff --git a/ext/state.lv2/waf b/ext/state.lv2/waf new file mode 120000 index 0000000..59a1ac9 --- /dev/null +++ b/ext/state.lv2/waf @@ -0,0 +1 @@ +../../waf
\ No newline at end of file diff --git a/ext/state.lv2/wscript b/ext/state.lv2/wscript new file mode 120000 index 0000000..b82a3d0 --- /dev/null +++ b/ext/state.lv2/wscript @@ -0,0 +1 @@ +../../ext.wscript
\ No newline at end of file diff --git a/ext/string-port.lv2/ext.pc.in b/ext/string-port.lv2/ext.pc.in new file mode 120000 index 0000000..950cb3b --- /dev/null +++ b/ext/string-port.lv2/ext.pc.in @@ -0,0 +1 @@ +../../ext.pc.in
\ No newline at end of file diff --git a/ext/string-port.lv2/waf b/ext/string-port.lv2/waf new file mode 120000 index 0000000..59a1ac9 --- /dev/null +++ b/ext/string-port.lv2/waf @@ -0,0 +1 @@ +../../waf
\ No newline at end of file diff --git a/ext/string-port.lv2/wscript b/ext/string-port.lv2/wscript new file mode 120000 index 0000000..b82a3d0 --- /dev/null +++ b/ext/string-port.lv2/wscript @@ -0,0 +1 @@ +../../ext.wscript
\ No newline at end of file diff --git a/ext/time.lv2/ext.pc.in b/ext/time.lv2/ext.pc.in new file mode 120000 index 0000000..950cb3b --- /dev/null +++ b/ext/time.lv2/ext.pc.in @@ -0,0 +1 @@ +../../ext.pc.in
\ No newline at end of file diff --git a/ext/time.lv2/waf b/ext/time.lv2/waf new file mode 120000 index 0000000..59a1ac9 --- /dev/null +++ b/ext/time.lv2/waf @@ -0,0 +1 @@ +../../waf
\ No newline at end of file diff --git a/ext/time.lv2/wscript b/ext/time.lv2/wscript new file mode 120000 index 0000000..b82a3d0 --- /dev/null +++ b/ext/time.lv2/wscript @@ -0,0 +1 @@ +../../ext.wscript
\ No newline at end of file diff --git a/ext/ui-resize.lv2/ext.pc.in b/ext/ui-resize.lv2/ext.pc.in new file mode 120000 index 0000000..950cb3b --- /dev/null +++ b/ext/ui-resize.lv2/ext.pc.in @@ -0,0 +1 @@ +../../ext.pc.in
\ No newline at end of file diff --git a/ext/ui-resize.lv2/waf b/ext/ui-resize.lv2/waf new file mode 120000 index 0000000..59a1ac9 --- /dev/null +++ b/ext/ui-resize.lv2/waf @@ -0,0 +1 @@ +../../waf
\ No newline at end of file diff --git a/ext/ui-resize.lv2/wscript b/ext/ui-resize.lv2/wscript new file mode 120000 index 0000000..b82a3d0 --- /dev/null +++ b/ext/ui-resize.lv2/wscript @@ -0,0 +1 @@ +../../ext.wscript
\ No newline at end of file diff --git a/ext/uri-map.lv2/ext.pc.in b/ext/uri-map.lv2/ext.pc.in new file mode 120000 index 0000000..950cb3b --- /dev/null +++ b/ext/uri-map.lv2/ext.pc.in @@ -0,0 +1 @@ +../../ext.pc.in
\ No newline at end of file diff --git a/ext/uri-map.lv2/waf b/ext/uri-map.lv2/waf new file mode 120000 index 0000000..59a1ac9 --- /dev/null +++ b/ext/uri-map.lv2/waf @@ -0,0 +1 @@ +../../waf
\ No newline at end of file diff --git a/ext/uri-map.lv2/wscript b/ext/uri-map.lv2/wscript new file mode 120000 index 0000000..b82a3d0 --- /dev/null +++ b/ext/uri-map.lv2/wscript @@ -0,0 +1 @@ +../../ext.wscript
\ No newline at end of file diff --git a/ext/uri-unmap.lv2/ext.pc.in b/ext/uri-unmap.lv2/ext.pc.in new file mode 120000 index 0000000..950cb3b --- /dev/null +++ b/ext/uri-unmap.lv2/ext.pc.in @@ -0,0 +1 @@ +../../ext.pc.in
\ No newline at end of file diff --git a/ext/uri-unmap.lv2/waf b/ext/uri-unmap.lv2/waf new file mode 120000 index 0000000..59a1ac9 --- /dev/null +++ b/ext/uri-unmap.lv2/waf @@ -0,0 +1 @@ +../../waf
\ No newline at end of file diff --git a/ext/uri-unmap.lv2/wscript b/ext/uri-unmap.lv2/wscript new file mode 120000 index 0000000..b82a3d0 --- /dev/null +++ b/ext/uri-unmap.lv2/wscript @@ -0,0 +1 @@ +../../ext.wscript
\ No newline at end of file diff --git a/ext/urid.lv2/ext.pc.in b/ext/urid.lv2/ext.pc.in new file mode 120000 index 0000000..950cb3b --- /dev/null +++ b/ext/urid.lv2/ext.pc.in @@ -0,0 +1 @@ +../../ext.pc.in
\ No newline at end of file diff --git a/ext/urid.lv2/waf b/ext/urid.lv2/waf new file mode 120000 index 0000000..59a1ac9 --- /dev/null +++ b/ext/urid.lv2/waf @@ -0,0 +1 @@ +../../waf
\ No newline at end of file diff --git a/ext/urid.lv2/wscript b/ext/urid.lv2/wscript new file mode 120000 index 0000000..b82a3d0 --- /dev/null +++ b/ext/urid.lv2/wscript @@ -0,0 +1 @@ +../../ext.wscript
\ No newline at end of file diff --git a/extensions/ui.lv2/ext.pc.in b/extensions/ui.lv2/ext.pc.in new file mode 120000 index 0000000..950cb3b --- /dev/null +++ b/extensions/ui.lv2/ext.pc.in @@ -0,0 +1 @@ +../../ext.pc.in
\ No newline at end of file diff --git a/extensions/ui.lv2/waf b/extensions/ui.lv2/waf new file mode 120000 index 0000000..59a1ac9 --- /dev/null +++ b/extensions/ui.lv2/waf @@ -0,0 +1 @@ +../../waf
\ No newline at end of file diff --git a/extensions/ui.lv2/wscript b/extensions/ui.lv2/wscript new file mode 120000 index 0000000..b82a3d0 --- /dev/null +++ b/extensions/ui.lv2/wscript @@ -0,0 +1 @@ +../../ext.wscript
\ No newline at end of file diff --git a/extensions/units.lv2/ext.pc.in b/extensions/units.lv2/ext.pc.in new file mode 120000 index 0000000..950cb3b --- /dev/null +++ b/extensions/units.lv2/ext.pc.in @@ -0,0 +1 @@ +../../ext.pc.in
\ No newline at end of file diff --git a/extensions/units.lv2/waf b/extensions/units.lv2/waf new file mode 120000 index 0000000..59a1ac9 --- /dev/null +++ b/extensions/units.lv2/waf @@ -0,0 +1 @@ +../../waf
\ No newline at end of file diff --git a/extensions/units.lv2/wscript b/extensions/units.lv2/wscript new file mode 120000 index 0000000..b82a3d0 --- /dev/null +++ b/extensions/units.lv2/wscript @@ -0,0 +1 @@ +../../ext.wscript
\ No newline at end of file Binary files differ@@ -5,6 +5,7 @@ import os import rdflib import shutil import subprocess +import sys from waflib.extras import autowaf as autowaf import waflib.Logs as Logs @@ -31,99 +32,17 @@ def options(opt): for i in ['core.lv2']: opt.recurse(i) -lv2 = rdflib.Namespace('http://lv2plug.in/ns/lv2core#') -rdf = rdflib.Namespace('http://www.w3.org/1999/02/22-rdf-syntax-ns#') - -def genwscript(manifest, experimental): - dir = os.path.dirname(manifest) - name = os.path.basename(dir).replace('.lv2', '') - - m = rdflib.ConjunctiveGraph() - m.parse(manifest, format='n3') - - # Get the first match for a triple pattern, or throw if no matches - def query(model, s, p, o): - for i in model.triples([s, p, o]): - return i - raise Exception('Insufficient data for %s' % manifest) - - try: - uri = query(m, None, rdf.type, lv2.Specification)[0] - except: - print('Skipping: %s' % name) - return False - - minor = micro = '0' - try: - minor = query(m, uri, lv2.minorVersion, None)[2] - micro = query(m, uri, lv2.microVersion, None)[2] - except: - if not experimental: - print('Skipping: %s' % name) - return False - - if experimental or (int(minor) != 0 and int(micro) % 2 == 0): - print('Generating: %s %s.%s' % (name, minor, micro)) - - pkgconfig_name = str(uri).replace('http://', 'lv2-').replace('/', '-') - - def subst_file(source_path, target_path): - source = open(source_path, 'r') - target = open(target_path, 'w') - for l in source: - target.write(l.replace( - '@DESCRIPTION@', 'LV2 "' + name + '" extension').replace( - '@INCLUDE_PATH@', str(uri).replace('http://', 'lv2/')).replace( - '@MICRO@', micro).replace( - '@MINOR@', minor).replace( - '@NAME@', name).replace( - '@PKGCONFIG_NAME@', pkgconfig_name).replace( - '@URI@', str(uri)).replace( - '@VERSION@', '%s.%s' % (minor, micro))) - source.close() - target.close() - - # Generate wscript - subst_file('wscript.template', '%s/wscript' % dir) - - # Generate pkgconfig file - subst_file('ext.pc.template', '%s/%s.pc.in' % (dir, pkgconfig_name)) - - try: - os.remove('%s/waf' % dir) - except: - pass - - #os.symlink('../../waf', '%s/waf' % dir) - shutil.copy('waf', '%s/waf' % dir) - - return True - else: - return False - def configure(conf): - subdirs = ['core.lv2'] - - manifests = glob.glob('ext/*.lv2/manifest.ttl') + [ - 'extensions/ui.lv2/manifest.ttl', - 'extensions/units.lv2/manifest.ttl' - ] - - manifests.sort() - - print('') - autowaf.display_header("Generating build files") - for manifest in manifests: - if genwscript(manifest, Options.options.experimental): - subdirs += [ os.path.dirname(manifest) ] - print('') - conf.load('compiler_cc') conf.load('compiler_cxx') - autowaf.configure(conf) + conf.env.append_unique('CFLAGS', '-std=c99') + subdirs = ['core.lv2'] + subdirs += glob.glob('ext/*.lv2/') + subdirs += glob.glob('extensions/*.lv2/') + for i in subdirs: conf.recurse(i) @@ -134,20 +53,37 @@ def build(bld): bld.recurse(i) def release(ctx): - for i in ['ext/data-access.lv2', - 'ext/midi.lv2', - 'ext/event.lv2', - 'ext/uri-map.lv2', - 'ext/instance-access.lv2', - 'extensions/ui.lv2', - 'extensions/units.lv2', - 'core.lv2']: + lv2 = rdflib.Namespace('http://lv2plug.in/ns/lv2core#') + rdf = rdflib.Namespace('http://www.w3.org/1999/02/22-rdf-syntax-ns#') + doap = rdflib.Namespace('http://usefulinc.com/ns/doap#') + + manifests = glob.glob('ext/*.lv2/manifest.ttl') + manifests += glob.glob('extensions/*.lv2/manifest.ttl') + for manifest in manifests: + dir = os.path.dirname(manifest) + name = os.path.basename(dir).replace('.lv2', '') + + m = rdflib.ConjunctiveGraph() + m.parse(manifest, format='n3') + + uri = minor = micro = None try: - subprocess.call( - ['./waf', 'distclean', 'configure', 'build', 'distcheck'], - cwd=i) + spec = m.value(None, rdf.type, lv2.Specification) + uri = str(spec) + minor = int(m.value(spec, lv2.minorVersion, None)) + micro = int(m.value(spec, lv2.microVersion, None)) except: - print('Error building %s release' % i) + e = sys.exc_info()[1] + Logs.error('error: %s: %s' % (manifest, str(e))) + continue + + if minor != 0 and micro % 2 == 0: + try: + subprocess.call( + ['./waf', 'distclean', 'configure', 'build', 'distcheck', 'distclean'], + cwd=dir) + except: + Logs.error('Error building %s release' % name) def lint(ctx): for i in (['core.lv2/lv2.h'] diff --git a/wscript.template b/wscript.template deleted file mode 100644 index 7166e2a..0000000 --- a/wscript.template +++ /dev/null @@ -1,52 +0,0 @@ -#!/usr/bin/env python -import os -from waflib.extras import autowaf as autowaf -import waflib.Logs as Logs -import waflib.Options as Options - -# Variables for 'waf dist' -APPNAME = 'lv2-@NAME@' -VERSION = '@VERSION@' - -# Mandatory variables -top = '.' -out = 'build' - -def options(opt): - autowaf.set_options(opt) - opt.add_option('--copy-headers', action='store_true', default=False, - dest='copy_headers', - help='Copy headers instead of linking to bundle') - -def configure(conf): - autowaf.configure(conf) - autowaf.display_header('LV2 @NAME@ Configuration') - conf.env['COPY_HEADERS'] = Options.options.copy_headers - autowaf.display_msg(conf, "LV2 bundle directory", - conf.env['LV2DIR']) - print('') - -def build(bld): - uri = '@URI@' - include_base = os.path.dirname(uri[uri.find('://') + 3:]) - bundle_dir = os.path.join(bld.env['LV2DIR'], '@NAME@.lv2') - include_dir = os.path.join(bld.env['INCLUDEDIR'], 'lv2', include_base) - - # Pkgconfig file - obj = bld(features = 'subst', - source = '@PKGCONFIG_NAME@.pc.in', - target = '@PKGCONFIG_NAME@.pc', - install_path = '${LIBDIR}/pkgconfig', - INCLUDEDIR = bld.env['INCLUDEDIR']) - - # Install bundle - bld.install_files(bundle_dir, - bld.path.ant_glob('?*.*', excl='*.pc.in')) - - # Install URI-like includes - if bld.env['COPY_HEADERS']: - bld.install_files(os.path.join(include_dir, '@NAME@'), - bld.path.ant_glob('*.h')) - else: - bld.symlink_as(os.path.join(include_dir, '@NAME@'), - os.path.relpath(bundle_dir, include_dir)) |