setup.py: clean up imports
[aubio.git] / python / lib / moresetuptools.py
index 17dc78c..87818f2 100644 (file)
@@ -4,7 +4,7 @@ import sys, os, glob, subprocess
 import distutils, distutils.command.clean, distutils.dir_util
 from .gen_external import generate_external, header, output_path
 
-from Version import get_aubio_version
+from this_version import get_aubio_version
 
 # inspired from https://gist.github.com/abergmeier/9488990
 def add_packages(packages, ext=None, **kw):
@@ -74,9 +74,8 @@ def add_local_macros(ext, usedouble = False):
 def add_external_deps(ext, usedouble = False):
     # loof for additional packages
     print("Info: looking for *optional* additional packages")
-    packages = ['libavcodec', 'libavformat', 'libavutil', 'libavresample',
-                'jack',
-                'jack',
+    packages = ['libavcodec', 'libavformat', 'libavutil',
+                'libswresample', 'libavresample',
                 'sndfile',
                 #'fftw3f',
                ]
@@ -88,11 +87,13 @@ def add_external_deps(ext, usedouble = False):
     add_packages(packages, ext=ext)
     if 'avcodec' in ext.libraries \
             and 'avformat' in ext.libraries \
-            and 'avutil' in ext.libraries \
-            and 'avresample' in ext.libraries:
-        ext.define_macros += [('HAVE_LIBAV', 1)]
-    if 'jack' in ext.libraries:
-        ext.define_macros += [('HAVE_JACK', 1)]
+            and 'avutil' in ext.libraries:
+        if 'swresample' in ext.libraries:
+            ext.define_macros += [('HAVE_SWRESAMPLE', 1)]
+        elif 'avresample' in ext.libraries:
+            ext.define_macros += [('HAVE_AVRESAMPLE', 1)]
+        if 'swresample' in ext.libraries or 'avresample' in ext.libraries:
+            ext.define_macros += [('HAVE_LIBAV', 1)]
     if 'sndfile' in ext.libraries:
         ext.define_macros += [('HAVE_SNDFILE', 1)]
     if 'samplerate' in ext.libraries:
@@ -175,6 +176,7 @@ class build_ext(_build_ext):
                 # add libaubio sources and look for optional deps with pkg-config
                 add_local_aubio_sources(extension, usedouble=enable_double)
         # generate files python/gen/*.c, python/gen/aubio-generated.h
+        extension.include_dirs += [ output_path ]
         extension.sources += generate_external(header, output_path, overwrite = False,
                 usedouble=enable_double)
         return _build_ext.build_extension(self, extension)