From 55913be7fc215a38207f22694142c49596e13473 Mon Sep 17 00:00:00 2001 From: Nathan Owens Date: Mon, 16 Dec 2019 21:59:16 -0600 Subject: [PATCH] jsonnet: Add devel package Package development libraries and headers. Closes #17240 Signed-off-by: Nathan Owens --- common/shlibs | 2 + srcpkgs/jsonnet-devel | 1 + srcpkgs/jsonnet/patches/Makefile.patch | 57 ++++++++++++++++++++++++++ srcpkgs/jsonnet/template | 17 ++++---- 4 files changed, 69 insertions(+), 8 deletions(-) create mode 120000 srcpkgs/jsonnet-devel create mode 100644 srcpkgs/jsonnet/patches/Makefile.patch diff --git a/common/shlibs b/common/shlibs index 5304579ecca..2388e4d6aab 100644 --- a/common/shlibs +++ b/common/shlibs @@ -3709,3 +3709,5 @@ libtss2-tcti-mssim.so.0 tpm2-tss-2.3.1_1 libtss2-tctildr.so.0 tpm2-tss-2.3.1_1 libzfs.so.2 zfs-0.8.2_1 libnvpair.so.1 zfs-0.8.2_1 +libjsonnet.so.0 jsonnet-0.14.0_2 +libjsonnet++.so.0 jsonnet-0.14.0_2 diff --git a/srcpkgs/jsonnet-devel b/srcpkgs/jsonnet-devel new file mode 120000 index 00000000000..8c203503ed9 --- /dev/null +++ b/srcpkgs/jsonnet-devel @@ -0,0 +1 @@ +jsonnet \ No newline at end of file diff --git a/srcpkgs/jsonnet/patches/Makefile.patch b/srcpkgs/jsonnet/patches/Makefile.patch new file mode 100644 index 00000000000..a9bb48ccf82 --- /dev/null +++ b/srcpkgs/jsonnet/patches/Makefile.patch @@ -0,0 +1,57 @@ +Remove javascript file install, and also removes +the need of the EM++ EMCC compiler, not in the repo. +Also add DESTDIR to fix packaging install. +DESTDIR fixes submitted upstream: +PR: https://github.com/google/jsonnet/pull/740 +--- +diff --git Makefile Makefile +index 474655c..c533125 100644 +--- Makefile ++++ Makefile +@@ -82,10 +82,6 @@ LIBS = \ + libjsonnet++.so.$(VERSION) \ + + ALL = \ +- libjsonnet_test_snippet \ +- libjsonnet_test_file \ +- libjsonnet.js \ +- doc/js/libjsonnet.js \ + $(BINS) \ + $(LIBS) \ + $(LIB_OBJ) +@@ -187,12 +183,6 @@ JS_EXPORTED_FUNCTIONS = 'EXPORTED_FUNCTIONS=["_jsonnet_make", "_jsonnet_evaluate + JS_RUNTIME_METHODS = 'EXTRA_EXPORTED_RUNTIME_METHODS=["cwrap", "_free", "getValue", "lengthBytesUTF8", "_malloc", "UTF8ToString", "setValue", "stringToUTF8", "addFunction"]' + + +-libjsonnet.js: $(LIB_SRC) $(ALL_HEADERS) +- $(EMCXX) -s WASM=0 -s $(JS_EXPORTED_FUNCTIONS) -s $(JS_RUNTIME_METHODS) $(EMCXXFLAGS) $(LDFLAGS) $(LIB_SRC) -o $@ +- +-# Copy javascript build to doc directory +-doc/js/libjsonnet.js: libjsonnet.js +- $(CP) $^ $@ + + # Tests for C binding. + LIBJSONNET_TEST_SNIPPET_SRCS = \ +diff --git Makefile Makefile +index c533125..56fb1e4 100644 +--- Makefile ++++ Makefile +@@ -122,12 +122,12 @@ endif + default: jsonnet jsonnetfmt + + install: bins libs +- mkdir -p $(PREFIX)/bin +- cp $(BINS) $(PREFIX)/bin/ +- mkdir -p $(PREFIX)/lib +- cp $(LIBS) $(PREFIX)/lib/ +- mkdir -p $(PREFIX)/include +- cp $(INCS) $(PREFIX)/include/ ++ mkdir -p $(DESTDIR)$(PREFIX)/bin ++ cp $(BINS) $(DESTDIR)$(PREFIX)/bin/ ++ mkdir -p $(DESTDIR)$(PREFIX)/lib ++ cp $(LIBS) $(DESTDIR)$(PREFIX)/lib/ ++ mkdir -p $(DESTDIR)$(PREFIX)/include ++ cp $(INCS) $(DESTDIR)$(PREFIX)/include/ + + all: $(ALL) + diff --git a/srcpkgs/jsonnet/template b/srcpkgs/jsonnet/template index f6074776e92..6a6f2b468b3 100644 --- a/srcpkgs/jsonnet/template +++ b/srcpkgs/jsonnet/template @@ -1,9 +1,8 @@ # Template file for 'jsonnet' pkgname=jsonnet version=0.14.0 -revision=1 +revision=2 build_style=gnu-makefile -make_build_args="bins" short_desc="Data templating language" maintainer="Leah Neukirchen " license="Apache-2.0" @@ -11,11 +10,13 @@ homepage="https://github.com/google/jsonnet" distfiles="https://github.com/google/jsonnet/archive/v${version}.tar.gz" checksum=7f41cdc4cb366cfc1de3aada926a2f7e640ef025887eb05cdaf8342d6e4e088b -CXXFLAGS="-Iinclude -Ithird_party/md5 -Ithird_party/json" -CFLAGS="-Iinclude" +CXXFLAGS="-fPIC" -do_install() { - vbin jsonnet - vbin jsonnetfmt - vsconf stdlib/std.jsonnet +jsonnet-devel_package() { + depends="${sourcepkg}-${version}_${revision}" + short_desc="${short_desc} - development files" + pkg_install() { + vmove usr/include + vmove "usr/lib/*.so" + } }