From 3350762059dff488d1cd5d85eff072663b50bdad Mon Sep 17 00:00:00 2001 From: "R. Bernstein" Date: Fri, 28 Nov 2008 00:21:28 -0500 Subject: [PATCH] Include libcdio libraries as appropriate when making pycdio libraries. --- setup.py | 8 ++++++-- swig/.gitignore | 2 ++ test/test-cdio.py | 4 ++++ test/test-iso.py | 6 ++++++ test/test-isocopy.py | 5 +++++ 5 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 swig/.gitignore diff --git a/setup.py b/setup.py index 8a9c604b..704b87f9 100755 --- a/setup.py +++ b/setup.py @@ -13,8 +13,12 @@ import os README = os.path.join(os.path.dirname(__file__), 'README.txt') long_description = open(README).read() + '\n\n' -pycdio_module = Extension('_pycdio', sources=['swig/pycdio.i']) -pyiso9660_module = Extension('_pyiso9660', sources=['swig/pyiso9660.i']) +pycdio_module = Extension('_pycdio', + libraries=['cdio'], + sources=['swig/pycdio.i']) +pyiso9660_module = Extension('_pyiso9660', + libraries=['iso9660'], + sources=['swig/pyiso9660.i']) setup (name = 'pycdio', author = 'Rocky Bernstein', author_email = 'rocky@gnu.org', diff --git a/swig/.gitignore b/swig/.gitignore new file mode 100644 index 00000000..4764e0d0 --- /dev/null +++ b/swig/.gitignore @@ -0,0 +1,2 @@ +/pycdio_wrap.c +/pyiso9660_wrap.c diff --git a/test/test-cdio.py b/test/test-cdio.py index 4efd251d..95bdf023 100644 --- a/test/test-cdio.py +++ b/test/test-cdio.py @@ -10,6 +10,10 @@ libdir = os.path.join(os.path.dirname(__file__), if libdir[-1] != os.path.sep: libdir += os.path.sep sys.path.insert(0, libdir) +libdir = os.path.join(os.path.dirname(__file__), '..') +if libdir[-1] != os.path.sep: + libdir += os.path.sep +sys.path.insert(0, libdir) import pycdio import cdio diff --git a/test/test-iso.py b/test/test-iso.py index 7c253efb..7413cd5d 100644 --- a/test/test-iso.py +++ b/test/test-iso.py @@ -6,6 +6,12 @@ This is basically the same thing as libcdio's testiso9660.c""" import unittest, sys, os + +libdir = os.path.join(os.path.dirname(__file__), + '..', 'build', 'lib.linux-i686-2.5') +if libdir[-1] != os.path.sep: + libdir += os.path.sep +sys.path.insert(0, libdir) libdir = os.path.join(os.path.dirname(__file__), '..') if libdir[-1] != os.path.sep: libdir += os.path.sep diff --git a/test/test-isocopy.py b/test/test-isocopy.py index bb8c8673..42f8c3ef 100644 --- a/test/test-isocopy.py +++ b/test/test-isocopy.py @@ -3,6 +3,11 @@ import unittest, sys, os +libdir = os.path.join(os.path.dirname(__file__), + '..', 'build', 'lib.linux-i686-2.5') +if libdir[-1] != os.path.sep: + libdir += os.path.sep +sys.path.insert(0, libdir) libdir = os.path.join(os.path.dirname(__file__), '..') if libdir[-1] != os.path.sep: libdir += os.path.sep