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/: $ mkdir -p libcmark-gfm/src $ pushd libcmark-gfm/src $ ln -s ../../../upstream/src/*.{c,h,inc,in} ./ Also patch the HTML renderer not to use the empty attribute syntax (see the reported issue #245 for details): $ mv html.c html.c.orig $ cp html.c.orig html.c $ git apply fix-html-renderer.patch $ popd Note that patches are produced by commands similar to the following: $ git diff >fix-html-renderer.patch We unable to generate cmark-gfm_version.h directly from the template, since 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 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.