From 012b32453696aa3cadfaf749c20eb624594b93d2 Mon Sep 17 00:00:00 2001 From: Paul Brossier Date: Wed, 11 Jul 2012 14:10:41 -0600 Subject: [PATCH] setup.py: simplify, check for path before adding them --- interfaces/python/setup.py | 40 +++++++++++++++++++++++--------------- 1 file changed, 24 insertions(+), 16 deletions(-) diff --git a/interfaces/python/setup.py b/interfaces/python/setup.py index 40457f04..c87b3396 100755 --- a/interfaces/python/setup.py +++ b/interfaces/python/setup.py @@ -4,19 +4,14 @@ from distutils.core import setup, Extension from generator import generate_object_files -setup(name='aubio', - version = '0.4.0alpha', - packages = ['aubio'], - description = 'interface to the aubio library', - long_description = 'interface to the aubio library', - license = 'GNU/GPL version 3', - author = 'Paul Brossier', - author_email = 'piem@aubio.org', - maintainer = 'Paul Brossier', - maintainer_email = 'piem@aubio.org', - url = 'http://aubio.org/', - ext_modules = [ - Extension("_aubio", +import os.path + +library_dirs = ['../../build/src', '../../src/.libs'] +include_dirs = ['../../build/src', '../../src', '.' ] +library_dirs = filter (lambda x: os.path.isdir(x), library_dirs) +include_dirs = filter (lambda x: os.path.isdir(x), include_dirs) + +aubio_extension = Extension("_aubio", ["aubiomodule.c", "aubioproxy.c", "py-cvec.c", @@ -28,7 +23,20 @@ setup(name='aubio', "py-phasevoc.c", # generated files ] + generate_object_files(), - include_dirs=['../../build/src', '../../src', '.' ], - library_dirs=['../../build/src', '../../src/.libs' ], - libraries=['aubio'])]) + include_dirs = include_dirs, + library_dirs = library_dirs, + libraries=['aubio']) + +setup(name='aubio', + version = '0.4.0alpha', + packages = ['aubio'], + description = 'interface to the aubio library', + long_description = 'interface to the aubio library', + license = 'GNU/GPL version 3', + author = 'Paul Brossier', + author_email = 'piem@aubio.org', + maintainer = 'Paul Brossier', + maintainer_email = 'piem@aubio.org', + url = 'http://aubio.org/', + ext_modules = [aubio_extension]) -- 2.26.2