git: 575671763c03 - main - textproc/libfyaml: New port: YAML parser and emitter

From: Yuri Victorovich <yuri_at_FreeBSD.org>
Date: Thu, 03 Nov 2022 08:03:54 UTC
The branch main has been updated by yuri:

URL: https://cgit.FreeBSD.org/ports/commit/?id=575671763c0352d951d303ce687194ac7d4a737d

commit 575671763c0352d951d303ce687194ac7d4a737d
Author:     Yuri Victorovich <yuri@FreeBSD.org>
AuthorDate: 2022-11-03 07:47:13 +0000
Commit:     Yuri Victorovich <yuri@FreeBSD.org>
CommitDate: 2022-11-03 08:03:48 +0000

    textproc/libfyaml: New port: YAML parser and emitter
---
 textproc/Makefile                                  |  1 +
 textproc/libfyaml/Makefile                         | 27 ++++++++++++++++++++++
 textproc/libfyaml/distinfo                         |  3 +++
 textproc/libfyaml/files/patch-include_libfyaml.h   | 11 +++++++++
 textproc/libfyaml/files/patch-src_lib_fy-atom.c    | 10 ++++++++
 textproc/libfyaml/files/patch-src_lib_fy-ctype.h   | 11 +++++++++
 textproc/libfyaml/files/patch-src_lib_fy-diag.c    | 10 ++++++++
 textproc/libfyaml/files/patch-src_lib_fy-event.c   | 10 ++++++++
 textproc/libfyaml/files/patch-src_lib_fy-token.c   | 10 ++++++++
 textproc/libfyaml/files/patch-src_lib_fy-utf8.h    | 11 +++++++++
 .../files/patch-src_valgrind_fy-valgrind.h         | 11 +++++++++
 textproc/libfyaml/pkg-descr                        |  5 ++++
 textproc/libfyaml/pkg-plist                        | 20 ++++++++++++++++
 13 files changed, 140 insertions(+)

diff --git a/textproc/Makefile b/textproc/Makefile
index bdb0e80fb0b5..ca4784525275 100644
--- a/textproc/Makefile
+++ b/textproc/Makefile
@@ -374,6 +374,7 @@
     SUBDIR += libepubgen
     SUBDIR += libextractor
     SUBDIR += libexttextcat
+    SUBDIR += libfyaml
     SUBDIR += libfo
     SUBDIR += libfolia
     SUBDIR += libgepub
