shithub: aubio

Download patch

ref: 0cd37209cc5a5673eb7f19b6bb1d0cc6294c4caa
parent: 9f735387729066a4e5a2723e8c1462d472e6e18b
author: Paul Brossier <piem@piem.org>
date: Thu Jul 2 10:49:15 EDT 2020

[waf] add --nodeps option to build with no dependency

--- a/wscript
+++ b/wscript
@@ -48,6 +48,9 @@
     ctx.add_option('--debug', action = 'store_const',
             dest = 'build_type', const = 'debug',
             help = 'build in debug mode (see --build-type)')
+    ctx.add_option('--nodeps', action = 'store_const',
+            dest = 'nodeps', const = 'debug',
+            help = 'build with no external dependencies')
     add_option_enable_disable(ctx, 'fftw3f', default = False,
             help_str = 'compile with fftw3f instead of ooura (recommended)',
             help_disable_str = 'do not compile with fftw3f')
@@ -125,6 +128,27 @@
     target_platform = sys.platform
     if ctx.options.target_platform:
         target_platform = ctx.options.target_platform
+
+    if ctx.options.nodeps:
+        external_deps = [
+                'sndfile',
+                'samplerate',
+                'jack',
+                'avcodec',
+                'blas',
+                'fftw3',
+                'fftw3f',
+        ]
+        for d in external_deps:
+            if not hasattr(ctx.options, 'enable_' + d):
+                raise ctx.errors.ConfigurationError ('--enable-%s missing from options' % d)
+            if getattr(ctx.options, 'enable_' + d) == True:
+                msg = 'Option --nodeps can not be used along with --enable-%s' % d
+                raise ctx.errors.ConfigurationError (msg)
+            elif getattr(ctx.options, 'enable_' + d) is None:
+                msg = 'Option --nodeps used but automatic detection with --enable-%s' % d
+                ctx.msg('Warning', msg)
+            setattr(ctx.options, 'enable_' + d, False)
 
     from waflib import Options