From d49cde1994f022fc2580dd21030b57544ae03c7e Mon Sep 17 00:00:00 2001 From: Damien Churchill Date: Thu, 22 Jul 2010 21:13:26 +0100 Subject: [PATCH] use the get_libtorrent.sh script to get libtorrent if it is missing --- setup.py | 33 ++++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/setup.py b/setup.py index e8be01260..3ba910bb7 100644 --- a/setup.py +++ b/setup.py @@ -213,18 +213,29 @@ except ImportError: else: build_libtorrent = False -if build_libtorrent and os.path.exists("libtorrent") and os.listdir("libtorrent"): - # There isn't a system libtorrent library, so let's build the one included with deluge - libtorrent = Extension( - 'libtorrent', - extra_compile_args = _extra_compile_args, - include_dirs = _include_dirs, - libraries = _libraries, - library_dirs = _library_dirs, - sources = _sources - ) +if build_libtorrent: + got_libtorrent = False + if not os.path.exists("libtorrent"): + import subprocess + if subprocess.call(['./get_libtorrent.sh']) > 0: + got_libtorrent = False + else: + got_libtorrent = True + else: + got_libtorrent = True - _ext_modules = [libtorrent] + if got_libtorrent: + # There isn't a system libtorrent library, so let's build the one included with deluge + libtorrent = Extension( + 'libtorrent', + extra_compile_args = _extra_compile_args, + include_dirs = _include_dirs, + libraries = _libraries, + library_dirs = _library_dirs, + sources = _sources + ) + + _ext_modules = [libtorrent] class build_trans(cmd.Command): description = 'Compile .po files into .mo files'