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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
|
From: Ole Streicher <ole@aip.de>
Date: Fri, 21 Apr 2017 13:40:06 +0200
Subject: Use external xpa
---
setup.py | 39 ++++++---------------------------------
1 file changed, 6 insertions(+), 33 deletions(-)
diff --git a/setup.py b/setup.py
index dbd93f5..0915595 100644
--- a/setup.py
+++ b/setup.py
@@ -154,19 +154,14 @@ if not sys.platform.startswith('win'):
xpaio.c
""".split()
- package_data[PACKAGENAME].extend(XPA_FILES)
- suffix_lib = importlib.machinery.EXTENSION_SUFFIXES[0]
- package_data[PACKAGENAME].append(XPA_LIBNAME+suffix_lib)
-
- XPA_SOURCES = [os.path.join(XPALIB_DIR, c) for c in XPA_FILES]
- XPALIB_DEFINES = [("HAVE_CONFIG_H", "1")]
+ XPA_SOURCES = []
+ XPALIB_DEFINES = []
XPA_SOURCES.append(CYTHON_SOURCE)
xpa_module = Extension("imexam."+XPA_LIBNAME,
sources=XPA_SOURCES,
- include_dirs=[XPALIB_DIR],
define_macros=XPALIB_DEFINES,
- depends=[CONF_H_NAME],
+ libraries = ['xpa'],
)
if use_cython:
ext = cythonize(xpa_module)
@@ -195,23 +190,11 @@ if not sys.platform.startswith('win'):
('bdist_base', 'bdist_base'))
def run(self):
- try:
- if os.access(XPALIB_DIR + "Makefile", os.F_OK):
- check_call(["make", "clean"], cwd=XPALIB_DIR)
- except CalledProcessError as e:
- print(e)
- exit(1)
if os.access(CONF_H_NAME, os.F_OK):
os.remove(CONF_H_NAME)
os.remove("wrappers/xpa.c")
- xpa_bins = ["xpaaccess",
- "xpaget",
- "xpainfo",
- "xpamb",
- "xpans",
- "xpaset",
- ]
+ xpa_bins = []
for file in xpa_bins:
myfile = current_env + "/bin/" + file
if os.access(myfile, os.F_OK):
@@ -233,7 +216,7 @@ if not sys.platform.startswith('win'):
def initialize_options(self):
super().initialize_options()
self.noremake = None
- self.remake = True
+ self.remake = False
def finalize_options(self):
super().finalize_options()
@@ -264,16 +247,6 @@ if not sys.platform.startswith('win'):
def build_extensions(self):
super().build_extensions()
- def run(self):
- try:
- check_call(["sh", "./configure","--prefix="+current_env], cwd=XPALIB_DIR)
- check_call(["make", "clean"],cwd=XPALIB_DIR)
- check_call(["make", "install"], cwd=XPALIB_DIR)
- except CalledProcessError as e:
- print(e)
- exit(1)
- build_ext.run(self)
-
cmdclass.update({'install' : InstallWithRemake,
@@ -301,4 +274,4 @@ setup(
package_data=package_data,
package_dir={'imexam': 'imexam'},
ext_modules=ext,
-)
\ No newline at end of file
+)
|