Commit: 201603df8e27cca47bfc8b688177eb1a75697d68
Parent: a776e77339906bb7073fea6213708f6b4e0f4d45
Author: Randy Palamar
Date: Thu, 28 Sep 2023 20:29:31 -0600
add cmark from oasis (bumped to 0.30.3)
Diffstat:
10 files changed, 50 insertions(+), 0 deletions(-)
diff --git a/.gitmodules b/.gitmodules
@@ -38,3 +38,6 @@
[submodule "pkg/libs/zlib/src"]
path = pkg/libs/zlib/src
url = https://github.com/madler/zlib.git
+[submodule "pkg/textproc/cmark/src"]
+ path = pkg/textproc/cmark/src
+ url = https://github.com/commonmark/cmark.git
diff --git a/pkg/gen.lua b/pkg/gen.lua
@@ -6,3 +6,4 @@ subgen('lang')
subgen('libs')
subgen('net')
subgen('sys')
+subgen('textproc')
diff --git a/pkg/textproc/cmark/cmark_export.h b/pkg/textproc/cmark/cmark_export.h
@@ -0,0 +1 @@
+#define CMARK_EXPORT
diff --git a/pkg/textproc/cmark/cmark_version.h b/pkg/textproc/cmark/cmark_version.h
@@ -0,0 +1,2 @@
+#define CMARK_VERSION ((0 << 16) | (30 << 8) | 2)
+#define CMARK_VERSION_STRING "0.30.2"
diff --git a/pkg/textproc/cmark/config.h b/pkg/textproc/cmark/config.h
@@ -0,0 +1,3 @@
+#include <stdbool.h>
+#define HAVE___BUILTIN_EXPECT 1
+#define CMARK_INLINE inline
diff --git a/pkg/textproc/cmark/gen.lua b/pkg/textproc/cmark/gen.lua
@@ -0,0 +1,36 @@
+cflags({ '-I $dir' })
+
+pkg.hdrs = {
+ copy('$outdir/include', '$srcdir/src', {'cmark.h'}),
+ copy('$outdir/include', '$dir', {'cmark_export.h', 'cmark_version.h'}),
+ install=true,
+}
+
+lib('libcmark.a', expand{'src/', {
+ 'cmark.c',
+ 'node.c',
+ 'iterator.c',
+ 'blocks.c',
+ 'inlines.c',
+ 'scanners.c',
+ 'utf8.c',
+ 'buffer.c',
+ 'references.c',
+ 'render.c',
+ 'man.c',
+ 'xml.c',
+ 'html.c',
+ 'commonmark.c',
+ 'latex.c',
+ 'houdini_href_e.c',
+ 'houdini_html_e.c',
+ 'houdini_html_u.c',
+ 'cmark_ctype.c',
+}})
+file('lib/libcmark.a', '644', '$outdir/libcmark.a')
+
+exe('cmark', {'src/main.c', 'libcmark.a'})
+file('bin/cmark', '755', '$outdir/cmark')
+man({'man/man1/cmark.1'})
+
+fetch('git')
diff --git a/pkg/textproc/cmark/src b/pkg/textproc/cmark/src
@@ -0,0 +1 @@
+Subproject commit 5ba25ff40eba44c811f79ab6a792baf945b8307c
diff --git a/pkg/textproc/cmark/ver b/pkg/textproc/cmark/ver
@@ -0,0 +1 @@
+0.30.3 r0
diff --git a/pkg/textproc/gen.lua b/pkg/textproc/gen.lua
@@ -0,0 +1 @@
+subgen('cmark')
diff --git a/sets.lua b/sets.lua
@@ -2,6 +2,7 @@ local S = {}
S.bin = {
'awk',
+ 'cmark',
'curl',
'hyx',
'mandoc',