summaryrefslogtreecommitdiff
path: root/textproc/pdjson
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--textproc/pdjson/Makefile27
-rw-r--r--textproc/pdjson/distinfo3
-rw-r--r--textproc/pdjson/files/patch-Makefile21
-rw-r--r--textproc/pdjson/files/pdjson.pc.in11
-rw-r--r--textproc/pdjson/pkg-descr5
-rw-r--r--textproc/pdjson/pkg-plist4
6 files changed, 71 insertions, 0 deletions
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