diff options
| author | Nico Sonack <nsonack@herrhotzenplotz.de> | 2025-08-27 09:01:51 +0000 |
|---|---|---|
| committer | Robert Clausecker <fuz@FreeBSD.org> | 2025-08-29 18:01:55 +0000 |
| commit | 5623db0c74b4d320d7617df7417f89bc91f9b937 (patch) | |
| tree | b3e5998ec9023faaa42aa2fa10647df18af28990 | |
| parent | 99ef0938732a7de64445ff88c3f37d9d5e9c37de (diff) | |
textproc/pdjson: Public Domain JSON Parser Library for C
A public domain JSON parser focused on correctness, ANSI C99
compliance, full Unicode (UTF-8) support, minimal memory footprint,
and a simple API. As a streaming API, arbitrary large JSON could
be processed with a small amount of memory (the size of the largest
string in the JSON).
| -rw-r--r-- | textproc/Makefile | 1 | ||||
| -rw-r--r-- | textproc/pdjson/Makefile | 27 | ||||
| -rw-r--r-- | textproc/pdjson/distinfo | 3 | ||||
| -rw-r--r-- | textproc/pdjson/files/patch-Makefile | 21 | ||||
| -rw-r--r-- | textproc/pdjson/files/pdjson.pc.in | 11 | ||||
| -rw-r--r-- | textproc/pdjson/pkg-descr | 5 | ||||
| -rw-r--r-- | textproc/pdjson/pkg-plist | 4 |
7 files changed, 72 insertions, 0 deletions
diff --git a/textproc/Makefile b/textproc/Makefile index 9f9508f45f72..8844023e0091 100644 --- a/textproc/Makefile +++ b/textproc/Makefile @@ -1228,6 +1228,7 @@ SUBDIR += pdfresurrect SUBDIR += pdfsandwich SUBDIR += pdftohtml + SUBDIR += pdjson SUBDIR += pear-File_Fortune SUBDIR += pear-File_MARC SUBDIR += pear-Horde_CssMinify diff --git a/textproc/pdjson/Makefile b/textproc/pdjson/Makefile new file mode 100644 index 000000000000..087c1e6d1a8d --- /dev/null +++ b/textproc/pdjson/Makefile @@ -0,0 +1,27 @@ +PORTNAME= pdjson +DISTVERSION= g20250825 +CATEGORIES= textproc + +MAINTAINER= nsonack@herrhotzenplotz.de +COMMENT= Public Domain JSON Parser Library for C + +LICENSE= UNLICENSE +LICENSE_FILE= ${WRKSRC}/UNLICENSE + +USE_GITHUB= yes +GH_ACCOUNT= skeeto +GH_TAGNAME= 78fe04b820dc8817f540bdd87fb22887e0ef3981 +USE_LDCONFIG= yes + +TEST_TARGET= check + +SUB_FILES= pdjson.pc +SUB_LIST= DISTVERSION=${DISTVERSION} + +do-install: + ${INSTALL_LIB} ${WRKSRC}/libpdjson.so ${STAGEDIR}${LOCALBASE}/lib/libpdjson.so.0 + ${RLN} ${STAGEDIR}${LOCALBASE}/lib/libpdjson.so.0 ${STAGEDIR}${LOCALBASE}/lib/libpdjson.so + ${INSTALL} ${WRKSRC}/pdjson.h ${STAGEDIR}${LOCALBASE}/include + ${INSTALL_DATA} ${WRKDIR}/pdjson.pc ${STAGEDIR}${LOCALBASE}/libdata/pkgconfig + +.include <bsd.port.mk> diff --git a/textproc/pdjson/distinfo b/textproc/pdjson/distinfo new file mode 100644 index 000000000000..b457f5012f19 --- /dev/null +++ b/textproc/pdjson/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1756138081 +SHA256 (skeeto-pdjson-g20250825-78fe04b820dc8817f540bdd87fb22887e0ef3981_GH0.tar.gz) = e6bf6a90e65736faa5cfa6641a1f3278b577504d63f7fd2bf6b1454d94fa223c +SIZE (skeeto-pdjson-g20250825-78fe04b820dc8817f540bdd87fb22887e0ef3981_GH0.tar.gz) = 11698 diff --git a/textproc/pdjson/files/patch-Makefile b/textproc/pdjson/files/patch-Makefile new file mode 100644 index 000000000000..bfe7b015e15f --- /dev/null +++ b/textproc/pdjson/files/patch-Makefile @@ -0,0 +1,21 @@ +--- Makefile.orig 2024-02-22 11:12:52 UTC ++++ Makefile +@@ -1,8 +1,8 @@ + .POSIX: +-CC = cc +-CFLAGS = -std=c99 -pedantic -Wall -Wextra -Wno-missing-field-initializers ++CC ?= cc ++CFLAGS += -std=c99 -pedantic -Wall -Wextra -Wno-missing-field-initializers -fPIC + +-all: tests/pretty tests/stream tests/tests ++all: libpdjson.so tests/pretty tests/stream tests/tests + + tests/pretty: tests/pretty.o pdjson.o + $(CC) $(LDFLAGS) -o $@ tests/pretty.o pdjson.o $(LDLIBS) +@@ -28,3 +28,6 @@ clean: + + .c.o: + $(CC) -c $(CFLAGS) -o $@ $< ++ ++libpdjson.so: pdjson.o ++ $(CC) -shared -Wl,-soname=libpdjson.so.0 -o libpdjson.so pdjson.o diff --git a/textproc/pdjson/files/pdjson.pc.in b/textproc/pdjson/files/pdjson.pc.in new file mode 100644 index 000000000000..5feb5f556ec3 --- /dev/null +++ b/textproc/pdjson/files/pdjson.pc.in @@ -0,0 +1,11 @@ +prefix=%%PREFIX%% +libdir=${prefix}/lib +includedir=${prefix}/include + +Name: pdjson +Version: %%DISTVERSION%% +Description: Public Domain JSON parser +URL: https://github.com/skeeto/pdjson +Libs: -L${libdir} -lpdjson +Cflags: -I${includedir} + diff --git a/textproc/pdjson/pkg-descr b/textproc/pdjson/pkg-descr new file mode 100644 index 000000000000..9443bb133061 --- /dev/null +++ b/textproc/pdjson/pkg-descr @@ -0,0 +1,5 @@ +A public domain JSON parser focused on correctness, ANSI C99 +compliance, full Unicode (UTF-8) support, minimal memory footprint, +and a simple API. As a streaming API, arbitrary large JSON could +be processed with a small amount of memory (the size of the largest +string in the JSON). diff --git a/textproc/pdjson/pkg-plist b/textproc/pdjson/pkg-plist new file mode 100644 index 000000000000..98c00cb58daa --- /dev/null +++ b/textproc/pdjson/pkg-plist @@ -0,0 +1,4 @@ +include/pdjson.h +lib/libpdjson.so +lib/libpdjson.so.0 +libdata/pkgconfig/pdjson.pc |
