commit:     8e87ce69a8b39fb1f90732acb019d90f82687b2a
Author:     David Coles <coles.david <AT> gmail <DOT> com>
AuthorDate: Fri May  3 00:30:33 2019 +0000
Commit:     Patrick McLean <chutzpah <AT> gentoo <DOT> org>
CommitDate: Fri May  3 00:31:42 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8e87ce69

dev-lang/jsonnet: New package

Package-Manager: Portage-2.3.66, Repoman-2.3.12
Signed-off-by: Patrick McLean <chutzpah <AT> gentoo.org>
Signed-off-by: David Coles <coles.david <AT> gmail.com>

 dev-lang/jsonnet/Manifest                          |  1 +
 ...sonnet-0.12.1-dont-call-make-from-setuppy.patch | 14 ++++++
 .../jsonnet/files/jsonnet-0.12.1-makefile.patch    | 28 +++++++++++
 dev-lang/jsonnet/jsonnet-0.12.1.ebuild             | 58 ++++++++++++++++++++++
 dev-lang/jsonnet/metadata.xml                      | 15 ++++++
 5 files changed, 116 insertions(+)

diff --git a/dev-lang/jsonnet/Manifest b/dev-lang/jsonnet/Manifest
new file mode 100644
index 00000000000..ed4712918a9
--- /dev/null
+++ b/dev-lang/jsonnet/Manifest
@@ -0,0 +1 @@
+DIST jsonnet-0.12.1.tar.gz 21839349 BLAKE2B 
8601a35263003723b435d0075fe60f5301a49bddf63cdd55958df3eb7474569c28dbf54e0ba9d07fb6ade395af725193d1432b2c43fb2b271531af179e850df4
 SHA512 
25523dd19b4209a5ca39275ab3d3726b934442dd83a965ab0b79f0c67bd8ae85c438b2a63990b8eec921b137f908f946696be331b08cef92f15b6b8fa548cb0d

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
new file mode 100644
index 00000000000..66bb5d2b07e
--- /dev/null
+++ b/dev-lang/jsonnet/files/jsonnet-0.12.1-dont-call-make-from-setuppy.patch
@@ -0,0 +1,14 @@
+diff --git a/setup.py b/setup.py
+index bfad34a..cfb30c3 100644
+--- a/setup.py
++++ b/setup.py
+@@ -68,9 +68,6 @@ setup(name='jsonnet',
+       author='David Cunningham',
+       author_email='[email protected]',
+       version=get_version(),
+-      cmdclass={
+-          'build_ext': BuildJsonnetExt,
+-      },
+       ext_modules=[jsonnet_ext],
+       test_suite="python._jsonnet_test",
+ )

diff --git a/dev-lang/jsonnet/files/jsonnet-0.12.1-makefile.patch 
b/dev-lang/jsonnet/files/jsonnet-0.12.1-makefile.patch
new file mode 100644
index 00000000000..b52c899aa77
--- /dev/null
+++ b/dev-lang/jsonnet/files/jsonnet-0.12.1-makefile.patch
@@ -0,0 +1,28 @@
+diff --git a/Makefile b/Makefile
+index c6d38e5..8dbaa9f 100644
+--- a/Makefile
++++ b/Makefile
+@@ -29,8 +29,8 @@ OD ?= od
+ 
+ OPT ?= -O3
+ 
+-CXXFLAGS ?= -g $(OPT) -Wall -Wextra -Woverloaded-virtual -pedantic -std=c++0x 
-fPIC -Iinclude -Ithird_party/md5 -Ithird_party/json
+-CFLAGS ?= -g $(OPT) -Wall -Wextra -pedantic -std=c99 -fPIC -Iinclude
++CXXFLAGS += -Wall -Wextra -Woverloaded-virtual -pedantic -std=c++0x -fPIC 
-Iinclude -Ithird_party/md5 -Ithird_party/json
++CFLAGS += -Wall -Wextra -pedantic -std=c99 -fPIC -Iinclude
+ MAKEDEPENDFLAGS ?= -Iinclude -Ithird_party/md5 -Ithird_party/json
+ 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
+ EMCFLAGS = $(CFLAGS) --memory-init-file 0 -s DISABLE_EXCEPTION_CATCHING=0 -s 
ASSERTIONS=1 -s ALLOW_MEMORY_GROWTH=1
+@@ -123,10 +123,10 @@ jsonnet: cmd/jsonnet.cpp $(LIB_OBJ)
+ 
+ # C binding.
+ libjsonnet.so: $(LIB_OBJ)
+-      $(CXX) $(LDFLAGS) $(LIB_OBJ) $(SHARED_LDFLAGS) -o $@
++      $(CXX) $(LDFLAGS) $(LIB_OBJ) $(SHARED_LDFLAGS) 
-Wl,-soname,libjsonnet.so -o $@
+ 
+ libjsonnet++.so: $(LIB_CPP_OBJ)
+-      $(CXX) $(LDFLAGS) $(LIB_CPP_OBJ) $(SHARED_LDFLAGS) -o $@
++      $(CXX) $(LDFLAGS) $(LIB_CPP_OBJ) $(SHARED_LDFLAGS) 
-Wl,-soname,libjsonnet++.so -o $@
+ 
+ # JavaScript build of C binding
+ 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"]'

