Added
Link Here
|
1 |
--- setup.py.orig 2020-11-22 14:19:41 UTC |
2 |
+++ setup.py |
3 |
@@ -19,18 +19,6 @@ from setuptools.command.build_ext import build_ext as |
4 |
from subprocess import Popen |
5 |
|
6 |
DIR = os.path.abspath(os.path.dirname(__file__)) |
7 |
-LIB_OBJECTS = [ |
8 |
- 'core/desugarer.o', |
9 |
- 'core/formatter.o', |
10 |
- 'core/libjsonnet.o', |
11 |
- 'core/lexer.o', |
12 |
- 'core/parser.o', |
13 |
- 'core/pass.o', |
14 |
- 'core/static_analysis.o', |
15 |
- 'core/string_utils.o', |
16 |
- 'core/vm.o', |
17 |
- 'third_party/md5/md5.o' |
18 |
-] |
19 |
|
20 |
MODULE_SOURCES = ['python/_jsonnet.c'] |
21 |
|
22 |
@@ -46,19 +34,10 @@ def get_version(): |
23 |
v_code = v_code[1:] |
24 |
return v_code |
25 |
|
26 |
-class BuildJsonnetExt(BuildExt): |
27 |
- def run(self): |
28 |
- p = Popen(['make'] + LIB_OBJECTS, cwd=DIR) |
29 |
- p.wait() |
30 |
- if p.returncode != 0: |
31 |
- raise Exception('Could not build %s' % (', '.join(LIB_OBJECTS))) |
32 |
- BuildExt.run(self) |
33 |
- |
34 |
jsonnet_ext = Extension( |
35 |
'_jsonnet', |
36 |
sources=MODULE_SOURCES, |
37 |
- extra_objects=LIB_OBJECTS, |
38 |
- include_dirs = ['include', 'third_party/md5', 'third_party/json'], |
39 |
+ libraries = ['jsonnet'], |
40 |
language='c++' |
41 |
) |
42 |
|
43 |
@@ -68,9 +47,6 @@ setup(name='jsonnet', |
44 |
author='David Cunningham', |
45 |
author_email='dcunnin@google.com', |
46 |
version=get_version(), |
47 |
- cmdclass={ |
48 |
- 'build_ext': BuildJsonnetExt, |
49 |
- }, |
50 |
ext_modules=[jsonnet_ext], |
51 |
test_suite="python._jsonnet_test", |
52 |
) |