forked from premiere/premiere-libtorrent
Merge pull request #182 from arvidn/python-fix
revert py_libtorrent renaming for python binding
This commit is contained in:
commit
b8ed9eff48
12
.travis.yml
12
.travis.yml
|
@ -64,9 +64,15 @@ script:
|
||||||
- bjam --hash -j3 warnings-as-errors=on variant=$variant -l900 $toolset $target
|
- bjam --hash -j3 warnings-as-errors=on variant=$variant -l900 $toolset $target
|
||||||
- cd ../examples
|
- cd ../examples
|
||||||
- bjam --hash -j3 warnings-as-errors=on variant=$variant $toolset link=shared
|
- bjam --hash -j3 warnings-as-errors=on variant=$variant $toolset link=shared
|
||||||
- cd ../bindings/python
|
- cd ..
|
||||||
- bjam --hash -j3 warnings-as-errors=on variant=$variant $toolset stage_module libtorrent-link=shared
|
# build libtorrent separately and install it in a temporary (well known) dir
|
||||||
- LD_LIBRARY_PATH=. DYLD_LIBRARY_PATH=. python test.py
|
# we have to do this because on linux the name of the python module is the same
|
||||||
|
# as the main library, so we can't stage them to the same directory
|
||||||
|
- bjam --hash -j3 warnings-as-errors=on link=shared variant=$variant $toolset install location=./lib
|
||||||
|
- cd bindings/python
|
||||||
|
# here we specify the temporary lib dir as a path to look for the main library
|
||||||
|
- bjam --hash -j3 warnings-as-errors=on variant=$variant $toolset stage_module libtorrent-link=shared dll-path=../../lib
|
||||||
|
- LD_LIBRARY_PATH=../../lib DYLD_LIBRARY_PATH=../../lib python test.py
|
||||||
- if [ $sim = "1" ]; then
|
- if [ $sim = "1" ]; then
|
||||||
cd ../../simulation;
|
cd ../../simulation;
|
||||||
bjam --hash -j2 crypto=built-in $toolset;
|
bjam --hash -j2 crypto=built-in $toolset;
|
||||||
|
|
3
Jamfile
3
Jamfile
|
@ -799,8 +799,7 @@ lib torrent
|
||||||
headers = [ path.glob-tree include/libtorrent : *.hpp ] ;
|
headers = [ path.glob-tree include/libtorrent : *.hpp ] ;
|
||||||
|
|
||||||
package.install install
|
package.install install
|
||||||
: <install-source-root>libtorrent
|
: <install-type>LIB
|
||||||
<install-no-version-symlinks>on
|
|
||||||
:
|
:
|
||||||
: torrent
|
: torrent
|
||||||
: $(headers)
|
: $(headers)
|
||||||
|
|
|
@ -114,7 +114,7 @@ build_script:
|
||||||
& cd %ROOT_DIRECTORY%\examples
|
& cd %ROOT_DIRECTORY%\examples
|
||||||
& b2.exe --hash -j2 %compiler% variant=%variant% linkflags=%linkflags% include=%include% link=shared
|
& b2.exe --hash -j2 %compiler% variant=%variant% linkflags=%linkflags% include=%include% link=shared
|
||||||
& cd %ROOT_DIRECTORY%\bindings\python
|
& cd %ROOT_DIRECTORY%\bindings\python
|
||||||
& b2.exe --hash -j2 %compiler% stage_module variant=%variant% libtorrent-link=shared linkflags=%linkflags% include=%include%
|
& b2.exe --hash -j2 %compiler% stage_module install-dependencies=on variant=%variant% libtorrent-link=shared linkflags=%linkflags% include=%include%
|
||||||
& python test.py
|
& python test.py
|
||||||
)
|
)
|
||||||
- if defined sim (
|
- if defined sim (
|
||||||
|
|
|
@ -123,7 +123,7 @@ rule my-python-extension ( name : sources * : requirements * : default-build * :
|
||||||
] ;
|
] ;
|
||||||
}
|
}
|
||||||
|
|
||||||
my-python-extension py_libtorrent
|
my-python-extension libtorrent
|
||||||
: # sources
|
: # sources
|
||||||
src/module.cpp
|
src/module.cpp
|
||||||
src/big_number.cpp
|
src/big_number.cpp
|
||||||
|
@ -157,9 +157,8 @@ my-python-extension py_libtorrent
|
||||||
;
|
;
|
||||||
|
|
||||||
install stage_module
|
install stage_module
|
||||||
: py_libtorrent
|
: libtorrent
|
||||||
: <location>.
|
: <location>.
|
||||||
<install-dependencies>on
|
|
||||||
<install-type>LIB
|
<install-type>LIB
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|
|
@ -85,7 +85,7 @@ if '--bjam' in sys.argv:
|
||||||
except: pass
|
except: pass
|
||||||
try: os.mkdir('libtorrent')
|
try: os.mkdir('libtorrent')
|
||||||
except: pass
|
except: pass
|
||||||
shutil.copyfile('py_libtorrent' + file_ext, 'build/lib/libtorrent' + file_ext)
|
shutil.copyfile('libtorrent' + file_ext, 'build/lib/libtorrent' + file_ext)
|
||||||
|
|
||||||
packages = ['libtorrent']
|
packages = ['libtorrent']
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,7 @@ void bind_converters();
|
||||||
void bind_create_torrent();
|
void bind_create_torrent();
|
||||||
void bind_error_code();
|
void bind_error_code();
|
||||||
|
|
||||||
BOOST_PYTHON_MODULE(py_libtorrent)
|
BOOST_PYTHON_MODULE(libtorrent)
|
||||||
{
|
{
|
||||||
Py_Initialize();
|
Py_Initialize();
|
||||||
PyEval_InitThreads();
|
PyEval_InitThreads();
|
||||||
|
|
|
@ -1,10 +1,6 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
|
|
||||||
# this name "py_libtorrent" is the name produced by the Jamfile. The setup.py
|
import libtorrent as lt
|
||||||
# will actually name it libtorrent for the distro. It's only called
|
|
||||||
# py_libtorrent here to be able to coexist with the main libtorrent.so on linux
|
|
||||||
# (which otherwise would have the same name in the same directory)
|
|
||||||
import py_libtorrent as lt
|
|
||||||
|
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue