Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions pythonforandroid/recipes/libtorrent/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ class LibtorrentRecipe(Recipe):
url = 'https://github.com/arvidn/libtorrent/archive/libtorrent-1_0_9.tar.gz'
depends = ['boost', 'python2']
opt_depends = ['openssl']
patches = ['disable-so-version.patch', 'use-soname-python.patch']
patches = ['disable-so-version.patch', 'use-soname-python.patch', 'setup-lib-name.patch']

def should_build(self, arch):
return not ( self.has_libs(arch, 'libboost_python.so', 'libboost_system.so', 'libtorrent.so')
return not ( self.has_libs(arch, 'libboost_python.so', 'libboost_system.so', 'libtorrent_rasterbar.so')
and self.ctx.has_package('libtorrent', arch.arch) )

def prebuild_arch(self, arch):
Expand Down Expand Up @@ -55,8 +55,8 @@ def build_arch(self, arch):
if 'openssl' in recipe.ctx.recipe_build_order:
shutil.copyfile(join(env['BOOST_BUILD_PATH'], 'bin.v2/libs/date_time/build', build_subdirs, 'libboost_date_time.so'),
join(self.ctx.get_libs_dir(arch.arch), 'libboost_date_time.so'))
shutil.copyfile(join(self.get_build_dir(arch.arch), 'bin', build_subdirs, 'libtorrent.so'),
join(self.ctx.get_libs_dir(arch.arch), 'libtorrent.so'))
shutil.copyfile(join(self.get_build_dir(arch.arch), 'bin', build_subdirs, 'libtorrent_rasterbar.so'),
join(self.ctx.get_libs_dir(arch.arch), 'libtorrent_rasterbar.so'))
shutil.copyfile(join(self.get_build_dir(arch.arch), 'bindings/python/bin', build_subdirs, 'libtorrent.so'),
join(self.ctx.get_site_packages_dir(arch.arch), 'libtorrent.so'))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
if $(type) = SHARED_LIB &&
( ! ( [ $(property-set).get <target-os> ] in windows cygwin ) )
{
+ return $(name) ; # disable version suffix for android
+ return "libtorrent_rasterbar.so" ; # linked by python bindings .so
name = $(name).$(VERSION) ;
}

20 changes: 20 additions & 0 deletions pythonforandroid/recipes/libtorrent/setup-lib-name.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
--- libtorrent/bindings/python/setup.py 2016-02-28 08:28:49.000000000 +0100
+++ patch/bindings/python/setup.py 2016-07-12 12:03:05.256455888 +0200
@@ -97,7 +97,7 @@
source_list = os.listdir(os.path.join(os.path.dirname(__file__), "src"))
source_list = [os.path.join("src", s) for s in source_list if s.endswith(".cpp")]

- ext = [Extension('libtorrent',
+ ext = [Extension('libtorrent_rasterbar',
sources = source_list,
language='c++',
include_dirs = parse_cmd(extra_cmd, '-I'),
@@ -107,7 +107,7 @@
+ target_specific(),
libraries = ['torrent-rasterbar'] + parse_cmd(extra_cmd, '-l'))]

-setup(name = 'python-libtorrent',
+setup(name = 'libtorrent',
version = '1.0.9',
author = 'Arvid Norberg',
author_email = 'arvid@libtorrent.org',
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
if ( <toolset>gcc in $(properties) )
{
- result += <linkflags>-Wl,-Bsymbolic ;
+ result += <linkflags>-Wl,-soname=libtorrentpython.so,-Bsymbolic ;
+ result += <linkflags>-Wl,-soname=libtorrent.so,-Bsymbolic ;
}
}