diff options
author | Patrick McLean <chutzpah@gentoo.org> | 2022-01-06 10:15:05 -0800 |
---|---|---|
committer | Patrick McLean <chutzpah@gentoo.org> | 2022-01-06 10:15:05 -0800 |
commit | de7834746390e34af62816986e2d0608a0b0f540 (patch) | |
tree | 4a082df555f45cfd598cab9d7d920819a903b885 /dev-lang/jsonnet | |
parent | net-libs/libmicrohttpd: fixed missing multilib dep (diff) | |
download | gentoo-de7834746390e34af62816986e2d0608a0b0f540.tar.gz gentoo-de7834746390e34af62816986e2d0608a0b0f540.tar.bz2 gentoo-de7834746390e34af62816986e2d0608a0b0f540.zip |
dev-lang/jsonnet: Version bump to 0.18.0
Unbundle nlohmann_json
Package-Manager: Portage-3.0.30, Repoman-3.0.3
Signed-off-by: Patrick McLean <chutzpah@gentoo.org>
Diffstat (limited to 'dev-lang/jsonnet')
-rw-r--r-- | dev-lang/jsonnet/Manifest | 1 | ||||
-rw-r--r-- | dev-lang/jsonnet/files/jsonnet-0.18.0-unbundle.patch | 75 | ||||
-rw-r--r-- | dev-lang/jsonnet/jsonnet-0.18.0.ebuild | 102 |
3 files changed, 178 insertions, 0 deletions
diff --git a/dev-lang/jsonnet/Manifest b/dev-lang/jsonnet/Manifest index 125cb3172b14..1ebf61717120 100644 --- a/dev-lang/jsonnet/Manifest +++ b/dev-lang/jsonnet/Manifest @@ -1,3 +1,4 @@ DIST jsonnet-0.15.0.tar.gz 21826038 BLAKE2B 722a844c00ec31b662d932a4481a71197adad680181c6a56a49dfa3e9b63696d29320c5278024d44c0ab3d7d80569514792f815ac7fa3a3cc08c7756fb6f08ad SHA512 b63c1bf82e4fc9ba3f1009ed4e4ba1010e3e7f81bd816a234e48d35607eae3cba95cab57813d35daa9f024e316bae5256340a6f8d6d884f9136cdbf062a2b351 DIST jsonnet-0.16.0.tar.gz 21828911 BLAKE2B d6e9648e259b94513507ba5a6e305f705541904d7755dc5521b7fc2940b761f413bfaba39521af54eb428337be2e75f07d12038edcf7e8a5ba95feccc8dd4a02 SHA512 80e0403ec8008cbacff8d9e8fe0e2b5d3bfa306d92c2c11d472e5721015ce4c11be745df10d25715f22f8d8594df69fabf2fe617bdded462ffc5b21f8923606f DIST jsonnet-0.17.0.tar.gz 21854054 BLAKE2B 91561f2cffb5c711d4ba58aceef90bbcd654997872936bcf475d397a7b831b833d349c828271e58795cca10c915ab4ec0a517dc0fc2f563673ba7a6e74cfea3f SHA512 d3ee6947163d8abced504ff37ecf365c0311164cbf243d4c635d34944f0831ca9fce2470acf00eb9a218f82a2e553b3f885db9bd21bb9dcefbd707fa0202925d +DIST jsonnet-0.18.0.tar.gz 22472162 BLAKE2B 4f931a44b0cbeea0dc7705c28ca49817e2b3abe19ba4fdcd550d5df1ce9ad6b06b1b740a9306d36caa3970c88df9d31700373e4997dd52c6c2219cdd9bf125c1 SHA512 08a64a4b132df1519292378cef93deb3c60d21636b2a71bce6c13e29cfd93cab465cad77e11f000fb984c5c75a4ca1c92504654fd2e5201343df767ea0e610d1 diff --git a/dev-lang/jsonnet/files/jsonnet-0.18.0-unbundle.patch b/dev-lang/jsonnet/files/jsonnet-0.18.0-unbundle.patch new file mode 100644 index 000000000000..7c19e8893f12 --- /dev/null +++ b/dev-lang/jsonnet/files/jsonnet-0.18.0-unbundle.patch @@ -0,0 +1,75 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 5df20ca..9e60fae 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -121,7 +121,6 @@ endif() + add_subdirectory(include) + add_subdirectory(stdlib) + add_subdirectory(third_party/md5) +-add_subdirectory(third_party/rapidyaml/rapidyaml ryml) + add_subdirectory(core) + add_subdirectory(cpp) + add_subdirectory(cmd) +diff --git a/core/vm.cpp b/core/vm.cpp +index 4617363..e328df5 100644 +--- a/core/vm.cpp ++++ b/core/vm.cpp +@@ -23,7 +23,7 @@ limitations under the License. + + #include "desugarer.h" + #include "json.h" +-#include "json.hpp" ++#include "nlohmann/json.hpp" + #include "md5.h" + #include "parser.h" + #include "ryml_std.hpp" // include this before any other ryml header +diff --git a/setup.py b/setup.py +index 0a2748a..356915d 100644 +--- a/setup.py ++++ b/setup.py +@@ -13,6 +13,7 @@ + # limitations under the License. + + import os ++import sys + from setuptools import setup + from setuptools import Extension + from setuptools.command.build_ext import build_ext as BuildExt +@@ -22,28 +23,6 @@ DIR = os.path.abspath(os.path.dirname(__file__)) + # NOTE: If you are editing the array below then you probably also need + # to change MANIFEST.in. + LIB_OBJECTS = [ +- 'core/desugarer.o', +- 'core/formatter.o', +- 'core/libjsonnet.o', +- 'core/lexer.o', +- 'core/parser.o', +- 'core/pass.o', +- 'core/static_analysis.o', +- 'core/string_utils.o', +- 'core/vm.o', +- 'third_party/md5/md5.o', +- 'third_party/rapidyaml/rapidyaml/ext/c4core/src/c4/char_traits.o', +- 'third_party/rapidyaml/rapidyaml/ext/c4core/src/c4/base64.o', +- 'third_party/rapidyaml/rapidyaml/ext/c4core/src/c4/language.o', +- 'third_party/rapidyaml/rapidyaml/ext/c4core/src/c4/memory_util.o', +- 'third_party/rapidyaml/rapidyaml/ext/c4core/src/c4/format.o', +- 'third_party/rapidyaml/rapidyaml/ext/c4core/src/c4/time.o', +- 'third_party/rapidyaml/rapidyaml/ext/c4core/src/c4/memory_resource.o', +- 'third_party/rapidyaml/rapidyaml/ext/c4core/src/c4/error.o', +- 'third_party/rapidyaml/rapidyaml/src/c4/yml/parse.o', +- 'third_party/rapidyaml/rapidyaml/src/c4/yml/preprocess.o', +- 'third_party/rapidyaml/rapidyaml/src/c4/yml/common.o', +- 'third_party/rapidyaml/rapidyaml/src/c4/yml/tree.o', + ] + + MODULE_SOURCES = ['python/_jsonnet.c'] +@@ -72,6 +51,8 @@ jsonnet_ext = Extension( + '_jsonnet', + sources=MODULE_SOURCES, + extra_objects=LIB_OBJECTS, ++ libraries = ['md5', 'jsonnet', 'ryml'], ++ library_dirs = [os.environ.get('CMAKE_BUILD_DIR')], + include_dirs = ['include'], + language='c++' + ) diff --git a/dev-lang/jsonnet/jsonnet-0.18.0.ebuild b/dev-lang/jsonnet/jsonnet-0.18.0.ebuild new file mode 100644 index 000000000000..456f3d3e9e49 --- /dev/null +++ b/dev-lang/jsonnet/jsonnet-0.18.0.ebuild @@ -0,0 +1,102 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +DISTUTILS_OPTIONAL=1 +PYTHON_COMPAT=( pypy3 python3_{7..10} ) + +inherit cmake toolchain-funcs flag-o-matic distutils-r1 + +DESCRIPTION="A data templating language for app and tool developers" +HOMEPAGE="https://jsonnet.org/" +SRC_URI="https://github.com/google/jsonnet/archive/v${PV}.tar.gz -> ${P}.tar.gz" +IUSE="custom-optimization doc examples python test" + +LICENSE="Apache-2.0" +SLOT="0" +KEYWORDS="~amd64 ~x86" +RDEPEND=" + dev-cpp/rapidyaml:= + dev-cpp/nlohmann_json:= + python? ( ${PYTHON_DEPS} ) +" + +DEPEND="${RDEPEND}" + +BDEPEND=" + python? ( + ${PYTHON_DEPS} + dev-python/setuptools[${PYTHON_USEDEP}] + ) +" +RESTRICT="!test? ( test )" + +REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )" + +PATCHES=( + "${FILESDIR}/jsonnet-0.12.1-dont-call-make-from-setuppy.patch" + "${FILESDIR}/jsonnet-0.16.0-libdir.patch" + "${FILESDIR}/jsonnet-0.16.0-cp-var.patch" + "${FILESDIR}/jsonnet-0.18.0-unbundle.patch" +) + +distutils_enable_tests unittest + +src_prepare() { + cmake_src_prepare + use python && distutils-r1_src_prepare +} + +src_configure() { + use custom-optimization || replace-flags '-O*' -O3 + tc-export CC CXX + + local mycmakeargs=( + -DUSE_SYSTEM_JSON=ON + -DBUILD_STATIC_LIBS=OFF + ) + + if use test; then + mycmakeargs+=( + -DBUILD_TESTS=ON + -DUSE_SYSTEM_GTEST=ON + ) + else + mycmakeargs+=( + -DBUILD_TESTS=OFF + ) + fi + + cmake_src_configure +} + +src_compile() { + cmake_src_compile + use python && CMAKE_BUILD_DIR="${BUILD_DIR}" distutils-r1_src_compile +} + +src_test() { + cmake_src_test + use python && CMAKE_BUILD_DIR="${BUILD_DIR}" distutils-r1_src_test +} + +python_test() { + LD_LIBRARY_PATH="${CMAKE_BUILD_DIR}" "${EPYTHON}" -m unittest python._jsonnet_test -v \ + || die "Tests failed with ${EPYTHON}" +} + +src_install() { + cmake_src_install + use python && distutils-r1_src_install + + if use doc; then + find doc -name '.gitignore' -delete || die + docinto html + dodoc -r doc/. + fi + if use examples; then + docinto examples + dodoc -r examples/. + fi +} |