source: wscript @ aab682e

feature/autosinkfeature/cnnfeature/cnn_orgfeature/constantqfeature/crepefeature/crepe_orgfeature/pitchshiftfeature/pydocstringsfeature/timestretchfix/ffmpeg5sampler
Last change on this file since aab682e was aab682e, checked in by Martin Hermant <martin.hermant@gmail.com>, 7 years ago

unify version parsing in Version.py

  • Property mode set to 100644
File size: 20.5 KB
RevLine 
[5c411dc]1#! /usr/bin/python
[110ac90]2#
[21ee709]3# usage:
[46b00690]4#   $ python waf --help
5#
6# example:
7#   $ ./waf distclean configure build
[21ee709]8#
[46b00690]9# Note: aubio uses the waf build system, which relies on Python. Provided you
10# have Python installed, you do *not* need to install anything to build aubio.
11# For more info about waf, see http://code.google.com/p/waf/ .
[000b090]12
[004b431]13import sys
14
[000b090]15APPNAME = 'aubio'
[5820107]16
[6b14351]17# source VERSION
[1eb8c0e]18
19
[aab682e]20from Version import *
[1eb8c0e]21
22
[6b14351]23VERSION = '.'.join ([str(x) for x in [
24    AUBIO_MAJOR_VERSION,
25    AUBIO_MINOR_VERSION,
26    AUBIO_PATCH_VERSION
27    ]]) + AUBIO_VERSION_STATUS
[e565c649]28
[6b14351]29LIB_VERSION = '.'.join ([str(x) for x in [
30    LIBAUBIO_LT_CUR,
31    LIBAUBIO_LT_REV,
32    LIBAUBIO_LT_AGE]])
[e565c649]33
[46378b3]34top = '.'
35out = 'build'
[000b090]36
[6b14351]37def add_option_enable_disable(ctx, name, default = None,
38        help_str = None, help_disable_str = None):
[a93dab3]39    if help_str == None:
40        help_str = 'enable ' + name + ' support'
41    if help_disable_str == None:
42        help_disable_str = 'do not ' + help_str
43    ctx.add_option('--enable-' + name, action = 'store_true',
44            default = default,
45            dest = 'enable_' + name.replace('-','_'),
46            help = help_str)
47    ctx.add_option('--disable-' + name, action = 'store_false',
48            #default = default,
49            dest = 'enable_' + name.replace('-','_'),
50            help = help_disable_str )
[3819aca]51
[d41bc4d]52def options(ctx):
[b4ce693]53    ctx.add_option('--build-type', action = 'store',
54            default = "release",
55            choices = ('debug', 'release'),
56            dest = 'build_type',
[fb6a0ff]57            help = 'whether to compile with (--build-type=release) or without (--build-type=debug) '\
[b4ce693]58              ' compiler opimizations [default: release]')
[a93dab3]59    add_option_enable_disable(ctx, 'fftw3f', default = False,
60            help_str = 'compile with fftw3f instead of ooura (recommended)',
61            help_disable_str = 'do not compile with fftw3f')
62    add_option_enable_disable(ctx, 'fftw3', default = False,
63            help_str = 'compile with fftw3 instead of ooura',
64            help_disable_str = 'do not compile with fftw3')
65    add_option_enable_disable(ctx, 'complex', default = False,
66            help_str ='compile with C99 complex',
67            help_disable_str = 'do not use C99 complex (default)' )
68    add_option_enable_disable(ctx, 'jack', default = None,
69            help_str = 'compile with jack (auto)',
70            help_disable_str = 'disable jack support')
71    add_option_enable_disable(ctx, 'sndfile', default = None,
72            help_str = 'compile with sndfile (auto)',
73            help_disable_str = 'disable sndfile')
74    add_option_enable_disable(ctx, 'avcodec', default = None,
75            help_str = 'compile with libavcodec (auto)',
76            help_disable_str = 'disable libavcodec')
77    add_option_enable_disable(ctx, 'samplerate', default = None,
78            help_str = 'compile with samplerate (auto)',
79            help_disable_str = 'disable samplerate')
80    add_option_enable_disable(ctx, 'memcpy', default = True,
81            help_str = 'use memcpy hacks (default)',
82            help_disable_str = 'do not use memcpy hacks')
83    add_option_enable_disable(ctx, 'double', default = False,
84            help_str = 'compile in double precision mode',
85            help_disable_str = 'compile in single precision mode (default)')
[a3de4be]86    add_option_enable_disable(ctx, 'fat', default = False,
87            help_str = 'build fat binaries (darwin only)',
88            help_disable_str = 'do not build fat binaries (default)')
[0309a22]89    add_option_enable_disable(ctx, 'accelerate', default = None,
90            help_str = 'use Accelerate framework (darwin only) (auto)',
91            help_disable_str = 'do not use Accelerate framework')
[cc81763]92    add_option_enable_disable(ctx, 'apple-audio', default = None,
93            help_str = 'use CoreFoundation (darwin only) (auto)',
94            help_disable_str = 'do not use CoreFoundation framework')
[f61ffb9]95    add_option_enable_disable(ctx, 'atlas', default = False,
96            help_str = 'use Atlas library (no)',
[f0ce36a1]97            help_disable_str = 'do not use Atlas library')
[f9a543e]98    add_option_enable_disable(ctx, 'wavread', default = True,
99            help_str = 'compile with source_wavread (default)',
100            help_disable_str = 'do not compile source_wavread')
101    add_option_enable_disable(ctx, 'wavwrite', default = True,
102            help_str = 'compile with source_wavwrite (default)',
103            help_disable_str = 'do not compile source_wavwrite')
[a93dab3]104
[a33d406]105    add_option_enable_disable(ctx, 'docs', default = None,
106            help_str = 'build documentation (auto)',
107            help_disable_str = 'do not build documentation')
108
[a93dab3]109    ctx.add_option('--with-target-platform', type='string',
110            help='set target platform for cross-compilation', dest='target_platform')
111
112    ctx.load('compiler_c')
113    ctx.load('waf_unit_test')
114    ctx.load('gnu_dirs')
[000b090]115
[d41bc4d]116def configure(ctx):
[a93dab3]117    from waflib import Options
118    ctx.load('compiler_c')
119    ctx.load('waf_unit_test')
120    ctx.load('gnu_dirs')
[06dba46]121
[bef979a]122    # check for common headers
123    ctx.check(header_name='stdlib.h')
124    ctx.check(header_name='stdio.h')
125    ctx.check(header_name='math.h')
126    ctx.check(header_name='string.h')
127    ctx.check(header_name='limits.h')
[f334300]128    ctx.check(header_name='stdarg.h')
[d746ef8]129    ctx.check(header_name='getopt.h', mandatory = False)
[06cf47d]130    ctx.check(header_name='unistd.h', mandatory = False)
[bef979a]131
[004b431]132    target_platform = sys.platform
[a93dab3]133    if ctx.options.target_platform:
134        target_platform = ctx.options.target_platform
135    ctx.env['DEST_OS'] = target_platform
136
[1eb8c0e]137    ctx.define('AUBIO_VERSION',VERSION)
138    ctx.define('AUBIO_MAJOR_VERSION',AUBIO_MAJOR_VERSION)
139    ctx.define('AUBIO_MINOR_VERSION',AUBIO_MINOR_VERSION)
140    ctx.define('AUBIO_PATCH_VERSION',AUBIO_PATCH_VERSION)
141    ctx.define('AUBIO_VERSION_STATUS',AUBIO_VERSION_STATUS)
[aab682e]142   
[b4ce693]143    if ctx.options.build_type == "debug":
144        ctx.define('DEBUG', 1)
145    else:
146        ctx.define('NDEBUG', 1)
[578d3a2]147
[ae36035]148    if ctx.env.CC_NAME != 'msvc':
[c04346d]149        if ctx.options.build_type == "debug":
150            # no optimization in debug mode
[a6ba5d9f]151            ctx.env.prepend_value('CFLAGS', ['-O0'])
152        else:
153            # default to -O2 in release mode
154            ctx.env.prepend_value('CFLAGS', ['-O2'])
155        # enable debug symbols and configure warnings
156        ctx.env.prepend_value('CFLAGS', ['-g', '-Wall', '-Wextra'])
[a341685]157    else:
[b4ce693]158        # enable debug symbols
159        ctx.env.CFLAGS += ['/Z7', '/FS']
160        ctx.env.LINKFLAGS += ['/DEBUG', '/INCREMENTAL:NO']
161        # configure warnings
162        ctx.env.CFLAGS += ['/W4', '/D_CRT_SECURE_NO_WARNINGS']
[578d3a2]163        # set optimization level and runtime libs
[b4ce693]164        if (ctx.options.build_type == "release"):
165            ctx.env.CFLAGS += ['/Ox']
166            ctx.env.CFLAGS += ['/MD']
167        else:
168            assert(ctx.options.build_type == "debug")
169            ctx.env.CFLAGS += ['/MDd']
[578d3a2]170
[70a304e]171    ctx.check_cc(lib='m', uselib_store='M', mandatory=False)
172
[06dba46]173    if target_platform not in ['win32', 'win64']:
174        ctx.env.CFLAGS += ['-fPIC']
175    else:
176        ctx.define('HAVE_WIN_HACKS', 1)
177        ctx.env['cshlib_PATTERN'] = 'lib%s.dll'
[a93dab3]178
[a3de4be]179    if target_platform == 'darwin' and ctx.options.enable_fat:
[a93dab3]180        ctx.env.CFLAGS += ['-arch', 'i386', '-arch', 'x86_64']
181        ctx.env.LINKFLAGS += ['-arch', 'i386', '-arch', 'x86_64']
[da1709f]182        MINSDKVER="10.4"
183        ctx.env.CFLAGS += [ '-mmacosx-version-min=' + MINSDKVER ]
184        ctx.env.LINKFLAGS += [ '-mmacosx-version-min=' + MINSDKVER ]
[9209c79]185
186    if target_platform in [ 'darwin', 'ios', 'iosimulator']:
[cc81763]187        if (ctx.options.enable_apple_audio != False):
188            ctx.env.FRAMEWORK += ['CoreFoundation', 'AudioToolbox']
189            ctx.define('HAVE_SOURCE_APPLE_AUDIO', 1)
190            ctx.define('HAVE_SINK_APPLE_AUDIO', 1)
[f61ffb9]191            ctx.msg('Checking for AudioToolbox.framework', 'yes')
192        else:
193            ctx.msg('Checking for AudioToolbox.framework', 'no (disabled)', color = 'YELLOW')
[0309a22]194        if (ctx.options.enable_accelerate != False):
195            ctx.define('HAVE_ACCELERATE', 1)
196            ctx.env.FRAMEWORK += ['Accelerate']
[f61ffb9]197            ctx.msg('Checking for Accelerate framework', 'yes')
198        else:
[488381e]199            ctx.msg('Checking for Accelerate framework', 'no (disabled)', color = 'YELLOW')
[a93dab3]200
201    if target_platform in [ 'ios', 'iosimulator' ]:
202        MINSDKVER="6.1"
203        ctx.env.CFLAGS += ['-std=c99']
[536bf70]204        if (ctx.options.enable_apple_audio != False):
[cc81763]205            ctx.define('HAVE_AUDIO_UNIT', 1)
206            #ctx.env.FRAMEWORK += ['CoreFoundation', 'AudioToolbox']
[a93dab3]207        if target_platform == 'ios':
208            DEVROOT = "/Applications/Xcode.app/Contents"
209            DEVROOT += "/Developer/Platforms/iPhoneOS.platform/Developer"
[e11ce489]210            SDKROOT = "%(DEVROOT)s/SDKs/iPhoneOS.sdk" % locals()
[94b16497]211            ctx.env.CFLAGS += [ '-fembed-bitcode' ]
[7aa4aaa]212            ctx.env.CFLAGS += [ '-arch', 'arm64' ]
[a93dab3]213            ctx.env.CFLAGS += [ '-arch', 'armv7' ]
214            ctx.env.CFLAGS += [ '-arch', 'armv7s' ]
[7aa4aaa]215            ctx.env.LINKFLAGS += [ '-arch', 'arm64' ]
[a93dab3]216            ctx.env.LINKFLAGS += ['-arch', 'armv7']
217            ctx.env.LINKFLAGS += ['-arch', 'armv7s']
218            ctx.env.CFLAGS += [ '-miphoneos-version-min=' + MINSDKVER ]
219            ctx.env.LINKFLAGS += [ '-miphoneos-version-min=' + MINSDKVER ]
220        else:
221            DEVROOT = "/Applications/Xcode.app/Contents"
222            DEVROOT += "/Developer/Platforms/iPhoneSimulator.platform/Developer"
[e11ce489]223            SDKROOT = "%(DEVROOT)s/SDKs/iPhoneSimulator.sdk" % locals()
[a93dab3]224            ctx.env.CFLAGS += [ '-arch', 'i386' ]
225            ctx.env.CFLAGS += [ '-arch', 'x86_64' ]
226            ctx.env.LINKFLAGS += ['-arch', 'i386']
227            ctx.env.LINKFLAGS += ['-arch', 'x86_64']
228            ctx.env.CFLAGS += [ '-mios-simulator-version-min=' + MINSDKVER ]
229            ctx.env.LINKFLAGS += [ '-mios-simulator-version-min=' + MINSDKVER ]
230        ctx.env.CFLAGS += [ '-isysroot' , SDKROOT]
231        ctx.env.LINKFLAGS += [ '-isysroot' , SDKROOT]
232
[fb5838a]233    if target_platform == 'emscripten':
234        import os.path
235        ctx.env.CFLAGS += [ '-I' + os.path.join(os.environ['EMSCRIPTEN'], 'system', 'include') ]
236        ctx.env.CFLAGS += ['-Oz']
237        ctx.env.cprogram_PATTERN = "%s.js"
238        if (ctx.options.enable_atlas != True):
239            ctx.options.enable_atlas = False
240
[a93dab3]241    # check support for C99 __VA_ARGS__ macros
242    check_c99_varargs = '''
[0318cc1]243#include <stdio.h>
244#define AUBIO_ERR(...) fprintf(stderr, __VA_ARGS__)
245'''
[a93dab3]246
247    if ctx.check_cc(fragment = check_c99_varargs,
248            type='cstlib',
[413d4bf]249            msg = 'Checking for C99 __VA_ARGS__ macro',
250            mandatory = False):
[a93dab3]251        ctx.define('HAVE_C99_VARARGS_MACROS', 1)
252
[06c6d7d]253    # show a message about enable_double status
[a93dab3]254    if (ctx.options.enable_double == True):
[06c6d7d]255        ctx.msg('Checking for size of smpl_t', 'double')
256        ctx.msg('Checking for size of lsmp_t', 'long double')
[a93dab3]257    else:
[06c6d7d]258        ctx.msg('Checking for size of smpl_t', 'float')
259        ctx.msg('Checking for size of lsmp_t', 'double')
[a93dab3]260
261    # optionally use complex.h
262    if (ctx.options.enable_complex == True):
263        ctx.check(header_name='complex.h')
[06c6d7d]264    else:
265        ctx.msg('Checking if complex.h is enabled', 'no')
[a93dab3]266
267    # check for fftw3
268    if (ctx.options.enable_fftw3 != False or ctx.options.enable_fftw3f != False):
269        # one of fftwf or fftw3f
270        if (ctx.options.enable_fftw3f != False):
271            ctx.check_cfg(package = 'fftw3f', atleast_version = '3.0.0',
[795fcd9]272                    args = '--cflags --libs',
273                    mandatory = ctx.options.enable_fftw3f)
[a93dab3]274            if (ctx.options.enable_double == True):
[795fcd9]275                ctx.msg('Warning',
276                        'fftw3f enabled, but compiling in double precision!')
[a93dab3]277        else:
[795fcd9]278            # fftw3f disabled, take most sensible one according to
279            # enable_double
[a93dab3]280            if (ctx.options.enable_double == True):
281                ctx.check_cfg(package = 'fftw3', atleast_version = '3.0.0',
[795fcd9]282                        args = '--cflags --libs', mandatory =
283                        ctx.options.enable_fftw3)
[a93dab3]284            else:
285                ctx.check_cfg(package = 'fftw3f', atleast_version = '3.0.0',
[795fcd9]286                        args = '--cflags --libs',
287                        mandatory = ctx.options.enable_fftw3)
[a93dab3]288        ctx.define('HAVE_FFTW3', 1)
289
290    # fftw not enabled, use vDSP or ooura
291    if 'HAVE_FFTW3F' in ctx.env.define_key:
292        ctx.msg('Checking for FFT implementation', 'fftw3f')
293    elif 'HAVE_FFTW3' in ctx.env.define_key:
294        ctx.msg('Checking for FFT implementation', 'fftw3')
295    elif 'HAVE_ACCELERATE' in ctx.env.define_key:
296        ctx.msg('Checking for FFT implementation', 'vDSP')
[36f954a]297    else:
[a93dab3]298        ctx.msg('Checking for FFT implementation', 'ooura')
299
300    # check for libsndfile
301    if (ctx.options.enable_sndfile != False):
302        ctx.check_cfg(package = 'sndfile', atleast_version = '1.0.4',
[795fcd9]303                args = '--cflags --libs',
304                mandatory = ctx.options.enable_sndfile)
[a93dab3]305
306    # check for libsamplerate
[8be88e7]307    if (ctx.options.enable_double):
308        if (ctx.options.enable_samplerate):
309            ctx.fatal("Could not compile aubio in double precision mode with libsamplerate")
310        else:
311            ctx.options.enable_samplerate = False
312            ctx.msg('Checking if using samplerate', 'no (disabled in double precision mode)',
313                    color = 'YELLOW')
[a93dab3]314    if (ctx.options.enable_samplerate != False):
315        ctx.check_cfg(package = 'samplerate', atleast_version = '0.0.15',
[795fcd9]316                args = '--cflags --libs',
317                mandatory = ctx.options.enable_samplerate)
[a93dab3]318
319    # check for jack
320    if (ctx.options.enable_jack != False):
[eb99982]321        ctx.check_cfg(package = 'jack',
[795fcd9]322                args = '--cflags --libs',
323                mandatory = ctx.options.enable_jack)
[a93dab3]324
325    # check for libav
326    if (ctx.options.enable_avcodec != False):
327        ctx.check_cfg(package = 'libavcodec', atleast_version = '54.35.0',
[795fcd9]328                args = '--cflags --libs', uselib_store = 'AVCODEC',
329                mandatory = ctx.options.enable_avcodec)
[a93dab3]330        ctx.check_cfg(package = 'libavformat', atleast_version = '52.3.0',
[795fcd9]331                args = '--cflags --libs', uselib_store = 'AVFORMAT',
332                mandatory = ctx.options.enable_avcodec)
[a93dab3]333        ctx.check_cfg(package = 'libavutil', atleast_version = '52.3.0',
[795fcd9]334                args = '--cflags --libs', uselib_store = 'AVUTIL',
335                mandatory = ctx.options.enable_avcodec)
[a93dab3]336        ctx.check_cfg(package = 'libavresample', atleast_version = '1.0.1',
[795fcd9]337                args = '--cflags --libs', uselib_store = 'AVRESAMPLE',
338                mandatory = ctx.options.enable_avcodec)
[eb68991]339        if all ( 'HAVE_' + i in ctx.env
[549928e]340                for i in ['AVCODEC', 'AVFORMAT', 'AVUTIL', 'AVRESAMPLE'] ):
341            ctx.define('HAVE_LIBAV', 1)
342            ctx.msg('Checking for all libav libraries', 'yes')
343        else:
344            ctx.msg('Checking for all libav libraries', 'not found', color = 'YELLOW')
[a93dab3]345
[f9a543e]346    if (ctx.options.enable_wavread != False):
347        ctx.define('HAVE_WAVREAD', 1)
348    ctx.msg('Checking if using source_wavread', ctx.options.enable_wavread and 'yes' or 'no')
349    if (ctx.options.enable_wavwrite!= False):
350        ctx.define('HAVE_WAVWRITE', 1)
351    ctx.msg('Checking if using sink_wavwrite', ctx.options.enable_wavwrite and 'yes' or 'no')
[5158c22]352
[f0ce36a1]353    # use ATLAS
354    if (ctx.options.enable_atlas != False):
355        ctx.check(header_name = 'atlas/cblas.h', mandatory = ctx.options.enable_atlas)
356        #ctx.check(lib = 'lapack', uselib_store = 'LAPACK', mandatory = ctx.options.enable_atlas)
357        ctx.check(lib = 'cblas', uselib_store = 'BLAS', mandatory = ctx.options.enable_atlas)
358
[a93dab3]359    # use memcpy hacks
360    if (ctx.options.enable_memcpy == True):
361        ctx.define('HAVE_MEMCPY_HACKS', 1)
362
363    # write configuration header
364    ctx.write_config_header('src/config.h')
365
[06c6d7d]366    # the following defines will be passed as arguments to the compiler
367    # instead of being written to src/config.h
[1910fed]368    ctx.define('HAVE_CONFIG_H', 1)
[06c6d7d]369
[a93dab3]370    # add some defines used in examples
371    ctx.define('AUBIO_PREFIX', ctx.env['PREFIX'])
372    ctx.define('PACKAGE', APPNAME)
373
[06c6d7d]374    # double precision mode
375    if (ctx.options.enable_double == True):
376        ctx.define('HAVE_AUBIO_DOUBLE', 1)
377
[a33d406]378    if (ctx.options.enable_docs != False):
379        # check if txt2man is installed, optional
380        try:
381          ctx.find_program('txt2man', var='TXT2MAN')
382        except ctx.errors.ConfigurationError:
383          ctx.to_log('txt2man was not found (ignoring)')
[000b090]384
[a33d406]385        # check if doxygen is installed, optional
386        try:
387          ctx.find_program('doxygen', var='DOXYGEN')
388        except ctx.errors.ConfigurationError:
389          ctx.to_log('doxygen was not found (ignoring)')
[52a25e5]390
[7800335]391        # check if sphinx-build is installed, optional
392        try:
393          ctx.find_program('sphinx-build', var='SPHINX')
394        except ctx.errors.ConfigurationError:
395          ctx.to_log('sphinx-build was not found (ignoring)')
396
[6ed0f4e]397def build(bld):
[985a5d1]398    bld.env['VERSION'] = VERSION
399    bld.env['LIB_VERSION'] = LIB_VERSION
400
[7b38f3f]401    # main source
[985a5d1]402    bld.recurse('src')
[7b38f3f]403
404    # add sub directories
[985a5d1]405    if bld.env['DEST_OS'] not in ['ios', 'iosimulator', 'android']:
406        bld.recurse('examples')
407        bld.recurse('tests')
408
[7b38f3f]409    # pkg-config template
[985a5d1]410    bld( source = 'aubio.pc.in' )
411
[7b38f3f]412    # documentation
413    txt2man(bld)
414    doxygen(bld)
415    sphinx(bld)
416
417def txt2man(bld):
[52a25e5]418    # build manpages from txt files using txt2man
[403e9dd]419    if bld.env['TXT2MAN']:
[985a5d1]420        from waflib import TaskGen
421        if 'MANDIR' not in bld.env:
[641e533]422            bld.env['MANDIR'] = bld.env['DATAROOTDIR'] + '/man'
[e3b77e8]423        bld.env.VERSION = VERSION
[403e9dd]424        rule_str = '${TXT2MAN} -t `basename ${TGT} | cut -f 1 -d . | tr a-z A-Z`'
425        rule_str += ' -r ${PACKAGE}\\ ${VERSION} -P ${PACKAGE}'
426        rule_str += ' -v ${PACKAGE}\\ User\\\'s\\ manual'
427        rule_str += ' -s 1 ${SRC} > ${TGT}'
[985a5d1]428        TaskGen.declare_chain(
[403e9dd]429                name      = 'txt2man',
430                rule      = rule_str,
431                ext_in    = '.txt',
[985a5d1]432                ext_out   = '.1',
433                reentrant = False,
434                install_path =  '${MANDIR}/man1',
435                )
[403e9dd]436        bld( source = bld.path.ant_glob('doc/*.txt') )
[985a5d1]437
[7b38f3f]438def doxygen(bld):
[52a25e5]439    # build documentation from source files using doxygen
440    if bld.env['DOXYGEN']:
441        bld( name = 'doxygen', rule = 'doxygen ${SRC} > /dev/null',
442                source = 'doc/web.cfg',
[41dd34e]443                target = '../doc/web/html/index.html',
[7f35041]444                cwd = 'doc')
[641e533]445        bld.install_files( '${DATAROOTDIR}' + '/doc/libaubio-doc',
[52a25e5]446                bld.path.ant_glob('doc/web/html/**'),
447                cwd = bld.path.find_dir ('doc/web'),
448                relative_trick = True)
[7800335]449
[7b38f3f]450def sphinx(bld):
[7800335]451    # build documentation from source files using sphinx-build
[5a19f33]452    # note: build in ../doc/_build/html, otherwise waf wont install unsigned files
[7800335]453    if bld.env['SPHINX']:
[e3b77e8]454        bld.env.VERSION = VERSION
[5a19f33]455        bld( name = 'sphinx',
[e3b77e8]456                rule = '${SPHINX} -b html -D release=${VERSION} -D version=${VERSION} -a -q `dirname ${SRC}` `dirname ${TGT}`',
[7b38f3f]457                source = 'doc/conf.py',
[5a19f33]458                target = '../doc/_build/html/index.html')
[641e533]459        bld.install_files( '${DATAROOTDIR}' + '/doc/libaubio-doc/sphinx',
[7800335]460                bld.path.ant_glob('doc/_build/html/**'),
[5a19f33]461                cwd = bld.path.find_dir('doc/_build/html'),
[7800335]462                relative_trick = True)
[50d56cc]463
[7b38f3f]464# register the previous rules as build rules
465from waflib.Build import BuildContext
466
467class build_txt2man(BuildContext):
468    cmd = 'txt2man'
469    fun = 'txt2man'
470
471class build_manpages(BuildContext):
472    cmd = 'manpages'
473    fun = 'txt2man'
474
475class build_sphinx(BuildContext):
476    cmd = 'sphinx'
477    fun = 'sphinx'
478
479class build_doxygen(BuildContext):
480    cmd = 'doxygen'
481    fun = 'doxygen'
482
[30250de]483def shutdown(bld):
[985a5d1]484    from waflib import Logs
485    if bld.options.target_platform in ['ios', 'iosimulator']:
486        msg ='building for %s, contact the author for a commercial license' % bld.options.target_platform
487        Logs.pprint('RED', msg)
488        msg ='   Paul Brossier <piem@aubio.org>'
489        Logs.pprint('RED', msg)
[b4d1ba1]490
491def dist(ctx):
[3388e1a]492    ctx.excl  = ' **/.waf* **/*~ **/*.pyc **/*.swp **/*.swo **/*.swn **/.lock-w* **/.git*'
[b4d1ba1]493    ctx.excl += ' **/build/*'
[99d8cbb]494    ctx.excl += ' doc/_build'
495    ctx.excl += ' python/demos_*'
[22dd9dc]496    ctx.excl += ' **/python/gen **/python/build **/python/dist'
[981e7082]497    ctx.excl += ' **/python/ext/config.h'
[99d8cbb]498    ctx.excl += ' **/python/lib/aubio/_aubio.so'
499    ctx.excl += ' **.egg-info'
[22dd9dc]500    ctx.excl += ' **/**.zip **/**.tar.bz2'
[7b38f3f]501    ctx.excl += ' **.tar.bz2'
[a93dab3]502    ctx.excl += ' **/doc/full/* **/doc/web/*'
[e57a7d4]503    ctx.excl += ' **/doc/full.cfg'
[b4d1ba1]504    ctx.excl += ' **/python/*.db'
505    ctx.excl += ' **/python.old/*'
[981e7082]506    ctx.excl += ' **/python/*/*.old'
[172b1fe]507    ctx.excl += ' **/python/tests/sounds'
[7b2d740]508    ctx.excl += ' **/**.asc'
[5e544f1]509    ctx.excl += ' **/dist*'
[73aac2a]510    ctx.excl += ' **/.DS_Store'
511    ctx.excl += ' **/.travis.yml'
[5e544f1]512    ctx.excl += ' **/.landscape.yml'
513    ctx.excl += ' **/.appveyor.yml'
Note: See TracBrowser for help on using the repository browser.