-
Notifications
You must be signed in to change notification settings - Fork 3
/
setup.py
72 lines (57 loc) · 2.24 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/usr/bin/env python3
import os
import sys
import shutil
from setuptools import setup
from distutils.core import Extension
from distutils.command.build_ext import build_ext
NAME = 'komodo-python3-dbgp'
class Dbgp_build_ext(build_ext):
# a fake build_ext, copy our provided pre-built binaries to the right target
def build_extensions(self):
scriptdir = os.path.dirname(os.path.abspath(sys.argv[0]))
# weird, for me plat_name is 'linux-i686' on a 32bit linux
if 'win32' in self.plat_name:
plat = 'win32-x86'
elif 'linux' in self.plat_name:
if '64' in self.plat_name:
plat = 'linux-x86_64'
else:
plat = 'linux-x86'
sourcepath = os.path.join(scriptdir, 'libs', plat)
if os.path.exists(sourcepath):
# not all platforms have binaries
buildpath = os.path.dirname(self.get_ext_fullpath('dbgp._client'))
targetpath = os.path.join(os.getcwd(), buildpath)
for fn in os.listdir(sourcepath):
src = os.path.join(sourcepath, fn)
tgt = os.path.join(targetpath, fn)
shutil.copyfile(src, tgt)
print(NAME)
print("prebuilt binaries were copied")
setup(
name=NAME,
version='11.1.2.dev0',
description='The ActiveState Komodo DBGP server',
author="Shane Caraveo, Trent Mick",
author_email="[email protected]",
maintainer='Adam Groszer',
maintainer_email='[email protected]',
classifiers=[
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.1",
"Programming Language :: Python :: 3.2",
"Programming Language :: Python :: 3.3",
"Programming Language :: Python :: Implementation :: CPython",
],
url='http://github.com/agroszer/komodo-python3-dbgp',
packages=['dbgp'],
scripts=['bin/pydbgp',
'bin/pydbgpproxy'],
zip_safe=False,
ext_modules=[Extension("dbgp._client", ["_client.c"])], # dummy
cmdclass={"build_ext": Dbgp_build_ext}, # WE provide our own build
)