1 from setuptools
import setup
, find_packages
, Extension
2 from setuptools
import setup
, find_packages
, Extension
3 from distutils
import sysconfig
5 #from distutils.core import setup, Extension
11 python_version
= platform
.python_version()[0:3]
14 for remove
in ['-g', '-Wstrict-prototypes']:
15 sysconfig
.get_config_vars()["CFLAGS"] = sysconfig
.get_config_vars()["CFLAGS"].replace(remove
, " ")
17 # The libtorrent extension
18 _extra_compile_args
= [
19 "-Wno-missing-braces",
20 "-DHAVE_INCLUDE_LIBTORRENT_ASIO____ASIO_HPP",
21 "-DHAVE_INCLUDE_LIBTORRENT_ASIO_SSL_STREAM_HPP",
22 "-DHAVE_INCLUDE_LIBTORRENT_ASIO_IP_TCP_HPP",
23 "-DTORRENT_LINKING_SHARED",
24 "-DTORRENT_BUILDING_SHARED",
28 "-DBOOST_MULTI_INDEX_DISABLE_SERIALIZATION",
29 "-DBOOST_THREAD_USE_LIB",
30 "-D_FILE_OFFSET_BITS=64",
32 "-DTORRENT_USE_OPENSSL",
34 "-DTORRENT_DISABLE_GEO_IP",
39 './libtorrent/include',
40 './libtorrent/include/libtorrent',
41 '/usr/include/python' + python_version
,
46 'boost_filesystem-mt',
58 _sources
= glob
.glob("./libtorrent/src/*.cpp") + \
59 glob
.glob("./libtorrent/src/kademlia/*.cpp") + \
60 glob
.glob("./libtorrent/bindings/python/src/*.cpp")
62 for source
in _sources
:
63 if "file_win.cpp" in source
: _sources
.remove(source
)
64 if "mapped_storage.cpp" in source
: _sources
.remove(source
)
66 libtorrent
= Extension(
68 include_dirs
= _include_dirs
,
69 library_dirs
= ["/opt/local/lib/"],
70 libraries
= _libraries
,
71 extra_compile_args
= _extra_compile_args
,
78 sources
= glob
.glob("./pytx/*.c"),
79 libraries
= ['ncurses', 'panel'],
80 extra_compile_args
= ['-g', '-pg']
85 fullname
= "Tore: client/daemon bittorrent software shipped with a NCurses client",
87 author
= "Josh Davis",
88 author_email
= "sivad77@gmail.com",
89 include_package_data
= True,
90 description
= "Curses bittorrent client/daemon",
91 ext_modules
= [pytx
, libtorrent
],