-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
executable file
·72 lines (63 loc) · 2.02 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 python
import os.path
import sys
try:
from setuptools import setup
from setuptools import Command
from setuptools import Extension
except ImportError:
sys.exit(
"We need the Python library setuptools to be installed. "
"Try running: python -m ensurepip"
)
extensions = []
include_dirs = ['Src','Src/Generic']
if sys.platform == 'darwin':
event_sources = ["Src/Mac/events.m",
]
gui_sources = ["Src/Mac/gui.m",
"Src/Mac/window.m",
"Src/Mac/image.m",
"Src/Mac/image_pbm.m",
"Src/Mac/text.m",
"Src/Mac/widgets.m",
"Src/Mac/layout.m",
"Src/Mac/font.m",
"Src/Mac/frame.m",
"Src/Mac/separator.m",
"Src/Mac/label.m",
"Src/Mac/button.m",
"Src/Mac/checkbox.m",
"Src/Mac/textbox.m",
"Src/Mac/listbox.m",
"Src/Mac/colors.m",
"Src/Mac/focus.m",
]
extra_link_args = ['-framework', 'Cocoa']
else:
event_sources = ["Src/X11/events.c",
]
gui_sources = ["Src/X11/window.c",
"Src/X11/graphics.c",
"Src/X11/gui.c",
]
include_dirs.append("/opt/X11/include")
extra_link_args = ["-L/opt/X11/lib/", "-lX11"]
extension = Extension("guitk.events",
event_sources,
include_dirs=include_dirs,
extra_link_args=extra_link_args,
)
extensions.append(extension)
extension = Extension("guitk.gui",
gui_sources,
include_dirs=include_dirs,
extra_link_args=extra_link_args,
)
extensions.append(extension)
setup(
name = "guitk",
packages = ['guitk'],
package_dir = {'': 'Lib'},
ext_modules=extensions,
)