-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsetup.py
48 lines (38 loc) · 1001 Bytes
/
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
#!/usr/bin/python3
import collections
import platform
from setuptools import setup, Extension
have_pkgconfig = True
try:
import pkgconfig
def pkgconfig_exists(package):
try:
return pkgconfig.exists(package)
except OSError:
return False
except ImportError:
have_pkgconfig = False
if have_pkgconfig and pkgconfig_exists("relic"):
flags = pkgconfig.parse("relic")
else:
flags = collections.defaultdict(list)
flags["libraries"] = ["relic"]
if platform.system() == "windows":
flags["libraries"].append("advapi32")
ext_modules = [
Extension(
"pyrelic._relic",
["pyrelic/_relic.pyx"],
define_macros=flags["define_macros"],
include_dirs=flags["include_dirs"],
library_dirs=flags["library_dirs"],
libraries=flags["libraries"],
)
]
setup(
ext_modules=ext_modules,
packages=["pyrelic"],
package_data={
"pyrelic": ["_relic.pyi", "py.typed"],
},
)