From: Paul Brossier Date: Fri, 24 Mar 2017 03:22:42 +0000 (+0100) Subject: Merge branch 'gitshaversion' X-Git-Tag: 0.4.5~45 X-Git-Url: https://git.aubio.org/?p=aubio.git;a=commitdiff_plain;h=cc4987a7ce44a312272ed5e7eafcb1f71ac29b13;hp=115b4526f8875d3bbf6b419ddab940db5de249cc Merge branch 'gitshaversion' --- diff --git a/python/lib/moresetuptools.py b/python/lib/moresetuptools.py index 87818f26..ee0f80aa 100644 --- a/python/lib/moresetuptools.py +++ b/python/lib/moresetuptools.py @@ -55,7 +55,7 @@ def add_local_aubio_lib(ext): ext.library_dirs += [os.path.join('build', 'src')] ext.libraries += ['aubio'] -def add_local_aubio_sources(ext, usedouble = False): +def add_local_aubio_sources(ext): """ build aubio inside python module instead of linking against libaubio """ print("Info: libaubio was not installed or built locally with waf, adding src/") aubio_sources = sorted(glob.glob(os.path.join('src', '**.c'))) @@ -63,6 +63,8 @@ def add_local_aubio_sources(ext, usedouble = False): ext.sources += aubio_sources def add_local_macros(ext, usedouble = False): + if usedouble: + ext.define_macros += [('HAVE_AUBIO_DOUBLE', 1)] # define macros (waf puts them in build/src/config.h) for define_macro in ['HAVE_STDLIB_H', 'HAVE_STDIO_H', 'HAVE_MATH_H', 'HAVE_STRING_H', @@ -155,7 +157,6 @@ class build_ext(_build_ext): def build_extension(self, extension): if self.enable_double or 'HAVE_AUBIO_DOUBLE' in os.environ: - extension.define_macros += [('HAVE_AUBIO_DOUBLE', 1)] enable_double = True else: enable_double = False @@ -166,7 +167,7 @@ class build_ext(_build_ext): # use local src/aubio.h if os.path.isfile(os.path.join('src', 'aubio.h')): add_local_aubio_header(extension) - add_local_macros(extension) + add_local_macros(extension, usedouble=enable_double) # look for a local waf build if os.path.isfile(os.path.join('build','src', 'fvec.c.1.o')): add_local_aubio_lib(extension) @@ -174,7 +175,7 @@ class build_ext(_build_ext): # check for external dependencies add_external_deps(extension, usedouble=enable_double) # add libaubio sources and look for optional deps with pkg-config - add_local_aubio_sources(extension, usedouble=enable_double) + add_local_aubio_sources(extension) # generate files python/gen/*.c, python/gen/aubio-generated.h extension.include_dirs += [ output_path ] extension.sources += generate_external(header, output_path, overwrite = False, diff --git a/python/tests/test_sink.py b/python/tests/test_sink.py index c31564a2..795032ba 100755 --- a/python/tests/test_sink.py +++ b/python/tests/test_sink.py @@ -117,10 +117,11 @@ class aubio_sink_test_case(TestCase): del_tmp_sink_path(sink_path) def test_read_with(self): - sink_path =get_tmp_sink_path() + samplerate = 44100 + sink_path = get_tmp_sink_path() vec = fvec(128) with sink(sink_path, samplerate) as g: - for i in range(10): + for _ in range(10): g(vec, 128) if __name__ == '__main__': diff --git a/python/tests/test_source.py b/python/tests/test_source.py index 755c01ed..d8809174 100755 --- a/python/tests/test_source.py +++ b/python/tests/test_source.py @@ -5,7 +5,6 @@ from nose2.tools import params from numpy.testing import TestCase, assert_equal from aubio import source from .utils import list_all_sounds -import numpy as np import warnings warnings.filterwarnings('ignore', category=UserWarning, append=True) diff --git a/wscript b/wscript index 137b3c48..c9734573 100644 --- a/wscript +++ b/wscript @@ -250,8 +250,8 @@ def configure(ctx): if (ctx.options.enable_fftw3 != False or ctx.options.enable_fftw3f != False): # one of fftwf or fftw3f if (ctx.options.enable_fftw3f != False): - ctx.check_cfg(package = 'fftw3f', atleast_version = '3.0.0', - args = '--cflags --libs', + ctx.check_cfg(package = 'fftw3f', + args = '--cflags --libs fftw3f >= 3.0.0', mandatory = ctx.options.enable_fftw3f) if (ctx.options.enable_double == True): ctx.msg('Warning', @@ -260,12 +260,12 @@ def configure(ctx): # fftw3f disabled, take most sensible one according to # enable_double if (ctx.options.enable_double == True): - ctx.check_cfg(package = 'fftw3', atleast_version = '3.0.0', - args = '--cflags --libs', mandatory = - ctx.options.enable_fftw3) + ctx.check_cfg(package = 'fftw3', + args = '--cflags --libs fftw3 >= 3.0.0.', + mandatory = ctx.options.enable_fftw3) else: - ctx.check_cfg(package = 'fftw3f', atleast_version = '3.0.0', - args = '--cflags --libs', + ctx.check_cfg(package = 'fftw3f', + args = '--cflags --libs fftw3f >= 3.0.0', mandatory = ctx.options.enable_fftw3) ctx.define('HAVE_FFTW3', 1) @@ -281,8 +281,8 @@ def configure(ctx): # check for libsndfile if (ctx.options.enable_sndfile != False): - ctx.check_cfg(package = 'sndfile', atleast_version = '1.0.4', - args = '--cflags --libs', + ctx.check_cfg(package = 'sndfile', + args = '--cflags --libs sndfile >= 1.0.4', mandatory = ctx.options.enable_sndfile) # check for libsamplerate @@ -294,8 +294,8 @@ def configure(ctx): ctx.msg('Checking if using samplerate', 'no (disabled in double precision mode)', color = 'YELLOW') if (ctx.options.enable_samplerate != False): - ctx.check_cfg(package = 'samplerate', atleast_version = '0.0.15', - args = '--cflags --libs', + ctx.check_cfg(package = 'samplerate', + args = '--cflags --libs samplerate >= 0.0.15', mandatory = ctx.options.enable_samplerate) # check for jack @@ -306,21 +306,26 @@ def configure(ctx): # check for libav if (ctx.options.enable_avcodec != False): - ctx.check_cfg(package = 'libavcodec', atleast_version = '54.35.0', - args = '--cflags --libs', uselib_store = 'AVCODEC', + ctx.check_cfg(package = 'libavcodec', + args = '--cflags --libs libavcodec >= 54.35.0', + uselib_store = 'AVCODEC', mandatory = ctx.options.enable_avcodec) - ctx.check_cfg(package = 'libavformat', atleast_version = '52.3.0', - args = '--cflags --libs', uselib_store = 'AVFORMAT', + ctx.check_cfg(package = 'libavformat', + args = '--cflags --libs libavformat >= 52.3.0', + uselib_store = 'AVFORMAT', mandatory = ctx.options.enable_avcodec) - ctx.check_cfg(package = 'libavutil', atleast_version = '52.3.0', - args = '--cflags --libs', uselib_store = 'AVUTIL', + ctx.check_cfg(package = 'libavutil', + args = '--cflags --libs libavutil >= 52.3.0', + uselib_store = 'AVUTIL', mandatory = ctx.options.enable_avcodec) - ctx.check_cfg(package = 'libswresample', atleast_version = '2.3.0', - args = '--cflags --libs', uselib_store = 'SWRESAMPLE', + ctx.check_cfg(package = 'libswresample', + args = '--cflags --libs libswresample >= 2.3.0', + uselib_store = 'SWRESAMPLE', mandatory = False) if 'HAVE_SWRESAMPLE' not in ctx.env: - ctx.check_cfg(package = 'libavresample', atleast_version = '1.0.1', - args = '--cflags --libs', uselib_store = 'AVRESAMPLE', + ctx.check_cfg(package = 'libavresample', + args = '--cflags --libs libavresample >= 1.0.1', + uselib_store = 'AVRESAMPLE', mandatory = False) msg_check = 'Checking for all libav libraries'