summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2019-05-03 22:19:55 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2019-05-15 17:09:24 +0300
commit19dc42649183b2e1cd37be1ca69145dafe1330a2 (patch)
tree54e562b46a52664d98f56fcce2fdbdfda973c94d
parentcec0fb3f50fd924614ced487f79b57c92bff6584 (diff)
Add implementation
-rw-r--r--.gitignore1
-rw-r--r--.gitmodules4
-rw-r--r--README-DEV38
-rw-r--r--libcmark-gfm-extensions/.gitignore19
l---------libcmark-gfm-extensions/COPYING1
-rw-r--r--libcmark-gfm-extensions/INSTALL7
-rw-r--r--libcmark-gfm-extensions/README21
-rw-r--r--libcmark-gfm-extensions/README-DEV11
-rw-r--r--libcmark-gfm-extensions/build/.gitignore3
-rw-r--r--libcmark-gfm-extensions/build/bootstrap.build26
-rw-r--r--libcmark-gfm-extensions/build/export.build10
-rw-r--r--libcmark-gfm-extensions/build/root.build20
-rw-r--r--libcmark-gfm-extensions/buildfile10
-rw-r--r--libcmark-gfm-extensions/libcmark-gfm-extensions/buildfile69
-rw-r--r--libcmark-gfm-extensions/libcmark-gfm-extensions/cmark-gfm-extensions_export.h48
l---------libcmark-gfm-extensions/libcmark-gfm-extensions/extensions1
-rw-r--r--libcmark-gfm-extensions/manifest22
-rw-r--r--libcmark-gfm-extensions/tests/.gitignore8
-rw-r--r--libcmark-gfm-extensions/tests/basic/buildfile8
-rw-r--r--libcmark-gfm-extensions/tests/basic/driver.c46
-rw-r--r--libcmark-gfm-extensions/tests/basic/testscript5
-rw-r--r--libcmark-gfm-extensions/tests/build/.gitignore3
-rw-r--r--libcmark-gfm-extensions/tests/build/bootstrap.build9
-rw-r--r--libcmark-gfm-extensions/tests/build/root.build16
-rw-r--r--libcmark-gfm-extensions/tests/buildfile5
-rw-r--r--libcmark-gfm/.gitignore19
l---------libcmark-gfm/COPYING1
-rw-r--r--libcmark-gfm/INSTALL7
-rw-r--r--libcmark-gfm/README21
-rw-r--r--libcmark-gfm/README-DEV18
-rw-r--r--libcmark-gfm/build/.gitignore2
-rw-r--r--libcmark-gfm/build/bootstrap.build50
-rw-r--r--libcmark-gfm/build/export.build10
-rw-r--r--libcmark-gfm/build/root.build22
-rw-r--r--libcmark-gfm/buildfile10
-rw-r--r--libcmark-gfm/libcmark-gfm/.gitignore3
-rw-r--r--libcmark-gfm/libcmark-gfm/buildfile84
-rw-r--r--libcmark-gfm/libcmark-gfm/cmark-gfm_export.h54
-rw-r--r--libcmark-gfm/libcmark-gfm/cmark-gfm_version.h7
-rw-r--r--libcmark-gfm/libcmark-gfm/config.h81
l---------libcmark-gfm/libcmark-gfm/config.h.in.orig1
l---------libcmark-gfm/libcmark-gfm/src1
-rw-r--r--libcmark-gfm/manifest21
-rw-r--r--libcmark-gfm/tests/.gitignore8
-rw-r--r--libcmark-gfm/tests/basic/buildfile7
-rw-r--r--libcmark-gfm/tests/basic/driver.c28
-rw-r--r--libcmark-gfm/tests/basic/testscript5
-rw-r--r--libcmark-gfm/tests/build/.gitignore3
-rw-r--r--libcmark-gfm/tests/build/bootstrap.build9
-rw-r--r--libcmark-gfm/tests/build/root.build16
-rw-r--r--libcmark-gfm/tests/buildfile5
-rw-r--r--packages.manifest4
-rw-r--r--repositories.manifest2
m---------upstream0
54 files changed, 910 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..13d880b
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+.bdep/
diff --git a/.gitmodules b/.gitmodules
new file mode 100644
index 0000000..d313ad6
--- /dev/null
+++ b/.gitmodules
@@ -0,0 +1,4 @@
+[submodule "upstream"]
+ path = upstream
+ url = https://github.com/github/cmark-gfm.git
+ ignore = untracked
diff --git a/README-DEV b/README-DEV
new file mode 100644
index 0000000..1971663
--- /dev/null
+++ b/README-DEV
@@ -0,0 +1,38 @@
+This document describes how cmark-gfm was packaged for build2. In particular,
+this understanding will be useful when upgrading to a new upstream version.
+
+The upstream package contains libcmark-gfm and libcmark-gfm-extensions
+libraries and the cmark-gfm program. Currently, we only package libraries and
+package them separately.
+
+We add the upstream package as a git submodule and symlink the required files
+and subdirectories into the build2 package subdirectories. Then, when required,
+we "overlay" the upstream with our own header/source files.
+
+Note that symlinking upstream submodule subdirectories into a build2 package
+subdirectory results in creating intermediate build files (.d, .o, etc) inside
+upstream directory while building the package in source tree. That's why we
+need to make sure that packages do not share upstream source files via
+subdirectory symlinks, not to also share the related intermediate files. If
+several packages need to compile the same upstream source file, then only one
+of them can symlink it via the parent directory while others must symlink it
+directly. We also add the `ignore = untracked` configuration option into
+.gitmodules to make sure that git ignores the intermediate build files under
+upstream/ subdirectory.
+
+Normally, when packaging a cmake-based project, we try to deduce the source
+file and compilation/linking option sets analyzing the root and
+feature/component/platform-specific CMakeLists.txt and .cmake files. In
+practice, however, that can be uneasy and error prone, so you may also need
+to refer to cmake-generated configuration files or, as a last resort, to see
+the actual compiler and linker command lines in the build log. If that's the
+case, you can configure/build the upstream package on the platform of interest
+running the following commands in the project root directory.
+
+On POSIX and in MinGW shell:
+
+$ make VERBOSE=1
+
+With MSVC:
+
+> nmake VERBOSE=1
diff --git a/libcmark-gfm-extensions/.gitignore b/libcmark-gfm-extensions/.gitignore
new file mode 100644
index 0000000..cece09c
--- /dev/null
+++ b/libcmark-gfm-extensions/.gitignore
@@ -0,0 +1,19 @@
+# Compiler/linker output.
+#
+*.d
+*.t
+*.i
+*.ii
+*.o
+*.obj
+*.so
+*.dll
+*.a
+*.lib
+*.exp
+*.pdb
+*.ilk
+*.exe
+*.exe.dlls/
+*.exe.manifest
+*.pc
diff --git a/libcmark-gfm-extensions/COPYING b/libcmark-gfm-extensions/COPYING
new file mode 120000
index 0000000..0ca50eb
--- /dev/null
+++ b/libcmark-gfm-extensions/COPYING
@@ -0,0 +1 @@
+../upstream/COPYING \ No newline at end of file
diff --git a/libcmark-gfm-extensions/INSTALL b/libcmark-gfm-extensions/INSTALL
new file mode 100644
index 0000000..ffe1352
--- /dev/null
+++ b/libcmark-gfm-extensions/INSTALL
@@ -0,0 +1,7 @@
+The aim of this package is to make reading the INSTALL file unnecessary. So
+next time try running:
+
+$ bpkg build libcmark-gfm-extensions
+
+But if you don't want to use the package manager, then you can also build this
+package manually using the standard build2 build system.
diff --git a/libcmark-gfm-extensions/README b/libcmark-gfm-extensions/README
new file mode 100644
index 0000000..d492628
--- /dev/null
+++ b/libcmark-gfm-extensions/README
@@ -0,0 +1,21 @@
+cmark-gfm is an extended version of cmark, the reference implementation of
+CommonMark parsing and rendering C library. In addition to libcmark,
+libcmark-gfm provides extensions management support. The GitHub Flavored
+Markdown extensions themselves are provided by libcmark-gfm-extensions.
+
+https://github.com/github/cmark-gfm
+
+This package contains the original libcmark-gfm-extensions library source code
+overlaid with the build2-based build system and packaged for the build2
+package manager (bpkg).
+
+See the INSTALL file for the prerequisites and installation instructions.
+
+Post questions, bug reports, or any other feedback about the library itself at
+https://github.com/github/cmark-gfm/issues. Send build system and
+packaging-related feedback to the packaging@build2.org mailing list (see
+https://lists.build2.org for posting guidelines, etc).
+
+The packaging of libcmark-gfm for build2 is tracked in a Git repository at:
+
+https://git.build2.org/cgit/packaging/cmark-gfm/
diff --git a/libcmark-gfm-extensions/README-DEV b/libcmark-gfm-extensions/README-DEV
new file mode 100644
index 0000000..d350c92
--- /dev/null
+++ b/libcmark-gfm-extensions/README-DEV
@@ -0,0 +1,11 @@
+This document describes how libcmark-gfm-extensions was packaged for build2.
+In particular, this understanding will be useful when upgrading to a new
+upstream version. See ../README-DEV for general notes on cmark-gfm packaging.
+
+Symlink the required upstream files and directories into
+libcmark-gfm-extensions/:
+
+$ ln -s ../../upstream/extensions libcmark-gfm-extensions
+
+Create cmark-gfm-extensions_export.h defining CMARK_GFM_EXTENSIONS_EXPORT
+macro.
diff --git a/libcmark-gfm-extensions/build/.gitignore b/libcmark-gfm-extensions/build/.gitignore
new file mode 100644
index 0000000..4a730a3
--- /dev/null
+++ b/libcmark-gfm-extensions/build/.gitignore
@@ -0,0 +1,3 @@
+config.build
+root/
+bootstrap/
diff --git a/libcmark-gfm-extensions/build/bootstrap.build b/libcmark-gfm-extensions/build/bootstrap.build
new file mode 100644
index 0000000..c7b7b43
--- /dev/null
+++ b/libcmark-gfm-extensions/build/bootstrap.build
@@ -0,0 +1,26 @@
+# file : build/bootstrap.build
+# copyright : Copyright (c) 2016-2019 Code Synthesis Ltd
+# license : FreeBSD License; see accompanying COPYING file
+
+project = libcmark-gfm-extensions
+
+using version
+using config
+using test
+using install
+using dist
+
+# Sync with the libcmark-gfm library ABI version (see libcmark-gfm's
+# bootstrap.build for details).
+#
+if ($version.major == 0 && $version.minor == 29 && $version.patch == 0)
+{
+ upstream_version_major = 0
+ upstream_version_minor = 29
+ upstream_version_patch = 0
+ upstream_version_gfm = 0
+
+ abi_version = "$upstream_version_major.$upstream_version_minor.$upstream_version_patch.$upstream_version_gfm"
+}
+else
+ fail 'increment the ABI version?'
diff --git a/libcmark-gfm-extensions/build/export.build b/libcmark-gfm-extensions/build/export.build
new file mode 100644
index 0000000..c87cec6
--- /dev/null
+++ b/libcmark-gfm-extensions/build/export.build
@@ -0,0 +1,10 @@
+# file : build/root.build
+# copyright : Copyright (c) 2018-2019 Code Synthesis Ltd
+# license : FreeBSD License; see accompanying COPYING file
+
+$out_root/
+{
+ include libcmark-gfm-extensions/
+}
+
+export $out_root/libcmark-gfm-extensions/$import.target
diff --git a/libcmark-gfm-extensions/build/root.build b/libcmark-gfm-extensions/build/root.build
new file mode 100644
index 0000000..f1d0273
--- /dev/null
+++ b/libcmark-gfm-extensions/build/root.build
@@ -0,0 +1,20 @@
+# file : build/root.build
+# copyright : Copyright (c) 2018-2019 Code Synthesis Ltd
+# license : FreeBSD License; see accompanying COPYING file
+
+c.std = 99
+
+using c
+
+h{*}: extension = h
+c{*}: extension = c
+
+if ($c.class == 'msvc')
+{
+ cc.poptions += -D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS
+ cc.coptions += /wd4251 /wd4275 /wd4800
+}
+
+# The test target for cross-testing (running tests under Wine, etc).
+#
+test.target = $c.target
diff --git a/libcmark-gfm-extensions/buildfile b/libcmark-gfm-extensions/buildfile
new file mode 100644
index 0000000..f2c47c5
--- /dev/null
+++ b/libcmark-gfm-extensions/buildfile
@@ -0,0 +1,10 @@
+# file : buildfile
+# copyright : Copyright (c) 2018-2019 Code Synthesis Ltd
+# license : FreeBSD License; see accompanying COPYING file
+
+./: {*/ -build/} doc{COPYING INSTALL README} manifest
+
+# Don't install tests or the INSTALL file.
+#
+tests/: install = false
+doc{INSTALL}@./: install = false
diff --git a/libcmark-gfm-extensions/libcmark-gfm-extensions/buildfile b/libcmark-gfm-extensions/libcmark-gfm-extensions/buildfile
new file mode 100644
index 0000000..c0c7fb5
--- /dev/null
+++ b/libcmark-gfm-extensions/libcmark-gfm-extensions/buildfile
@@ -0,0 +1,69 @@
+# file : libcmark-gfm-extensions/buildfile
+# copyright : Copyright (c) 2018-2019 Code Synthesis Ltd
+# license : FreeBSD License; see accompanying COPYING file
+
+import int_libs = libcmark-gfm%lib{cmark-gfm}
+
+lib{cmark-gfm-extensions}: {h c}{**} $int_libs
+
+windows = ($c.target.class == 'windows')
+
+gcc = ($c.class == 'gcc')
+msvc = ($c.class == 'msvc')
+
+# Build options.
+#
+obja{*}: c.poptions += -DCMARK_GFM_EXTENSIONS_STATIC_BUILD
+objs{*}: c.poptions += -DCMARK_GFM_EXTENSIONS_SHARED_BUILD
+
+if! $windows
+ c.coptions += -fvisibility=hidden
+else
+ c.poptions += -DWIN32 -D_WINDOWS
+
+c.poptions =+ "-I$src_base" "-I$src_base/extensions"
+
+if $msvc
+{
+ # Disable warnings that pop up with /W3.
+ #
+ c.coptions += /wd4311
+}
+elif $gcc
+{
+ c.coptions += -pedantic
+
+ # Disable warnings that pop up with -Wextra. Upstream doesn't seem to care
+ # about these and it is not easy to disable specific warnings in a way that
+ # works across compilers/version (some -Wno-* options are only recognized in
+ # newer versions). There are still some warnings left that appear for
+ # certain platforms/compilers. We pass them through but disable treating
+ # them as errors.
+ #
+ c.coptions += -Wno-extra -Wno-error
+}
+
+# Export options.
+#
+lib{cmark-gfm-extensions}:
+{
+ cc.export.poptions = "-I$src_base" "-I$src_base/extensions"
+ cc.export.libs = $int_libs
+}
+
+liba{cmark-gfm-extensions}: cc.export.poptions += -DCMARK_GFM_EXTENSIONS_STATIC
+libs{cmark-gfm-extensions}: cc.export.poptions += -DCMARK_GFM_EXTENSIONS_SHARED
+
+# See bootstrap.build for details.
+#
+if $version.pre_release
+ lib{cmark-gfm-extensions}: bin.lib.version = @"-$version.project_id"
+else
+ lib{cmark-gfm-extensions}: bin.lib.version = @"-$abi_version"
+
+# Install the bare minimum of headers.
+#
+h{*}: install = false
+
+for h: extensions/cmark-gfm-core-extensions.h cmark-gfm-extensions_export.h
+ h{$h}@./$path.directory($h): install = include/
diff --git a/libcmark-gfm-extensions/libcmark-gfm-extensions/cmark-gfm-extensions_export.h b/libcmark-gfm-extensions/libcmark-gfm-extensions/cmark-gfm-extensions_export.h
new file mode 100644
index 0000000..db966d5
--- /dev/null
+++ b/libcmark-gfm-extensions/libcmark-gfm-extensions/cmark-gfm-extensions_export.h
@@ -0,0 +1,48 @@
+/* file : libcmark-gfm-extensions/cmark-gfm-extensions_export.h -*- C -*-
+ * copyright : Copyright (c) 2016-2019 Code Synthesis Ltd
+ * license : FreeBSD License; see accompanying COPYING file
+ */
+
+#ifndef CMARK_GFM_EXTENSIONS_EXPORT_H
+#define CMARK_GFM_EXTENSIONS_EXPORT_H
+
+/*
+ * The upstream's version of this file is auto-generated by cmake. We implement
+ * it from scratch (see cmark-gfm_export.h for details).
+ */
+#if defined(CMARK_GFM_EXTENSIONS_STATIC) // Using static.
+# define CMARK_GFM_EXTENSIONS_EXPORT
+#elif defined(CMARK_GFM_EXTENSIONS_STATIC_BUILD) // Building static.
+# define CMARK_GFM_EXTENSIONS_EXPORT
+#elif defined(CMARK_GFM_EXTENSIONS_SHARED) // Using shared.
+# ifdef _WIN32
+# define CMARK_GFM_EXTENSIONS_EXPORT __declspec(dllimport)
+# else
+# define CMARK_GFM_EXTENSIONS_EXPORT
+# endif
+#elif defined(CMARK_GFM_EXTENSIONS_SHARED_BUILD) // Building shared.
+# ifdef _WIN32
+# define CMARK_GFM_EXTENSIONS_EXPORT __declspec(dllexport)
+# else
+# define CMARK_GFM_EXTENSIONS_EXPORT __attribute__((visibility("default")))
+# endif
+#else
+// If none of the above macros are defined, then we assume we are being used
+// by some third-party build system that cannot/doesn't signal the library
+// type. Note that this fallback works for both static and shared but in case
+// of shared will be sub-optimal compared to having dllimport.
+//
+# define CMARK_GFM_EXTENSIONS_EXPORT // Using static or shared.
+#endif
+
+/*
+ * Undefining these cmake-generated macros is not technically required, but
+ * let's keep them for the record.
+ */
+#undef CMARK_GFM_EXTENSIONS_NO_EXPORT
+#undef CMARK_GFM_EXTENSIONS_DEPRECATED
+#undef CMARK_GFM_EXTENSIONS_NO_DEPRECATED
+#undef CMARK_GFM_EXTENSIONS_DEPRECATED_EXPORT
+#undef CMARK_GFM_EXTENSIONS_DEPRECATED_NO_EXPORT
+
+#endif /* CMARK_GFM_EXTENSIONS_EXPORT_H */
diff --git a/libcmark-gfm-extensions/libcmark-gfm-extensions/extensions b/libcmark-gfm-extensions/libcmark-gfm-extensions/extensions
new file mode 120000
index 0000000..b42e4e2
--- /dev/null
+++ b/libcmark-gfm-extensions/libcmark-gfm-extensions/extensions
@@ -0,0 +1 @@
+../../upstream/extensions \ No newline at end of file
diff --git a/libcmark-gfm-extensions/manifest b/libcmark-gfm-extensions/manifest
new file mode 100644
index 0000000..5e906f8
--- /dev/null
+++ b/libcmark-gfm-extensions/manifest
@@ -0,0 +1,22 @@
+: 1
+name: libcmark-gfm-extensions
+
+# Note: remember to update summary below and build/bootstrap.build!
+#
+version: 0.29.0-a.0.z
+
+project: cmark-gfm
+summary: GitHub-flavored CommonMark extensions C library, version 0.29.0.gfm.0
+license: 2-clause BSD; FreeBSD License
+tags: github, markdown, extensions, cmark, commonmark, gfm, c, api
+description-file: README
+url: https://github.com/github/cmark-gfm
+src-url: https://git.build2.org/cgit/packaging/cmark-gfm/cmark-gfm/tree/libcmark-gfm-extensions/
+package-url: https://git.build2.org/cgit/packaging/cmark-gfm/
+email: packaging@build2.org ; Report issues at https://github.com/github/cmark-gfm/issues.
+package-email: packaging@build2.org ; Mailing list.
+build-error-email: builds@build2.org
+builds: all
+depends: * build2 >= 0.10.0-
+depends: * bpkg >= 0.10.0-
+depends: libcmark-gfm == $
diff --git a/libcmark-gfm-extensions/tests/.gitignore b/libcmark-gfm-extensions/tests/.gitignore
new file mode 100644
index 0000000..662178d
--- /dev/null
+++ b/libcmark-gfm-extensions/tests/.gitignore
@@ -0,0 +1,8 @@
+# Test executables.
+#
+driver
+
+# Testscript output directories (can be symlinks).
+#
+test
+test-*
diff --git a/libcmark-gfm-extensions/tests/basic/buildfile b/libcmark-gfm-extensions/tests/basic/buildfile
new file mode 100644
index 0000000..a5014fe
--- /dev/null
+++ b/libcmark-gfm-extensions/tests/basic/buildfile
@@ -0,0 +1,8 @@
+# file : tests/basic/buildfile
+# copyright : Copyright (c) 2018-2019 Code Synthesis Ltd
+# license : FreeBSD License; see accompanying COPYING file
+
+import libs = libcmark-gfm-extensions%lib{cmark-gfm-extensions}
+import libs += libcmark-gfm%lib{cmark-gfm}
+
+exe{driver}: {h c}{**} $libs testscript
diff --git a/libcmark-gfm-extensions/tests/basic/driver.c b/libcmark-gfm-extensions/tests/basic/driver.c
new file mode 100644
index 0000000..4d77abd
--- /dev/null
+++ b/libcmark-gfm-extensions/tests/basic/driver.c
@@ -0,0 +1,46 @@
+/*
+ * file : tests/basic/driver.c
+ * copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC
+ * license : FreeBSD License; see accompanying COPYING file
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <assert.h>
+
+#include <cmark-gfm.h>
+#include <cmark-gfm-extension_api.h>
+#include <cmark-gfm-core-extensions.h>
+
+int
+main (int argc, const char* argv[])
+{
+ assert (argc == 2);
+
+ const char* from = argv[1];
+
+ cmark_gfm_core_extensions_ensure_registered ();
+
+ cmark_parser* p = cmark_parser_new (CMARK_OPT_DEFAULT |
+ CMARK_OPT_VALIDATE_UTF8);
+
+ cmark_syntax_extension* e = cmark_find_syntax_extension ("strikethrough");
+ cmark_parser_attach_syntax_extension (p, e);
+
+
+ cmark_parser_feed (p, from, strlen (from));
+
+ cmark_node* doc = cmark_parser_finish (p);
+
+ char* to = cmark_render_html (doc,
+ CMARK_OPT_DEFAULT,
+ NULL /* extensions */);
+
+ printf ("%s", to);
+
+ cmark_get_default_mem_allocator ()->free (to);
+ cmark_node_free (doc);
+ cmark_parser_free (p);
+
+ return 0;
+}
diff --git a/libcmark-gfm-extensions/tests/basic/testscript b/libcmark-gfm-extensions/tests/basic/testscript
new file mode 100644
index 0000000..438f059
--- /dev/null
+++ b/libcmark-gfm-extensions/tests/basic/testscript
@@ -0,0 +1,5 @@
+# file : tests/basic/testscript
+# copyright : Copyright (c) 2016-2019 Code Synthesis Ltd
+# license : FreeBSD License; see accompanying COPYING file
+
+$* '~~Hi~~ Hello *world*' >'<p><del>Hi</del> Hello <em>world</em></p>'
diff --git a/libcmark-gfm-extensions/tests/build/.gitignore b/libcmark-gfm-extensions/tests/build/.gitignore
new file mode 100644
index 0000000..4a730a3
--- /dev/null
+++ b/libcmark-gfm-extensions/tests/build/.gitignore
@@ -0,0 +1,3 @@
+config.build
+root/
+bootstrap/
diff --git a/libcmark-gfm-extensions/tests/build/bootstrap.build b/libcmark-gfm-extensions/tests/build/bootstrap.build
new file mode 100644
index 0000000..cb2b962
--- /dev/null
+++ b/libcmark-gfm-extensions/tests/build/bootstrap.build
@@ -0,0 +1,9 @@
+# file : tests/build/bootstrap.build
+# copyright : Copyright (c) 2018-2019 Code Synthesis Ltd
+# license : FreeBSD License; see accompanying COPYING file
+
+project = # Unnamed tests subproject.
+
+using config
+using test
+using dist
diff --git a/libcmark-gfm-extensions/tests/build/root.build b/libcmark-gfm-extensions/tests/build/root.build
new file mode 100644
index 0000000..1a4dbbe
--- /dev/null
+++ b/libcmark-gfm-extensions/tests/build/root.build
@@ -0,0 +1,16 @@
+# file : tests/build/root.build
+# copyright : Copyright (c) 2018-2019 Code Synthesis Ltd
+# license : FreeBSD License; see accompanying COPYING file
+
+using c
+
+h{*}: extension = h
+c{*}: extension = c
+
+# Every exe{} in this subproject is by default a test.
+#
+exe{*}: test = true
+
+# The test target for cross-testing (running tests under Wine, etc).
+#
+test.target = $c.target
diff --git a/libcmark-gfm-extensions/tests/buildfile b/libcmark-gfm-extensions/tests/buildfile
new file mode 100644
index 0000000..3961c0a
--- /dev/null
+++ b/libcmark-gfm-extensions/tests/buildfile
@@ -0,0 +1,5 @@
+# file : tests/buildfile
+# copyright : Copyright (c) 2018-2019 Code Synthesis Ltd
+# license : FreeBSD License; see accompanying COPYING file
+
+./: {*/ -build/}
diff --git a/libcmark-gfm/.gitignore b/libcmark-gfm/.gitignore
new file mode 100644
index 0000000..cece09c
--- /dev/null
+++ b/libcmark-gfm/.gitignore
@@ -0,0 +1,19 @@
+# Compiler/linker output.
+#
+*.d
+*.t
+*.i
+*.ii
+*.o
+*.obj
+*.so
+*.dll
+*.a
+*.lib
+*.exp
+*.pdb
+*.ilk
+*.exe
+*.exe.dlls/
+*.exe.manifest
+*.pc
diff --git a/libcmark-gfm/COPYING b/libcmark-gfm/COPYING
new file mode 120000
index 0000000..0ca50eb
--- /dev/null
+++ b/libcmark-gfm/COPYING
@@ -0,0 +1 @@
+../upstream/COPYING \ No newline at end of file
diff --git a/libcmark-gfm/INSTALL b/libcmark-gfm/INSTALL
new file mode 100644
index 0000000..87b5909
--- /dev/null
+++ b/libcmark-gfm/INSTALL
@@ -0,0 +1,7 @@
+The aim of this package is to make reading the INSTALL file unnecessary. So
+next time try running:
+
+$ bpkg build libcmark-gfm
+
+But if you don't want to use the package manager, then you can also build this
+package manually using the standard build2 build system.
diff --git a/libcmark-gfm/README b/libcmark-gfm/README
new file mode 100644
index 0000000..a8f313e
--- /dev/null
+++ b/libcmark-gfm/README
@@ -0,0 +1,21 @@
+cmark-gfm is an extended version of cmark, the reference implementation of
+CommonMark parsing and rendering C library. In addition to libcmark,
+libcmark-gfm provides extensions management support. The GitHub Flavored
+Markdown extensions themselves are provided by libcmark-gfm-extensions.
+
+https://github.com/github/cmark-gfm
+
+This package contains the original libcmark-gfm library source code overlaid
+with the build2-based build system and packaged for the build2 package manager
+(bpkg).
+
+See the INSTALL file for the prerequisites and installation instructions.
+
+Post questions, bug reports, or any other feedback about the library itself at
+https://github.com/github/cmark-gfm/issues. Send build system and
+packaging-related feedback to the packaging@build2.org mailing list (see
+https://lists.build2.org for posting guidelines, etc).
+
+The packaging of libcmark-gfm for build2 is tracked in a Git repository at:
+
+https://git.build2.org/cgit/packaging/cmark-gfm/
diff --git a/libcmark-gfm/README-DEV b/libcmark-gfm/README-DEV
new file mode 100644
index 0000000..dbf398b
--- /dev/null
+++ b/libcmark-gfm/README-DEV
@@ -0,0 +1,18 @@
+This document describes how libcmark-gfm was packaged for build2. In
+particular, this understanding will be useful when upgrading to a new upstream
+version. See ../README-DEV for general notes on cmark-gfm packaging.
+
+Symlink the required upstream files and directories into libcmark-gfm/:
+
+$ ln -s ../../upstream/src libcmark-gfm
+
+Note that we unable to generate cmark-gfm_version.h directly from the template
+as it is included as "cmark-gfm_version.h" in upstream's source code, which
+makes impossible using the header-generating machinery. That's why we create
+libcmark-gfm/cmark-gfm_version.h that includes <libcmark-gfm/version.h> that
+we auto-generate from upstream's src/cmark-gfm_version.h.in.
+
+Use libcmark-gfm/config.h.in.orig for creating libcmark-gfm/config.h,
+defining/undefining macros introduced with #cmakedefine.
+
+Create cmark-gfm_export.h defining CMARK_GFM_EXPORT macro.
diff --git a/libcmark-gfm/build/.gitignore b/libcmark-gfm/build/.gitignore
index 225c27f..4a730a3 100644
--- a/libcmark-gfm/build/.gitignore
+++ b/libcmark-gfm/build/.gitignore
@@ -1 +1,3 @@
config.build
+root/
+bootstrap/
diff --git a/libcmark-gfm/build/bootstrap.build b/libcmark-gfm/build/bootstrap.build
new file mode 100644
index 0000000..02906fd
--- /dev/null
+++ b/libcmark-gfm/build/bootstrap.build
@@ -0,0 +1,50 @@
+# file : build/bootstrap.build
+# copyright : Copyright (c) 2016-2019 Code Synthesis Ltd
+# license : FreeBSD License; see accompanying COPYING file
+
+project = libcmark-gfm
+
+using version
+using config
+using test
+using install
+using dist
+
+# There is no documentation that describes versioning of cmark-gfm and its
+# upstream cmark package. However, we can probably conclude that the release
+# version has the <major>.<minor>.<patch>.gfm.<gfm-version> form, where the
+# first three numbers reflect the upstream version the downstream is rebased
+# upon and the first two numbers reflect the CommonMark Spec version the
+# projects conform to. Note that <gfm-version> is not always reset to zero
+# when the upstream version changes (e.g., 0.27.1.gfm.4 and 0.28.0.gfm.5) but
+# it is also not a "through-version" (e.g., 0.29.0.gfm.0). The cmark-gfm ABI
+# version is equal to the release version; it seems upstream doesn't bother
+# with compatibility at this stage, for example, renaming most of the
+# functions and headers in 0.28.3.gfm.15.
+#
+# Instead of dragging the fourth component around (and not being able to use a
+# lot of tooling support) we are going to merge the upstream version into a
+# three-component semver. We will start with repurposing the pre-release
+# component to store <gfm-version> as -a.(<gfm-version>+1). Later, when
+# upstream releases its first major version and provided they don't switch to
+# a more sensible versioning scheme (or if we decide to switch for some
+# reason), we will multiply the first three upstream components by 100 and add
+# <gfm-version> to one of them (always to patch for zero <major> but if/when
+# <major> becomes non-zero, we will have to decide based on the changes). We
+# also mention the upstream release in the package summary for information.
+#
+# Similar to upstream we use the <gfm-version> in the ABI version. When
+# rebasing on upstream we should check SOVERSION definition in their
+# CMakeLists.txt for any changes to the versioning policy.
+#
+if ($version.major == 0 && $version.minor == 29 && $version.patch == 0)
+{
+ upstream_version_major = 0
+ upstream_version_minor = 29
+ upstream_version_patch = 0
+ upstream_version_gfm = 0
+
+ abi_version = "$upstream_version_major.$upstream_version_minor.$upstream_version_patch.$upstream_version_gfm"
+}
+else
+ fail 'increment the ABI version?'
diff --git a/libcmark-gfm/build/export.build b/libcmark-gfm/build/export.build
new file mode 100644
index 0000000..2ef7b69
--- /dev/null
+++ b/libcmark-gfm/build/export.build
@@ -0,0 +1,10 @@
+# file : build/root.build
+# copyright : Copyright (c) 2018-2019 Code Synthesis Ltd
+# license : FreeBSD License; see accompanying COPYING file
+
+$out_root/
+{
+ include libcmark-gfm/
+}
+
+export $out_root/libcmark-gfm/$import.target
diff --git a/libcmark-gfm/build/root.build b/libcmark-gfm/build/root.build
new file mode 100644
index 0000000..dc3f310
--- /dev/null
+++ b/libcmark-gfm/build/root.build
@@ -0,0 +1,22 @@
+# file : build/root.build
+# copyright : Copyright (c) 2018-2019 Code Synthesis Ltd
+# license : FreeBSD License; see accompanying COPYING file
+
+using in
+
+c.std = 99
+
+using c
+
+h{*}: extension = h
+c{*}: extension = c
+
+if ($c.class == 'msvc')
+{
+ cc.poptions += -D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS
+ cc.coptions += /wd4251 /wd4275 /wd4800
+}
+
+# The test target for cross-testing (running tests under Wine, etc).
+#
+test.target = $c.target
diff --git a/libcmark-gfm/buildfile b/libcmark-gfm/buildfile
new file mode 100644
index 0000000..f2c47c5
--- /dev/null
+++ b/libcmark-gfm/buildfile
@@ -0,0 +1,10 @@
+# file : buildfile
+# copyright : Copyright (c) 2018-2019 Code Synthesis Ltd
+# license : FreeBSD License; see accompanying COPYING file
+
+./: {*/ -build/} doc{COPYING INSTALL README} manifest
+
+# Don't install tests or the INSTALL file.
+#
+tests/: install = false
+doc{INSTALL}@./: install = false
diff --git a/libcmark-gfm/libcmark-gfm/.gitignore b/libcmark-gfm/libcmark-gfm/.gitignore
new file mode 100644
index 0000000..c2f1607
--- /dev/null
+++ b/libcmark-gfm/libcmark-gfm/.gitignore
@@ -0,0 +1,3 @@
+# Generated version header.
+#
+version.h
diff --git a/libcmark-gfm/libcmark-gfm/buildfile b/libcmark-gfm/libcmark-gfm/buildfile
new file mode 100644
index 0000000..41c934d
--- /dev/null
+++ b/libcmark-gfm/libcmark-gfm/buildfile
@@ -0,0 +1,84 @@
+# file : libcmark-gfm/buildfile
+# copyright : Copyright (c) 2018-2019 Code Synthesis Ltd
+# license : FreeBSD License; see accompanying COPYING file
+
+define inc: file
+inc{*}: extension = inc
+
+lib{cmark-gfm}: {h }{* -version} \
+ {h }{ version} \
+ src/{h inc c}{* -main}
+
+windows = ($c.target.class == 'windows')
+
+gcc = ($c.class == 'gcc')
+
+# No need to include the generated version header into the distribution since
+# it is installed under a different name and so the correct one will always
+# be picked up.
+#
+h{version}: src/in{cmark-gfm_version} $src_root/manifest
+h{version}:
+{
+ in.symbol = '@'
+
+ PROJECT_VERSION_MAJOR = $upstream_version_major
+ PROJECT_VERSION_MINOR = $upstream_version_minor
+ PROJECT_VERSION_PATCH = $upstream_version_patch
+ PROJECT_VERSION_GFM = $upstream_version_gfm
+}
+
+# Build options.
+#
+obja{*}: c.poptions += -DCMARK_GFM_STATIC_BUILD
+objs{*}: c.poptions += -DCMARK_GFM_SHARED_BUILD
+
+if! $windows
+ c.coptions += -fvisibility=hidden
+else
+ c.poptions += -DWIN32 -D_WINDOWS
+
+# Note that we add "-I$src_root" for the headers auto-generating machinery to
+# work properly.
+#
+c.poptions =+ "-I$out_root" "-I$src_root" "-I$src_base" "-I$src_base/src"
+
+if $gcc
+{
+ c.coptions += -pedantic
+
+ # Disable warnings that pop up with -Wextra. Upstream doesn't seem to care
+ # about these and it is not easy to disable specific warnings in a way that
+ # works across compilers/version (some -Wno-* options are only recognized in
+ # newer versions). There are still some warnings left that appear for
+ # certain platforms/compilers. We pass them through but disable treating
+ # them as errors.
+ #
+ c.coptions += -Wno-extra -Wno-error
+}
+
+# Export options.
+#
+lib{cmark-gfm}: cc.export.poptions = "-I$out_root" \
+ "-I$src_root" \
+ "-I$src_base" \
+ "-I$src_base/src"
+
+liba{cmark-gfm}: cc.export.poptions += -DCMARK_GFM_STATIC
+libs{cmark-gfm}: cc.export.poptions += -DCMARK_GFM_SHARED
+
+# See bootstrap.build for details.
+#
+if $version.pre_release
+ lib{cmark-gfm}: bin.lib.version = @"-$version.project_id"
+else
+ lib{cmark-gfm}: bin.lib.version = @"-$abi_version"
+
+# Install the bare minimum of headers.
+#
+h{*}: install = false
+
+for h: src/{cmark-gfm.h cmark-gfm-extension_api.h} cmark-gfm_export.h
+ h{$h}@./$path.directory($h): install = include/
+
+h{version}: install = include/cmark-gfm_version.h
diff --git a/libcmark-gfm/libcmark-gfm/cmark-gfm_export.h b/libcmark-gfm/libcmark-gfm/cmark-gfm_export.h
new file mode 100644
index 0000000..b6b42dc
--- /dev/null
+++ b/libcmark-gfm/libcmark-gfm/cmark-gfm_export.h
@@ -0,0 +1,54 @@
+/* file : libcmark-gfm/cmark-gfm_export.h -*- C -*-
+ * copyright : Copyright (c) 2016-2019 Code Synthesis Ltd
+ * license : FreeBSD License; see accompanying COPYING file
+ */
+
+#ifndef CMARK_GFM_EXPORT_H
+#define CMARK_GFM_EXPORT_H
+
+/*
+ * The upstream's version of this file is auto-generated by cmake. It looks
+ * quite convoluted and contains unused macro definitions. Moreover it seems
+ * to be broken, mismatching build/use pre-processor options (see the issue
+ * #156). Note that currently the upstream disables building shared libraries
+ * with VC.
+ *
+ * We implement this file from scratch using the standard build2 export header
+ * as a template.
+ */
+#if defined(CMARK_GFM_STATIC) // Using static.
+# define CMARK_GFM_EXPORT
+#elif defined(CMARK_GFM_STATIC_BUILD) // Building static.
+# define CMARK_GFM_EXPORT
+#elif defined(CMARK_GFM_SHARED) // Using shared.
+# ifdef _WIN32
+# define CMARK_GFM_EXPORT __declspec(dllimport)
+# else
+# define CMARK_GFM_EXPORT
+# endif
+#elif defined(CMARK_GFM_SHARED_BUILD) // Building shared.
+# ifdef _WIN32
+# define CMARK_GFM_EXPORT __declspec(dllexport)
+# else
+# define CMARK_GFM_EXPORT __attribute__((visibility("default")))
+# endif
+#else
+// If none of the above macros are defined, then we assume we are being used
+// by some third-party build system that cannot/doesn't signal the library
+// type. Note that this fallback works for both static and shared but in case
+// of shared will be sub-optimal compared to having dllimport.
+//
+# define CMARK_GFM_EXPORT // Using static or shared.
+#endif
+
+/*
+ * Undefining these cmake-generated macros is not technically required, but
+ * let's keep them for the record.
+ */
+#undef CMARK_GFM_NO_EXPORT
+#undef CMARK_GFM_DEPRECATED
+#undef CMARK_GFM_NO_DEPRECATED
+#undef CMARK_GFM_DEPRECATED_EXPORT
+#undef CMARK_GFM_DEPRECATED_NO_EXPORT
+
+#endif /* CMARK_GFM_EXPORT_H */
diff --git a/libcmark-gfm/libcmark-gfm/cmark-gfm_version.h b/libcmark-gfm/libcmark-gfm/cmark-gfm_version.h
new file mode 100644
index 0000000..6884503
--- /dev/null
+++ b/libcmark-gfm/libcmark-gfm/cmark-gfm_version.h
@@ -0,0 +1,7 @@
+/*
+ * file : libcmark-gfm/cmark-gfm_version.h
+ * copyright : Copyright (c) 2016-2019 Code Synthesis Ltd
+ * license : FreeBSD License; see accompanying COPYING file
+ */
+
+#include <libcmark-gfm/version.h>
diff --git a/libcmark-gfm/libcmark-gfm/config.h b/libcmark-gfm/libcmark-gfm/config.h
new file mode 100644
index 0000000..955b03b
--- /dev/null
+++ b/libcmark-gfm/libcmark-gfm/config.h
@@ -0,0 +1,81 @@
+#ifndef CMARK_CONFIG_H
+#define CMARK_CONFIG_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*
+ * For the semantics of the following macros refer to src/CMakeLists.txt.
+ */
+
+#define HAVE_STDBOOL_H
+
+#ifdef HAVE_STDBOOL_H
+ #include <stdbool.h>
+#elif !defined(__cplusplus)
+ typedef char bool;
+#endif
+
+#ifndef _MSC_VER
+# define HAVE___BUILTIN_EXPECT
+# define HAVE___ATTRIBUTE__
+#endif
+
+#ifdef HAVE___ATTRIBUTE__
+ #define CMARK_ATTRIBUTE(list) __attribute__ (list)
+#else
+ #define CMARK_ATTRIBUTE(list)
+#endif
+
+#ifndef CMARK_INLINE
+ #if defined(_MSC_VER) && !defined(__cplusplus)
+ #define CMARK_INLINE __inline
+ #else
+ #define CMARK_INLINE inline
+ #endif
+#endif
+
+/* snprintf and vsnprintf fallbacks for MSVC before 2015,
+ due to Valentin Milea http://stackoverflow.com/questions/2915672/
+*/
+
+#if defined(_MSC_VER) && _MSC_VER < 1900
+
+#include <stdio.h>
+#include <stdarg.h>
+
+#define snprintf c99_snprintf
+#define vsnprintf c99_vsnprintf
+
+CMARK_INLINE int c99_vsnprintf(char *outBuf, size_t size, const char *format, va_list ap)
+{
+ int count = -1;
+
+ if (size != 0)
+ count = _vsnprintf_s(outBuf, size, _TRUNCATE, format, ap);
+ if (count == -1)
+ count = _vscprintf(format, ap);
+
+ return count;
+}
+
+CMARK_INLINE int c99_snprintf(char *outBuf, size_t size, const char *format, ...)
+{
+ int count;
+ va_list ap;
+
+ va_start(ap, format);
+ count = c99_vsnprintf(outBuf, size, format, ap);
+ va_end(ap);
+
+ return count;
+}
+
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/libcmark-gfm/libcmark-gfm/config.h.in.orig b/libcmark-gfm/libcmark-gfm/config.h.in.orig
new file mode 120000
index 0000000..6d2701e
--- /dev/null
+++ b/libcmark-gfm/libcmark-gfm/config.h.in.orig
@@ -0,0 +1 @@
+src/config.h.in \ No newline at end of file
diff --git a/libcmark-gfm/libcmark-gfm/src b/libcmark-gfm/libcmark-gfm/src
new file mode 120000
index 0000000..ff7dce8
--- /dev/null
+++ b/libcmark-gfm/libcmark-gfm/src
@@ -0,0 +1 @@
+../../upstream/src \ No newline at end of file
diff --git a/libcmark-gfm/manifest b/libcmark-gfm/manifest
new file mode 100644
index 0000000..201c338
--- /dev/null
+++ b/libcmark-gfm/manifest
@@ -0,0 +1,21 @@
+: 1
+name: libcmark-gfm
+
+# Note: remember to update summary below and build/bootstrap.build!
+#
+version: 0.29.0-a.0.z
+
+project: cmark-gfm
+summary: GitHub-flavored CommonMark parsing and rendering C library, version 0.29.0.gfm.0
+license: 2-clause BSD; FreeBSD License
+tags: github, markdown, cmark, commonmark, gfm, parser, renderer, c, api
+description-file: README
+url: https://github.com/github/cmark-gfm
+src-url: https://git.build2.org/cgit/packaging/cmark-gfm/cmark-gfm/tree/libcmark-gfm/
+package-url: https://git.build2.org/cgit/packaging/cmark-gfm/
+email: packaging@build2.org ; Report issues at https://github.com/github/cmark-gfm/issues.
+package-email: packaging@build2.org ; Mailing list.
+build-error-email: builds@build2.org
+builds: all
+depends: * build2 >= 0.10.0-
+depends: * bpkg >= 0.10.0-
diff --git a/libcmark-gfm/tests/.gitignore b/libcmark-gfm/tests/.gitignore
new file mode 100644
index 0000000..662178d
--- /dev/null
+++ b/libcmark-gfm/tests/.gitignore
@@ -0,0 +1,8 @@
+# Test executables.
+#
+driver
+
+# Testscript output directories (can be symlinks).
+#
+test
+test-*
diff --git a/libcmark-gfm/tests/basic/buildfile b/libcmark-gfm/tests/basic/buildfile
new file mode 100644
index 0000000..3f72c2d
--- /dev/null
+++ b/libcmark-gfm/tests/basic/buildfile
@@ -0,0 +1,7 @@
+# file : tests/basic/buildfile
+# copyright : Copyright (c) 2018-2019 Code Synthesis Ltd
+# license : FreeBSD License; see accompanying COPYING file
+
+import libs = libcmark-gfm%lib{cmark-gfm}
+
+exe{driver}: {h c}{**} $libs testscript
diff --git a/libcmark-gfm/tests/basic/driver.c b/libcmark-gfm/tests/basic/driver.c
new file mode 100644
index 0000000..e38e03a
--- /dev/null
+++ b/libcmark-gfm/tests/basic/driver.c
@@ -0,0 +1,28 @@
+/*
+ * file : tests/basic/driver.c
+ * copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC
+ * license : FreeBSD License; see accompanying COPYING file
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <assert.h>
+
+#include <cmark-gfm.h>
+#include <cmark-gfm-extension_api.h>
+
+int
+main (int argc, const char* argv[])
+{
+ assert (argc == 2);
+
+ const char* from = argv[1];
+
+ char* to = cmark_markdown_to_html (from,
+ strlen (from),
+ CMARK_OPT_DEFAULT |
+ CMARK_OPT_VALIDATE_UTF8);
+ printf ("%s", to);
+ cmark_get_default_mem_allocator ()->free (to);
+ return 0;
+}
diff --git a/libcmark-gfm/tests/basic/testscript b/libcmark-gfm/tests/basic/testscript
new file mode 100644
index 0000000..41b7d26
--- /dev/null
+++ b/libcmark-gfm/tests/basic/testscript
@@ -0,0 +1,5 @@
+# file : tests/basic/testscript
+# copyright : Copyright (c) 2016-2019 Code Synthesis Ltd
+# license : FreeBSD License; see accompanying COPYING file
+
+$* 'Hello *world*' >'<p>Hello <em>world</em></p>'
diff --git a/libcmark-gfm/tests/build/.gitignore b/libcmark-gfm/tests/build/.gitignore
new file mode 100644
index 0000000..4a730a3
--- /dev/null
+++ b/libcmark-gfm/tests/build/.gitignore
@@ -0,0 +1,3 @@
+config.build
+root/
+bootstrap/
diff --git a/libcmark-gfm/tests/build/bootstrap.build b/libcmark-gfm/tests/build/bootstrap.build
new file mode 100644
index 0000000..cb2b962
--- /dev/null
+++ b/libcmark-gfm/tests/build/bootstrap.build
@@ -0,0 +1,9 @@
+# file : tests/build/bootstrap.build
+# copyright : Copyright (c) 2018-2019 Code Synthesis Ltd
+# license : FreeBSD License; see accompanying COPYING file
+
+project = # Unnamed tests subproject.
+
+using config
+using test
+using dist
diff --git a/libcmark-gfm/tests/build/root.build b/libcmark-gfm/tests/build/root.build
new file mode 100644
index 0000000..1a4dbbe
--- /dev/null
+++ b/libcmark-gfm/tests/build/root.build
@@ -0,0 +1,16 @@
+# file : tests/build/root.build
+# copyright : Copyright (c) 2018-2019 Code Synthesis Ltd
+# license : FreeBSD License; see accompanying COPYING file
+
+using c
+
+h{*}: extension = h
+c{*}: extension = c
+
+# Every exe{} in this subproject is by default a test.
+#
+exe{*}: test = true
+
+# The test target for cross-testing (running tests under Wine, etc).
+#
+test.target = $c.target
diff --git a/libcmark-gfm/tests/buildfile b/libcmark-gfm/tests/buildfile
new file mode 100644
index 0000000..3961c0a
--- /dev/null
+++ b/libcmark-gfm/tests/buildfile
@@ -0,0 +1,5 @@
+# file : tests/buildfile
+# copyright : Copyright (c) 2018-2019 Code Synthesis Ltd
+# license : FreeBSD License; see accompanying COPYING file
+
+./: {*/ -build/}
diff --git a/packages.manifest b/packages.manifest
new file mode 100644
index 0000000..cae5166
--- /dev/null
+++ b/packages.manifest
@@ -0,0 +1,4 @@
+: 1
+location: libcmark-gfm/
+:
+location: libcmark-gfm-extensions/
diff --git a/repositories.manifest b/repositories.manifest
new file mode 100644
index 0000000..829687b
--- /dev/null
+++ b/repositories.manifest
@@ -0,0 +1,2 @@
+: 1
+summary: GitHub-flavored CommonMark build2 package repository
diff --git a/upstream b/upstream
new file mode 160000
+Subproject b8eb2e00de094999f978e9cb02b1a78d810812d