unify version parsing in Version.py
[aubio.git] / python / lib / moresetuptools.py
index 9765f5c..17dc78c 100644 (file)
@@ -4,6 +4,8 @@ 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
+
 # inspired from https://gist.github.com/abergmeier/9488990
 def add_packages(packages, ext=None, **kw):
     """ use pkg-config to search which of 'packages' are installed """
@@ -79,7 +81,7 @@ def add_external_deps(ext, usedouble = False):
                 #'fftw3f',
                ]
     # samplerate only works with float
-    if usedouble == False:
+    if usedouble is False:
         packages += ['samplerate']
     else:
         print("Info: not adding libsamplerate in double precision mode")
@@ -119,9 +121,12 @@ def add_external_deps(ext, usedouble = False):
 
 def add_system_aubio(ext):
     # use pkg-config to find aubio's location
-    add_packages(['aubio'], ext)
+    aubio_version = get_aubio_version()
+    add_packages(['aubio = ' + aubio_version], ext)
     if 'aubio' not in ext.libraries:
-        print("Error: libaubio not found")
+        print("Info: aubio " + aubio_version + " was not found by pkg-config")
+    else:
+        print("Info: using system aubio " + aubio_version + " found in " + ' '.join(ext.library_dirs))
 
 class CleanGenerated(distutils.command.clean.clean):
     def run(self):