diff --git a/dev-python/cmarkgfm/Manifest b/dev-python/cmarkgfm/Manifest new file mode 100644 index 0000000000..e300e30dbc --- /dev/null +++ b/dev-python/cmarkgfm/Manifest @@ -0,0 +1 @@ +DIST cmarkgfm-0.5.3.tar.gz 12223 BLAKE2B fadbe49a59e4de24e51d2bb3f72138a67fa786c7c4b3901dc4689d1edbac8b7c04beb73c4c77b06fec933e526fdbf75640022ad41864054e69c9ae7ba0131d90 SHA512 2c4f891ca845cfa87adc7d3ab5b20999b1747c30d66a7ed52a2e870e77fac0993207f9ff49256c7588976475cb0adb816f70d2834dc26724d6ae50ff395ca734 diff --git a/dev-python/cmarkgfm/cmarkgfm-0.5.3.ebuild b/dev-python/cmarkgfm/cmarkgfm-0.5.3.ebuild new file mode 100644 index 0000000000..4130aa614b --- /dev/null +++ b/dev-python/cmarkgfm/cmarkgfm-0.5.3.ebuild @@ -0,0 +1,32 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +PYTHON_COMPAT=( python3_{8..10} pypy3 ) + +inherit distutils-r1 + +DESCRIPTION="Python bindings for GitHub's cmark" +HOMEPAGE="https://github.com/theacodes/cmarkgfm" +SRC_URI="https://github.com/theacodes/cmarkgfm/archive/refs/tags/${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="MIT" +KEYWORDS="~amd64" +SLOT="0" + +RDEPEND=" + app-text/cmark-gfm + virtual/python-cffi[${PYTHON_USEDEP}] +" +DEPEND="${RDEPEND}" +BDEPEND="app-text/dos2unix" + +PATCHES=( "${FILESDIR}/${P}-use-system-cmark-gfm.patch" ) + +src_prepare() { + dos2unix src/cmarkgfm/build_cmark.py || die + default +} + +distutils_enable_tests pytest diff --git a/dev-python/cmarkgfm/files/cmarkgfm-0.5.3-use-system-cmark-gfm.patch b/dev-python/cmarkgfm/files/cmarkgfm-0.5.3-use-system-cmark-gfm.patch new file mode 100644 index 0000000000..47894810e2 --- /dev/null +++ b/dev-python/cmarkgfm/files/cmarkgfm-0.5.3-use-system-cmark-gfm.patch @@ -0,0 +1,47 @@ +--- a/src/cmarkgfm/build_cmark.py ++++ b/src/cmarkgfm/build_cmark.py +@@ -8,12 +8,8 @@ + import cffi + + +-# Get the directory for the cmark source files. It's under the package root +-# as /third_party/cmark/src + HERE = os.path.dirname(os.path.abspath(__file__)) + PACKAGE_ROOT = os.path.abspath(os.path.join(HERE, '../../')) +-SRC_DIR = os.path.join(PACKAGE_ROOT, 'third_party/cmark/src') +-EXTENSIONS_SRC_DIR = os.path.join(PACKAGE_ROOT, 'third_party/cmark/extensions') + UNIX_GENERATED_SRC_DIR = os.path.join(PACKAGE_ROOT, 'generated', 'unix') + WIN_GENERATED_SRC_DIR = os.path.join(PACKAGE_ROOT, 'generated', 'windows') + +@@ -27,20 +23,6 @@ + CMARK_MODULE_H = fh.read() + + +-def _get_sources(dir, exclude=set()): +- sources = glob.iglob(os.path.join(dir, '*.c')) +- return sorted([ +- os.path.relpath(path, start=PACKAGE_ROOT) +- for path in +- sources +- if os.path.basename(path) not in exclude +- ]) +- +- +-SOURCES = _get_sources(SRC_DIR, exclude=set(['main.c'])) +-SOURCES.extend(_get_sources(EXTENSIONS_SRC_DIR)) +- +- + def _compiler_type(): + """ + Gets the compiler type from distutils. On Windows with MSVC it will be +@@ -76,8 +58,8 @@ + ffibuilder.set_source( + 'cmarkgfm._cmark', + CMARK_MODULE_H, +- sources=SOURCES, +- include_dirs=[SRC_DIR, EXTENSIONS_SRC_DIR, GENERATED_SRC_DIR], ++ include_dirs=[GENERATED_SRC_DIR], ++ libraries=["cmark-gfm", "cmark-gfm-extensions"], + extra_compile_args=EXTRA_COMPILE_ARGS + ) + diff --git a/dev-python/cmarkgfm/metadata.xml b/dev-python/cmarkgfm/metadata.xml new file mode 100644 index 0000000000..882411550a --- /dev/null +++ b/dev-python/cmarkgfm/metadata.xml @@ -0,0 +1,13 @@ + + + + + lssndrbarbieri@gmail.com + Alessandro Barbieri + + + https://github.com/theacodes/cmarkgfm/issues + theacodes/cmarkgfm + cmarkgfm + +