diff --git a/textproc/libfyaml/Makefile b/textproc/libfyaml/Makefile
new file mode 100644
index 000000000000..5b8413947212
--- /dev/null
+++ b/textproc/libfyaml/Makefile
@@ -0,0 +1,27 @@
+PORTNAME=	libfyaml
+DISTVERSION=	0.7.12
+CATEGORIES=	textproc
+MASTER_SITES=	https://github.com/pantoniou/libfyaml/releases/download/v${DISTVERSION}/
+
+MAINTAINER=	yuri@FreeBSD.org
+COMMENT=	YAML parser and emitter
+WWW=		https://github.com/pantoniou/libfyaml
+
+LICENSE=	MIT
+LICENSE_FILE=	${WRKSRC}/LICENSE
+
+TEST_DEPENDS=	git:devel/git \
+		bash:shells/bash
+
+USES=		gmake libtool shebangfix # will change to cmake soon
+USE_LDCONFIG=	yes
+
+SHEBANG_FILES=	test/testemitter.test
+
+GNU_CONFIGURE=	yes
+
+INSTALL_TARGET=	install-strip
+
+TEST_TARGET=	check # one test fails, see https://github.com/pantoniou/libfyaml/issues/60
+
+.include <bsd.port.mk>
diff --git a/textproc/libfyaml/distinfo b/textproc/libfyaml/distinfo
new file mode 100644
index 000000000000..f6262e8791a5
--- /dev/null
+++ b/textproc/libfyaml/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1667456423
+SHA256 (libfyaml-0.7.12.tar.gz) = 485342c6920e9fdc2addfe75e5c3e0381793f18b339ab7393c1b6edf78bf8ca8
+SIZE (libfyaml-0.7.12.tar.gz) = 757218
diff --git a/textproc/libfyaml/files/patch-include_libfyaml.h b/textproc/libfyaml/files/patch-include_libfyaml.h
new file mode 100644
index 000000000000..d84aae2b34ec
--- /dev/null
+++ b/textproc/libfyaml/files/patch-include_libfyaml.h
@@ -0,0 +1,11 @@
+--- include/libfyaml.h.orig	2022-11-03 06:41:20 UTC
++++ include/libfyaml.h
+@@ -37,7 +37,7 @@ extern "C" {
+ #include <stdarg.h>
+ #include <stdio.h>
+ #include <string.h>
+-#include <alloca.h>
++#include <stdlib.h>
+ 
+ #if defined (__unix__) || (defined (__APPLE__) && defined (__MACH__))
+ #include <unistd.h>
diff --git a/textproc/libfyaml/files/patch-src_lib_fy-atom.c b/textproc/libfyaml/files/patch-src_lib_fy-atom.c
new file mode 100644
index 000000000000..b12017c78e45
--- /dev/null
+++ b/textproc/libfyaml/files/patch-src_lib_fy-atom.c
@@ -0,0 +1,10 @@
+--- src/lib/fy-atom.c.orig	2022-11-03 06:41:50 UTC
++++ src/lib/fy-atom.c
+@@ -17,7 +17,6 @@
+ #include <stdlib.h>
+ #include <errno.h>
+ #include <stdarg.h>
+-#include <alloca.h>
+ #include <ctype.h>
+ 
+ #include <libfyaml.h>
diff --git a/textproc/libfyaml/files/patch-src_lib_fy-ctype.h b/textproc/libfyaml/files/patch-src_lib_fy-ctype.h
new file mode 100644
index 000000000000..6c5d3ab48806
--- /dev/null
+++ b/textproc/libfyaml/files/patch-src_lib_fy-ctype.h
@@ -0,0 +1,11 @@
+--- src/lib/fy-ctype.h.orig	2022-11-03 06:42:22 UTC
++++ src/lib/fy-ctype.h
+@@ -13,7 +13,7 @@
+ #endif
+ 
+ #include <stdint.h>
+-#include <alloca.h>
++#include <stdlib.h>
+ #include <string.h>
+ #include <assert.h>
+ 
diff --git a/textproc/libfyaml/files/patch-src_lib_fy-diag.c b/textproc/libfyaml/files/patch-src_lib_fy-diag.c
new file mode 100644
index 000000000000..dcab757d0e90
--- /dev/null
+++ b/textproc/libfyaml/files/patch-src_lib_fy-diag.c
@@ -0,0 +1,10 @@
+--- src/lib/fy-diag.c.orig	2022-11-03 06:42:38 UTC
++++ src/lib/fy-diag.c
+@@ -17,7 +17,6 @@
+ #include <stdlib.h>
+ #include <errno.h>
+ #include <stdarg.h>
+-#include <alloca.h>
+ #include <unistd.h>
+ #include <ctype.h>
+ 
diff --git a/textproc/libfyaml/files/patch-src_lib_fy-event.c b/textproc/libfyaml/files/patch-src_lib_fy-event.c
new file mode 100644
index 000000000000..17ccc07545fe
--- /dev/null
+++ b/textproc/libfyaml/files/patch-src_lib_fy-event.c
@@ -0,0 +1,10 @@
+--- src/lib/fy-event.c.orig	2022-11-03 06:40:46 UTC
++++ src/lib/fy-event.c
+@@ -17,7 +17,6 @@
+ #include <stdlib.h>
+ #include <errno.h>
+ #include <stdarg.h>
+-#include <alloca.h>
+ 
+ #include <libfyaml.h>
+ 
diff --git a/textproc/libfyaml/files/patch-src_lib_fy-token.c b/textproc/libfyaml/files/patch-src_lib_fy-token.c
new file mode 100644
index 000000000000..850b7c22c215
--- /dev/null
+++ b/textproc/libfyaml/files/patch-src_lib_fy-token.c
@@ -0,0 +1,10 @@
+--- src/lib/fy-token.c.orig	2022-11-03 06:42:10 UTC
++++ src/lib/fy-token.c
+@@ -17,7 +17,6 @@
+ #include <stdlib.h>
+ #include <errno.h>
+ #include <stdarg.h>
+-#include <alloca.h>
+ 
+ #include <libfyaml.h>
+ 
diff --git a/textproc/libfyaml/files/patch-src_lib_fy-utf8.h b/textproc/libfyaml/files/patch-src_lib_fy-utf8.h
new file mode 100644
index 000000000000..5d463c736280
--- /dev/null
+++ b/textproc/libfyaml/files/patch-src_lib_fy-utf8.h
@@ -0,0 +1,11 @@
+--- src/lib/fy-utf8.h.orig	2022-11-03 06:40:27 UTC
++++ src/lib/fy-utf8.h
+@@ -13,7 +13,7 @@
+ #endif
+ 
+ #include <stdint.h>
+-#include <alloca.h>
++#include <stdlib.h>
+ #include <assert.h>
+ 
+ #include <libfyaml.h>
diff --git a/textproc/libfyaml/files/patch-src_valgrind_fy-valgrind.h b/textproc/libfyaml/files/patch-src_valgrind_fy-valgrind.h
new file mode 100644
index 000000000000..2c4e9257e522
--- /dev/null
+++ b/textproc/libfyaml/files/patch-src_valgrind_fy-valgrind.h
@@ -0,0 +1,11 @@
+--- src/valgrind/fy-valgrind.h.orig	2022-11-03 06:38:06 UTC
++++ src/valgrind/fy-valgrind.h
+@@ -19,7 +19,7 @@
+ #include <getopt.h>
+ #include <unistd.h>
+ #include <limits.h>
+-#include <alloca.h>
++#include <stdlib.h>
+ #include <stdio.h>
+ 
+ enum fy_valgrind_tool {
diff --git a/textproc/libfyaml/pkg-descr b/textproc/libfyaml/pkg-descr
new file mode 100644
index 000000000000..380a393f142b
--- /dev/null
+++ b/textproc/libfyaml/pkg-descr
@@ -0,0 +1,5 @@
+libfyaml is a fully feature complete YAML parser and emitter, supporting the
+latest YAML spec and passing the full YAML testsuite.
+
+It is designed to be very efficient, avoiding copies of data, and has no
+artificial limits like the 1024 character limit for implicit keys.
diff --git a/textproc/libfyaml/pkg-plist b/textproc/libfyaml/pkg-plist
new file mode 100644
index 000000000000..de314fc14575
--- /dev/null
+++ b/textproc/libfyaml/pkg-plist
@@ -0,0 +1,20 @@
+bin/fy-compose
+bin/fy-dump
+bin/fy-filter
+bin/fy-join
+bin/fy-testsuite
+bin/fy-tool
+bin/fy-ypath
+include/libfyaml.h
+lib/libfyaml.a
+lib/libfyaml.so
+lib/libfyaml.so.0
+lib/libfyaml.so.0.0.0
+libdata/pkgconfig/libfyaml.pc
+man/man1/fy-compose.1.gz
+man/man1/fy-dump.1.gz
+man/man1/fy-filter.1.gz
+man/man1/fy-join.1.gz
+man/man1/fy-testsuite.1.gz
+man/man1/fy-tool.1.gz
+man/man1/fy-ypath.1.gz