From 67a30536abc1656e88a7e5e53f27b27979a6fa13 Mon Sep 17 00:00:00 2001 From: Paul Brossier Date: Mon, 10 Apr 2017 10:30:50 +0200 Subject: [PATCH] python/lib/moresetuptools.py: force adding libav on window (see conda-forge/pkg-config-feedstock#11) --- python/lib/moresetuptools.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/python/lib/moresetuptools.py b/python/lib/moresetuptools.py index ee0f80aa..2f621a7c 100644 --- a/python/lib/moresetuptools.py +++ b/python/lib/moresetuptools.py @@ -116,8 +116,8 @@ def add_external_deps(ext, usedouble = False): ext.define_macros += [('HAVE_WAVWRITE', 1)] ext.define_macros += [('HAVE_WAVREAD', 1)] - # TODO: - # add cblas + + # TODO: add cblas if 0: ext.libraries += ['cblas'] ext.define_macros += [('HAVE_ATLAS_CBLAS_H', 1)] @@ -131,6 +131,12 @@ def add_system_aubio(ext): else: print("Info: using system aubio " + aubio_version + " found in " + ' '.join(ext.library_dirs)) +def add_libav_on_win(ext): + """ no pkg-config on windows, simply assume these libs are available """ + ext.libraries += ['avformat', 'avutil', 'avcodec', 'swresample'] + for define_macro in ['HAVE_LIBAV', 'HAVE_SWRESAMPLE']: + ext.define_macros += [(define_macro, 1)] + class CleanGenerated(distutils.command.clean.clean): def run(self): if os.path.isdir(output_path): @@ -174,6 +180,10 @@ class build_ext(_build_ext): else: # check for external dependencies add_external_deps(extension, usedouble=enable_double) + # force adding libav on windows + if os.name == 'nt' and ('WITH_LIBAV' in os.environ \ + or 'CONDA_PREFIX' in os.environ): + add_libav_on_win(extension) # add libaubio sources and look for optional deps with pkg-config add_local_aubio_sources(extension) # generate files python/gen/*.c, python/gen/aubio-generated.h -- 2.11.0