diff --git a/dev-lang/jsonnet/jsonnet-0.12.1.ebuild 
b/dev-lang/jsonnet/jsonnet-0.12.1.ebuild
new file mode 100644
index 00000000000..9a918f8379d
--- /dev/null
+++ b/dev-lang/jsonnet/jsonnet-0.12.1.ebuild
@@ -0,0 +1,58 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+DISTUTILS_OPTIONAL=1
+PYTHON_COMPAT=( python3_6 python3_7 )
+
+inherit toolchain-funcs distutils-r1
+
+DESCRIPTION="A data templating language for app and tool developers "
+HOMEPAGE="http://jsonnet.org/";
+SRC_URI="https://github.com/google/jsonnet/archive/v0.12.1.tar.gz -> 
${P}.tar.gz"
+IUSE="python"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+DEPEND="python? ( ${PYTHON_DEPS} )"
+RDEPEND="python? ( ${PYTHON_DEPS} )"
+BDEPEND="python? ( ${PYTHON_DEPS}
+               dev-python/setuptools[${PYTHON_USEDEP}]
+       )"
+
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+PATCHES=(
+       "${FILESDIR}/jsonnet-0.12.1-makefile.patch"
+       "${FILESDIR}/jsonnet-0.12.1-dont-call-make-from-setuppy.patch"
+)
+
+src_compile() {
+       emake CC="$(tc-getCC)" CXX="$(tc-getCXX)" \
+               jsonnet \
+               libjsonnet.so \
+               libjsonnet++.so
+
+       use python && distutils-r1_src_compile
+}
+
+src_test() {
+       emake CC="$(tc-getCC)" CXX="$(tc-getCXX)" test
+       use python && distutils-r1_src_test
+}
+
+python_test() {
+       esetup.py test || die
+}
+
+src_install() {
+       # no install target in the Makefile
+       exeinto /usr/$(get_libdir)
+       doexe libjsonnet*.so
+
+       dobin jsonnet
+
+       use python && distutils-r1_src_install
+}

diff --git a/dev-lang/jsonnet/metadata.xml b/dev-lang/jsonnet/metadata.xml
new file mode 100644
index 00000000000..9c2644baf91
--- /dev/null
+++ b/dev-lang/jsonnet/metadata.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd";>
+<pkgmetadata>
+  <maintainer type="person">
+    <email>[email protected]</email>
+    <name>David Coles</name>
+  </maintainer>
+  <maintainer type="person">
+    <email>[email protected]</email>
+    <name>Patrick McLean</name>
+  </maintainer>
+  <upstream>
+    <remote-id type="github">google/jsonnet</remote-id>
+  </upstream>
+</pkgmetadata>

Reply via email to