summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDamien Churchill <damoxc@gmail.com>2010-07-22 21:13:26 +0100
committerDamien Churchill <damoxc@gmail.com>2010-07-22 21:13:27 +0100
commit161ad0ff0d01463f07127b9f01e0087f61f22a11 (patch)
tree4cd627aeb72c3436b82f96cfe9e3d5dc004a85d3
parent7f323ec0fc587566748c087f02cf1d6c871a3ad4 (diff)
downloaddeluge-161ad0ff0d01463f07127b9f01e0087f61f22a11.tar.gz
deluge-161ad0ff0d01463f07127b9f01e0087f61f22a11.tar.bz2
deluge-161ad0ff0d01463f07127b9f01e0087f61f22a11.zip
use the get_libtorrent.sh script to get libtorrent if it is missing
-rw-r--r--setup.py35
1 files changed, 23 insertions, 12 deletions
diff --git a/setup.py b/setup.py
index a026026dc..4491bb1d5 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
- )
-
- _ext_modules = [libtorrent]
+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
+
+ 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'