make setup.py respect pkg-config if available
This commit is contained in:
parent
cead9a6032
commit
71718a075b
@ -2,14 +2,30 @@
|
|||||||
|
|
||||||
from distutils.core import setup, Extension
|
from distutils.core import setup, Extension
|
||||||
|
|
||||||
|
import os
|
||||||
|
modname='libburn-1'
|
||||||
|
|
||||||
|
libs = ['burn']
|
||||||
|
includes = ['/usr/include/libburn']
|
||||||
|
|
||||||
|
if os.system('pkg-config --exists '+modname+' 2> /dev/null') == 0:
|
||||||
|
pkgcfg = os.popen('pkg-config --cflags-only-I '+modname)
|
||||||
|
includes = pkgcfg.readline().strip()
|
||||||
|
includes = includes[2:].split(' -I')
|
||||||
|
pkgcfg.close()
|
||||||
|
|
||||||
|
pkgcfg = os.popen('pkg-config --libs-only-l '+modname)
|
||||||
|
libs = pkgcfg.readline().strip()
|
||||||
|
libs = libs[2:].split(' -l')
|
||||||
|
pkgcfg.close()
|
||||||
|
|
||||||
setup(name = "python-libburn",
|
setup(name = "python-libburn",
|
||||||
version = "0.0.1",
|
version = "0.0.1",
|
||||||
description = "Python bindings to libburn",
|
description = "Python bindings to libburn",
|
||||||
ext_modules = [Extension("pyburn",
|
ext_modules = [Extension("pyburn",
|
||||||
["pyburn.cpp"],
|
["pyburn.cpp"],
|
||||||
libraries=[':libburn.so'],
|
libraries=libs,
|
||||||
include_dirs=['/usr/include/libburn'], # FIXME: make this more
|
include_dirs=includes,
|
||||||
# portable
|
|
||||||
)]
|
)]
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user