dev-python/cmarkgfm: new package, add 2022.10.27

Signed-off-by: Alarig Le Lay <alarig@swordarmor.fr>
This commit is contained in:
Alarig Le Lay 2024-08-21 13:00:45 +02:00
parent ea9b7d7446
commit c87d16f1f2
Signed by: alarig
GPG key ID: 7AFE62C6DF8BCDEC
5 changed files with 110 additions and 0 deletions

View file

@ -0,0 +1 @@
DIST cmarkgfm-2022.10.27.gh.tar.gz 11855 BLAKE2B 550c61f07908a919abc43bd8b8bb751cec7d8963cb3e8d725ce14597388754aa1dfcf141d6fc88ababfe9b981be0d36b495931afef5da3806b17bddde377fc29 SHA512 18a6a0a993c2663c6f6f19ac5ff51bf715a359ca415c6abad6a49d6cf8e749acfbe122a680122185da0ecf3cb5337876c316863c1f456744e6067f5947589c27

View file

@ -0,0 +1,32 @@
# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
PYTHON_COMPAT=( python3_{10..11} pypy3 )
DISTUTILS_USE_PEP517=setuptools
inherit distutils-r1 edos2unix
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}.gh.tar.gz"
LICENSE="MIT"
SLOT="0"
KEYWORDS="~amd64"
RDEPEND="
app-text/cmark-gfm
$(python_gen_cond_dep 'dev-python/cffi[${PYTHON_USEDEP}]' 'python*')
"
DEPEND="${RDEPEND}"
PATCHES=( "${FILESDIR}/${PN}-0.6.0-use-system-cmark-gfm.patch" )
src_prepare() {
edos2unix src/cmarkgfm/build_cmark.py
default
}
distutils_enable_tests pytest

View file

@ -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
)

View file

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="person">
<email>lssndrbarbieri@gmail.com</email>
<name>Alessandro Barbieri</name>
</maintainer>
<upstream>
<bugs-to>https://github.com/theacodes/cmarkgfm/issues</bugs-to>
<remote-id type="github">theacodes/cmarkgfm</remote-id>
<remote-id type="pypi">cmarkgfm</remote-id>
</upstream>
</pkgmetadata>

View file

@ -0,0 +1,17 @@
BDEPEND=test? ( app-text/cmark-gfm python_targets_python3_10? ( dev-python/cffi[python_targets_python3_10(-)?,python_targets_python3_11(-)?] ) python_targets_python3_11? ( dev-python/cffi[python_targets_python3_10(-)?,python_targets_python3_11(-)?] ) >=dev-python/pytest-7.4.4[python_targets_pypy3(-)?,python_targets_python3_10(-)?,python_targets_python3_11(-)?] ) python_targets_pypy3? ( dev-python/pypy3:= ) python_targets_python3_10? ( dev-lang/python:3.10 ) python_targets_python3_11? ( dev-lang/python:3.11 ) >=dev-python/gpep517-15[python_targets_pypy3(-)?,python_targets_python3_10(-)?,python_targets_python3_11(-)?] >=dev-python/setuptools-69.0.3[python_targets_pypy3(-)?,python_targets_python3_10(-)?,python_targets_python3_11(-)?]
DEFINED_PHASES=compile configure install prepare test
DEPEND=app-text/cmark-gfm python_targets_python3_10? ( dev-python/cffi[python_targets_python3_10(-)?,python_targets_python3_11(-)?] ) python_targets_python3_11? ( dev-python/cffi[python_targets_python3_10(-)?,python_targets_python3_11(-)?] )
DESCRIPTION=Python bindings for GitHub's cmark
EAPI=8
HOMEPAGE=https://github.com/theacodes/cmarkgfm
INHERIT=distutils-r1 edos2unix
IUSE=test python_targets_pypy3 python_targets_python3_10 python_targets_python3_11
KEYWORDS=~amd64
LICENSE=MIT
RDEPEND=app-text/cmark-gfm python_targets_python3_10? ( dev-python/cffi[python_targets_python3_10(-)?,python_targets_python3_11(-)?] ) python_targets_python3_11? ( dev-python/cffi[python_targets_python3_10(-)?,python_targets_python3_11(-)?] ) python_targets_pypy3? ( dev-python/pypy3:= ) python_targets_python3_10? ( dev-lang/python:3.10 ) python_targets_python3_11? ( dev-lang/python:3.11 )
REQUIRED_USE=|| ( python_targets_pypy3 python_targets_python3_10 python_targets_python3_11 )
RESTRICT=!test? ( test )
SLOT=0
SRC_URI=https://github.com/theacodes/cmarkgfm/archive/refs/tags/2022.10.27.tar.gz -> cmarkgfm-2022.10.27.gh.tar.gz
_eclasses_=toolchain-funcs e56c7649b804f051623c8bc1a1c44084 multilib c19072c3cd7ac5cb21de013f7e9832e0 flag-o-matic e503ea5acc20410237ba33ec3f7c857d out-of-source-utils 1a9007554652a6e627edbccb3c25a439 multibuild d67e78a235f541871c7dfe4cf7931489 multiprocessing 30ead54fa2e2b5f9cd4e612ffc34d0fe ninja-utils 2df4e452cea39a9ec8fb543ce059f8d6 python-utils-r1 8b220bbce5c119fb1d4d5c2f5588f3ea python-r1 428f5c53276c2adc06a89108fc2f9f46 distutils-r1 ac3ce68c875c9b392338dcd64f7feb73 edos2unix 33e347e171066657f91f8b0c72ec8773
_md5_=ef224e37adff7cc602a1399edfd0e4d2