1 |
commit: 8e87ce69a8b39fb1f90732acb019d90f82687b2a |
2 |
Author: David Coles <coles.david <AT> gmail <DOT> com> |
3 |
AuthorDate: Fri May 3 00:30:33 2019 +0000 |
4 |
Commit: Patrick McLean <chutzpah <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri May 3 00:31:42 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8e87ce69 |
7 |
|
8 |
dev-lang/jsonnet: New package |
9 |
|
10 |
Package-Manager: Portage-2.3.66, Repoman-2.3.12 |
11 |
Signed-off-by: Patrick McLean <chutzpah <AT> gentoo.org> |
12 |
Signed-off-by: David Coles <coles.david <AT> gmail.com> |
13 |
|
14 |
dev-lang/jsonnet/Manifest | 1 + |
15 |
...sonnet-0.12.1-dont-call-make-from-setuppy.patch | 14 ++++++ |
16 |
.../jsonnet/files/jsonnet-0.12.1-makefile.patch | 28 +++++++++++ |
17 |
dev-lang/jsonnet/jsonnet-0.12.1.ebuild | 58 ++++++++++++++++++++++ |
18 |
dev-lang/jsonnet/metadata.xml | 15 ++++++ |
19 |
5 files changed, 116 insertions(+) |
20 |
|
21 |
diff --git a/dev-lang/jsonnet/Manifest b/dev-lang/jsonnet/Manifest |
22 |
new file mode 100644 |
23 |
index 00000000000..ed4712918a9 |
24 |
--- /dev/null |
25 |
+++ b/dev-lang/jsonnet/Manifest |
26 |
@@ -0,0 +1 @@ |
27 |
+DIST jsonnet-0.12.1.tar.gz 21839349 BLAKE2B 8601a35263003723b435d0075fe60f5301a49bddf63cdd55958df3eb7474569c28dbf54e0ba9d07fb6ade395af725193d1432b2c43fb2b271531af179e850df4 SHA512 25523dd19b4209a5ca39275ab3d3726b934442dd83a965ab0b79f0c67bd8ae85c438b2a63990b8eec921b137f908f946696be331b08cef92f15b6b8fa548cb0d |
28 |
|
29 |
diff --git a/dev-lang/jsonnet/files/jsonnet-0.12.1-dont-call-make-from-setuppy.patch b/dev-lang/jsonnet/files/jsonnet-0.12.1-dont-call-make-from-setuppy.patch |
30 |
new file mode 100644 |
31 |
index 00000000000..66bb5d2b07e |
32 |
--- /dev/null |
33 |
+++ b/dev-lang/jsonnet/files/jsonnet-0.12.1-dont-call-make-from-setuppy.patch |
34 |
@@ -0,0 +1,14 @@ |
35 |
+diff --git a/setup.py b/setup.py |
36 |
+index bfad34a..cfb30c3 100644 |
37 |
+--- a/setup.py |
38 |
++++ b/setup.py |
39 |
+@@ -68,9 +68,6 @@ setup(name='jsonnet', |
40 |
+ author='David Cunningham', |
41 |
+ author_email='dcunnin@××××××.com', |
42 |
+ version=get_version(), |
43 |
+- cmdclass={ |
44 |
+- 'build_ext': BuildJsonnetExt, |
45 |
+- }, |
46 |
+ ext_modules=[jsonnet_ext], |
47 |
+ test_suite="python._jsonnet_test", |
48 |
+ ) |
49 |
|
50 |
diff --git a/dev-lang/jsonnet/files/jsonnet-0.12.1-makefile.patch b/dev-lang/jsonnet/files/jsonnet-0.12.1-makefile.patch |
51 |
new file mode 100644 |
52 |
index 00000000000..b52c899aa77 |
53 |
--- /dev/null |
54 |
+++ b/dev-lang/jsonnet/files/jsonnet-0.12.1-makefile.patch |
55 |
@@ -0,0 +1,28 @@ |
56 |
+diff --git a/Makefile b/Makefile |
57 |
+index c6d38e5..8dbaa9f 100644 |
58 |
+--- a/Makefile |
59 |
++++ b/Makefile |
60 |
+@@ -29,8 +29,8 @@ OD ?= od |
61 |
+ |
62 |
+ OPT ?= -O3 |
63 |
+ |
64 |
+-CXXFLAGS ?= -g $(OPT) -Wall -Wextra -Woverloaded-virtual -pedantic -std=c++0x -fPIC -Iinclude -Ithird_party/md5 -Ithird_party/json |
65 |
+-CFLAGS ?= -g $(OPT) -Wall -Wextra -pedantic -std=c99 -fPIC -Iinclude |
66 |
++CXXFLAGS += -Wall -Wextra -Woverloaded-virtual -pedantic -std=c++0x -fPIC -Iinclude -Ithird_party/md5 -Ithird_party/json |
67 |
++CFLAGS += -Wall -Wextra -pedantic -std=c99 -fPIC -Iinclude |
68 |
+ MAKEDEPENDFLAGS ?= -Iinclude -Ithird_party/md5 -Ithird_party/json |
69 |
+ EMCXXFLAGS = $(CXXFLAGS) -g0 -Os --memory-init-file 0 -s DISABLE_EXCEPTION_CATCHING=0 -s OUTLINING_LIMIT=10000 -s RESERVED_FUNCTION_POINTERS=20 -s ASSERTIONS=1 -s ALLOW_MEMORY_GROWTH=1 |
70 |
+ EMCFLAGS = $(CFLAGS) --memory-init-file 0 -s DISABLE_EXCEPTION_CATCHING=0 -s ASSERTIONS=1 -s ALLOW_MEMORY_GROWTH=1 |
71 |
+@@ -123,10 +123,10 @@ jsonnet: cmd/jsonnet.cpp $(LIB_OBJ) |
72 |
+ |
73 |
+ # C binding. |
74 |
+ libjsonnet.so: $(LIB_OBJ) |
75 |
+- $(CXX) $(LDFLAGS) $(LIB_OBJ) $(SHARED_LDFLAGS) -o $@ |
76 |
++ $(CXX) $(LDFLAGS) $(LIB_OBJ) $(SHARED_LDFLAGS) -Wl,-soname,libjsonnet.so -o $@ |
77 |
+ |
78 |
+ libjsonnet++.so: $(LIB_CPP_OBJ) |
79 |
+- $(CXX) $(LDFLAGS) $(LIB_CPP_OBJ) $(SHARED_LDFLAGS) -o $@ |
80 |
++ $(CXX) $(LDFLAGS) $(LIB_CPP_OBJ) $(SHARED_LDFLAGS) -Wl,-soname,libjsonnet++.so -o $@ |
81 |
+ |
82 |
+ # JavaScript build of C binding |
83 |
+ JS_EXPORTED_FUNCTIONS = 'EXPORTED_FUNCTIONS=["_jsonnet_make", "_jsonnet_evaluate_snippet", "_jsonnet_fmt_snippet", "_jsonnet_ext_var", "_jsonnet_ext_code", "_jsonnet_tla_var", "_jsonnet_tla_code", "_jsonnet_realloc", "_jsonnet_destroy", "_jsonnet_import_callback"]' |
84 |
|
85 |
diff --git a/dev-lang/jsonnet/jsonnet-0.12.1.ebuild b/dev-lang/jsonnet/jsonnet-0.12.1.ebuild |
86 |
new file mode 100644 |
87 |
index 00000000000..9a918f8379d |
88 |
--- /dev/null |
89 |
+++ b/dev-lang/jsonnet/jsonnet-0.12.1.ebuild |
90 |
@@ -0,0 +1,58 @@ |
91 |
+# Copyright 1999-2019 Gentoo Authors |
92 |
+# Distributed under the terms of the GNU General Public License v2 |
93 |
+ |
94 |
+EAPI=7 |
95 |
+ |
96 |
+DISTUTILS_OPTIONAL=1 |
97 |
+PYTHON_COMPAT=( python3_6 python3_7 ) |
98 |
+ |
99 |
+inherit toolchain-funcs distutils-r1 |
100 |
+ |
101 |
+DESCRIPTION="A data templating language for app and tool developers " |
102 |
+HOMEPAGE="http://jsonnet.org/" |
103 |
+SRC_URI="https://github.com/google/jsonnet/archive/v0.12.1.tar.gz -> ${P}.tar.gz" |
104 |
+IUSE="python" |
105 |
+ |
106 |
+LICENSE="Apache-2.0" |
107 |
+SLOT="0" |
108 |
+KEYWORDS="~amd64 ~x86" |
109 |
+DEPEND="python? ( ${PYTHON_DEPS} )" |
110 |
+RDEPEND="python? ( ${PYTHON_DEPS} )" |
111 |
+BDEPEND="python? ( ${PYTHON_DEPS} |
112 |
+ dev-python/setuptools[${PYTHON_USEDEP}] |
113 |
+ )" |
114 |
+ |
115 |
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )" |
116 |
+ |
117 |
+PATCHES=( |
118 |
+ "${FILESDIR}/jsonnet-0.12.1-makefile.patch" |
119 |
+ "${FILESDIR}/jsonnet-0.12.1-dont-call-make-from-setuppy.patch" |
120 |
+) |
121 |
+ |
122 |
+src_compile() { |
123 |
+ emake CC="$(tc-getCC)" CXX="$(tc-getCXX)" \ |
124 |
+ jsonnet \ |
125 |
+ libjsonnet.so \ |
126 |
+ libjsonnet++.so |
127 |
+ |
128 |
+ use python && distutils-r1_src_compile |
129 |
+} |
130 |
+ |
131 |
+src_test() { |
132 |
+ emake CC="$(tc-getCC)" CXX="$(tc-getCXX)" test |
133 |
+ use python && distutils-r1_src_test |
134 |
+} |
135 |
+ |
136 |
+python_test() { |
137 |
+ esetup.py test || die |
138 |
+} |
139 |
+ |
140 |
+src_install() { |
141 |
+ # no install target in the Makefile |
142 |
+ exeinto /usr/$(get_libdir) |
143 |
+ doexe libjsonnet*.so |
144 |
+ |
145 |
+ dobin jsonnet |
146 |
+ |
147 |
+ use python && distutils-r1_src_install |
148 |
+} |
149 |
|
150 |
diff --git a/dev-lang/jsonnet/metadata.xml b/dev-lang/jsonnet/metadata.xml |
151 |
new file mode 100644 |
152 |
index 00000000000..9c2644baf91 |
153 |
--- /dev/null |
154 |
+++ b/dev-lang/jsonnet/metadata.xml |
155 |
@@ -0,0 +1,15 @@ |
156 |
+<?xml version="1.0" encoding="UTF-8"?> |
157 |
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> |
158 |
+<pkgmetadata> |
159 |
+ <maintainer type="person"> |
160 |
+ <email>coles.david@×××××.com</email> |
161 |
+ <name>David Coles</name> |
162 |
+ </maintainer> |
163 |
+ <maintainer type="person"> |
164 |
+ <email>chutzpah@g.o</email> |
165 |
+ <name>Patrick McLean</name> |
166 |
+ </maintainer> |
167 |
+ <upstream> |
168 |
+ <remote-id type="github">google/jsonnet</remote-id> |
169 |
+ </upstream> |
170 |
+</pkgmetadata> |