forked from 0-1-0/lightblue-0.4
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
66 lines (59 loc) · 2.74 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
# On Python for Series 60, use the SIS files instead.
from distutils.core import setup, Extension
import sys
LINUX = sys.platform.startswith("linux")
MAC = sys.platform.startswith("darwin")
def getpackagedir():
if MAC:
return "src/mac"
elif LINUX:
return "src/linux"
else:
raise Exception("Unsupported platform")
def getextensions():
if LINUX:
linux_ext = Extension("_lightblueutil",
libraries=["bluetooth"], # C libraries
sources=["src/linux/lightblue_util.c"]
)
linux_obex_ext = Extension("_lightblueobex",
define_macros=[('LIGHTBLUE_DEBUG', '0')], # set to '1' to print debug messges
libraries=["bluetooth", "openobex"], # C libraries
sources=["src/linux/lightblueobex_client.c",
"src/linux/lightblueobex_server.c",
"src/linux/lightblueobex_main.c"],
)
return [linux_ext, linux_obex_ext]
return []
# install the main library
setup(name="lightblue",
version="0.4",
author="Bea Lam",
author_email="[email protected]",
url="http://lightblue.sourceforge.net",
description="Cross-platform Python Bluetooth library for Mac OS X, GNU/Linux and Python for Series 60.",
long_description="LightBlue is a cross-platform Python Bluetooth library for Mac OS X, GNU/Linux and Python for Series 60. It provides support for device and service discovery (with and without end-user GUIs), a standard socket interface for RFCOMM sockets, sending and receiving of files over OBEX, advertising of RFCOMM and OBEX services, and access to local device information.",
license="GPL",
packages=["lightblue"],
package_dir={"lightblue":getpackagedir()},
ext_modules=getextensions(),
classifiers = [ "Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"License :: OSI Approved :: GNU General Public License (GPL)",
"License :: OSI Approved :: GNU General Public License v3",
"Programming Language :: Python",
"Topic :: Software Development :: Libraries",
"Topic :: System :: Networking",
"Topic :: Communications",
"Operating System :: MacOS :: MacOS X",
"Operating System :: POSIX :: Linux",
"Operating System :: Other OS" ]
)
# On Mac, install LightAquaBlue framework
# if you want to install the framework somewhere other than /Library/Frameworks
# make sure the path is also changed in LightAquaBlue.py (in src/mac)
if MAC:
if "install" in sys.argv:
import os
os.chdir("src/mac/LightAquaBlue")
os.system("xcodebuild install -arch x86_64 -target LightAquaBlue -configuration Release DSTROOT=/ INSTALL_PATH=/Library/Frameworks DEPLOYMENT_LOCATION=YES")