diff options
| author | Liu Yiding <liuyd.fnst@fujitsu.com> | 2026-02-13 18:10:05 +0800 |
|---|---|---|
| committer | Khem Raj <raj.khem@gmail.com> | 2026-02-16 00:34:04 -0800 |
| commit | 6efa5edcf261784ed680fa6eed98a465cf53d88e (patch) | |
| tree | e7e745ead3568cb1066ccf4670bc36b1e266854a | |
| parent | e7517b1d4c07c1d3075b54a8b35464da164564f5 (diff) | |
| download | meta-openembedded-6efa5edcf261784ed680fa6eed98a465cf53d88e.tar.gz | |
hotdoc : Add new recipe
1. Backport following patch to solve build and runtime issue
0001-c_comment_scanner-fix-function-prototypes.patch
0002-avoid-third-party-backports-dependency-on-sufficient.patch
0003-CMake-4-compatibility.patch
2. Add do_configure:prepend() to solve buildpaths QA check
do_package_qa: QA Issue: File /usr/lib/python3.14/site-packages/hotdoc/parsers/cmark.cpython-314-x86_64-linux-gnu.so in package hotdoc contains reference to TMPDIR [buildpaths]
3. Add 0004-Use-flex-with-noline-option-to-prevent.patch to solve buildpaths QA check
do_package_qa:QA Issue: File /usr/src/debug/hotdoc/0.17.4/hotdoc/parsers/c_comment_scanner/scanner.c in package hotdoc-src contains reference to TMPDIR [buildpaths]
4. Add clang as RDEPENDS for following reason
Hotdoc has some Extensions including c-Extension.
The c-Extension needs llvm and clang in runtime as introduced in doc of hotdoc.
https://hotdoc.github.io/c-extension.html#c-extension
"The extension uses Clang to build and walk an AST from the source code"
Signed-off-by: Wang Mingyu <wangmy@fujitsu.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
5 files changed, 205 insertions, 0 deletions
diff --git a/meta-python/recipes-devtools/hotdoc/hotdoc/0001-c_comment_scanner-fix-function-prototypes.patch b/meta-python/recipes-devtools/hotdoc/hotdoc/0001-c_comment_scanner-fix-function-prototypes.patch new file mode 100644 index 0000000000..c26dde93b3 --- /dev/null +++ b/meta-python/recipes-devtools/hotdoc/hotdoc/0001-c_comment_scanner-fix-function-prototypes.patch | |||
| @@ -0,0 +1,32 @@ | |||
| 1 | Subject: [PATCH 1/2] c_comment_scanner: fix function prototypes | ||
| 2 | |||
| 3 | scanner.l: Fix compile error as the following: | ||
| 4 | |||
| 5 | python3-hotdoc/0.17.4/sources/hotdoc-0.17.4/hotdoc/parsers/c_comment_scanner/scanner.l:126:1: error: conflicting types for 'parse_comment'; have 'int(PyObject *)' {aka 'int(struct _object *)'} | ||
| 6 | | 126 | parse_comment (PyObject *comments) | ||
| 7 | |||
| 8 | Upstream-Status: Backport [https://github.com/hotdoc/hotdoc/commit/adf8518431fafb78c9b47862a0a9a58824b6a421] | ||
| 9 | |||
| 10 | Signed-off-by: Liu Yiding <liuyd.fnst@fujitsu.com> | ||
| 11 | --- | ||
| 12 | hotdoc/parsers/c_comment_scanner/scanner.l | 4 ++-- | ||
| 13 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
| 14 | |||
| 15 | diff --git a/hotdoc/parsers/c_comment_scanner/scanner.l b/hotdoc/parsers/c_comment_scanner/scanner.l | ||
| 16 | index 0408601..7bccd64 100644 | ||
| 17 | --- a/hotdoc/parsers/c_comment_scanner/scanner.l | ||
| 18 | +++ b/hotdoc/parsers/c_comment_scanner/scanner.l | ||
| 19 | @@ -34,8 +34,8 @@ | ||
| 20 | extern int yylex (PyObject *comments); | ||
| 21 | #define YY_DECL int yylex (PyObject *comments) | ||
| 22 | static int yywrap (void); | ||
| 23 | -static int parse_comment (); | ||
| 24 | -static int parse_define (); | ||
| 25 | +static int parse_comment (PyObject *); | ||
| 26 | +static int parse_define (PyObject *); | ||
| 27 | %} | ||
| 28 | |||
| 29 | %option nounput | ||
| 30 | -- | ||
| 31 | 2.43.0 | ||
| 32 | |||
diff --git a/meta-python/recipes-devtools/hotdoc/hotdoc/0002-avoid-third-party-backports-dependency-on-sufficient.patch b/meta-python/recipes-devtools/hotdoc/hotdoc/0002-avoid-third-party-backports-dependency-on-sufficient.patch new file mode 100644 index 0000000000..560d1257f0 --- /dev/null +++ b/meta-python/recipes-devtools/hotdoc/hotdoc/0002-avoid-third-party-backports-dependency-on-sufficient.patch | |||
| @@ -0,0 +1,72 @@ | |||
| 1 | Subject: [PATCH 2/2] avoid third-party backports dependency on sufficiently | ||
| 2 | new python | ||
| 3 | |||
| 4 | `backports.entry_points_selectable` backports functionality from python | ||
| 5 | 3.10 to older versions of python. | ||
| 6 | |||
| 7 | Backport this patch to solve runtime backports import problem as following: | ||
| 8 | File "/usr/lib/python3.14/site-packages/hotdoc/utils/utils.py", line 38, in <module> | ||
| 9 | from backports.entry_points_selectable import entry_points | ||
| 10 | ModuleNotFoundError: No module named 'backports' | ||
| 11 | |||
| 12 | Upstream-Status: Backport [https://github.com/hotdoc/hotdoc/commit/51043c3ef889e36c8232280581598b875073ded7] | ||
| 13 | |||
| 14 | Signed-off-by: Liu Yiding <liuyd.fnst@fujitsu.com> | ||
| 15 | --- | ||
| 16 | hotdoc/extensions/gi/utils.py | 6 +++++- | ||
| 17 | hotdoc/utils/utils.py | 6 +++++- | ||
| 18 | setup.py | 2 +- | ||
| 19 | 3 files changed, 11 insertions(+), 3 deletions(-) | ||
| 20 | |||
| 21 | diff --git a/hotdoc/extensions/gi/utils.py b/hotdoc/extensions/gi/utils.py | ||
| 22 | index 159c2b6..91902cb 100644 | ||
| 23 | --- a/hotdoc/extensions/gi/utils.py | ||
| 24 | +++ b/hotdoc/extensions/gi/utils.py | ||
| 25 | @@ -1,9 +1,13 @@ | ||
| 26 | import os | ||
| 27 | from collections import namedtuple | ||
| 28 | import pathlib | ||
| 29 | +import sys | ||
| 30 | import traceback | ||
| 31 | |||
| 32 | -from backports.entry_points_selectable import entry_points | ||
| 33 | +if sys.version_info >= (3, 10): | ||
| 34 | + from importlib.metadata import entry_points | ||
| 35 | +else: | ||
| 36 | + from backports.entry_points_selectable import entry_points | ||
| 37 | |||
| 38 | from hotdoc.core.links import Link | ||
| 39 | from hotdoc.utils.loggable import info, debug | ||
| 40 | diff --git a/hotdoc/utils/utils.py b/hotdoc/utils/utils.py | ||
| 41 | index 518d308..aef657a 100644 | ||
| 42 | --- a/hotdoc/utils/utils.py | ||
| 43 | +++ b/hotdoc/utils/utils.py | ||
| 44 | @@ -35,7 +35,11 @@ import importlib.util | ||
| 45 | from urllib.request import urlretrieve | ||
| 46 | from pathlib import Path | ||
| 47 | |||
| 48 | -from backports.entry_points_selectable import entry_points | ||
| 49 | +if sys.version_info >= (3, 10): | ||
| 50 | + from importlib.metadata import entry_points | ||
| 51 | +else: | ||
| 52 | + from backports.entry_points_selectable import entry_points | ||
| 53 | + | ||
| 54 | try: | ||
| 55 | import importlib.metadata as meta | ||
| 56 | except ImportError: | ||
| 57 | diff --git a/setup.py b/setup.py | ||
| 58 | index 5d7f131..9ee504d 100644 | ||
| 59 | --- a/setup.py | ||
| 60 | +++ b/setup.py | ||
| 61 | @@ -300,7 +300,7 @@ INSTALL_REQUIRES = [ | ||
| 62 | 'wheezy.template', | ||
| 63 | 'toposort>=1.4', | ||
| 64 | 'importlib_metadata; python_version<"3.10"', | ||
| 65 | - 'backports.entry_points_selectable', | ||
| 66 | + 'backports.entry_points_selectable; python_version<"3.10"', | ||
| 67 | ] | ||
| 68 | |||
| 69 | # dbus-deviation requires sphinx, which requires python 3.5 | ||
| 70 | -- | ||
| 71 | 2.43.0 | ||
| 72 | |||
diff --git a/meta-python/recipes-devtools/hotdoc/hotdoc/0003-CMake-4-compatibility.patch b/meta-python/recipes-devtools/hotdoc/hotdoc/0003-CMake-4-compatibility.patch new file mode 100644 index 0000000000..056ad5d340 --- /dev/null +++ b/meta-python/recipes-devtools/hotdoc/hotdoc/0003-CMake-4-compatibility.patch | |||
| @@ -0,0 +1,44 @@ | |||
| 1 | Subject: [PATCH] CMake 4 compatibility | ||
| 2 | |||
| 3 | All CMake versions older than 3.10 are deprecated. | ||
| 4 | |||
| 5 | Upstream-Status: Backport [https://github.com/MathieuDuponchelle/cmark/commit/bd78193dbff98c3860e77629b5c7bfee6169d1da] | ||
| 6 | |||
| 7 | Signed-off-by: Liu Yiding <liuyd.fnst@fujitsu.com> | ||
| 8 | --- | ||
| 9 | CMakeLists.txt | 11 ++--------- | ||
| 10 | extensions/CMakeLists.txt | 2 +- | ||
| 11 | 2 files changed, 3 insertions(+), 10 deletions(-) | ||
| 12 | |||
| 13 | diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
| 14 | index ff97419..45fdf6c 100755 | ||
| 15 | --- a/CMakeLists.txt | ||
| 16 | +++ b/CMakeLists.txt | ||
| 17 | @@ -1,12 +1,5 @@ | ||
| 18 | -cmake_minimum_required(VERSION 2.8.9) | ||
| 19 | - | ||
| 20 | -# prevent ugly developer warnings because version is set directly, not through project() | ||
| 21 | -# it should be redone properly by using VERSION in project() if on CMake 3.x | ||
| 22 | -if(CMAKE_MAJOR_VERSION GREATER 2) | ||
| 23 | - cmake_policy(SET CMP0048 OLD) | ||
| 24 | -endif() | ||
| 25 | - | ||
| 26 | -project(cmark) | ||
| 27 | +cmake_minimum_required(VERSION 3.10) | ||
| 28 | +project(cmark VERSION 0.28.3) | ||
| 29 | |||
| 30 | include("FindAsan.cmake") | ||
| 31 | |||
| 32 | diff --git a/extensions/CMakeLists.txt b/extensions/CMakeLists.txt | ||
| 33 | index e62d155..b6a1556 100644 | ||
| 34 | --- a/extensions/CMakeLists.txt | ||
| 35 | +++ b/extensions/CMakeLists.txt | ||
| 36 | @@ -1,4 +1,4 @@ | ||
| 37 | -cmake_minimum_required(VERSION 2.8) | ||
| 38 | +cmake_minimum_required(VERSION 3.10) | ||
| 39 | set(LIBRARY "cmarkextensions") | ||
| 40 | set(LIBRARY_SOURCES | ||
| 41 | core-extensions.c | ||
| 42 | -- | ||
| 43 | 2.43.0 | ||
| 44 | |||
diff --git a/meta-python/recipes-devtools/hotdoc/hotdoc/0004-Use-flex-with-noline-option-to-prevent.patch b/meta-python/recipes-devtools/hotdoc/hotdoc/0004-Use-flex-with-noline-option-to-prevent.patch new file mode 100644 index 0000000000..06adcbd1c2 --- /dev/null +++ b/meta-python/recipes-devtools/hotdoc/hotdoc/0004-Use-flex-with-noline-option-to-prevent.patch | |||
| @@ -0,0 +1,29 @@ | |||
| 1 | Subject: [PATCH] Use flex with --noline option to prevent adding #line to c file | ||
| 2 | |||
| 3 | To fix following do_package QA Issue: | ||
| 4 | |||
| 5 | do_package_qa:QA Issue: File /usr/src/debug/hotdoc/0.17.4/hotdoc/parsers/c_comment_scanner/scanner.c in package hotdoc-src contains reference to TMPDIR [buildpaths] | ||
| 6 | |||
| 7 | Upstream-Status: Inappropriate [oe-specific] | ||
| 8 | |||
| 9 | Signed-off-by: Liu Yiding <liuyd.fnst@fujitsu.com> | ||
| 10 | --- | ||
| 11 | setup.py | 2 +- | ||
| 12 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
| 13 | |||
| 14 | diff --git a/setup.py b/setup.py | ||
| 15 | index 9ee504d..9bbc744 100644 | ||
| 16 | --- a/setup.py | ||
| 17 | +++ b/setup.py | ||
| 18 | @@ -365,7 +365,7 @@ class FlexExtension (Extension): | ||
| 19 | |||
| 20 | self.sources.append(built_scanner_path) | ||
| 21 | if newer_group(self.__flex_sources, built_scanner_path): | ||
| 22 | - cmd = ['flex', '-o', built_scanner_path] | ||
| 23 | + cmd = ['flex', '--noline', '-o', built_scanner_path] | ||
| 24 | for s in self.__flex_sources: | ||
| 25 | cmd.append(s) | ||
| 26 | spawn.spawn(cmd, verbose=1) | ||
| 27 | -- | ||
| 28 | 2.43.0 | ||
| 29 | |||
diff --git a/meta-python/recipes-devtools/hotdoc/hotdoc_0.17.4.bb b/meta-python/recipes-devtools/hotdoc/hotdoc_0.17.4.bb new file mode 100644 index 0000000000..081a8d9607 --- /dev/null +++ b/meta-python/recipes-devtools/hotdoc/hotdoc_0.17.4.bb | |||
| @@ -0,0 +1,28 @@ | |||
| 1 | SUMMARY = "Hotdoc is a documentation framework" | ||
| 2 | DESCRIPTION = "Hotdoc is a documentation micro-framework. It provides an interface for extensions to plug upon, along with some base objects (formatters, ...)" | ||
| 3 | HOMEPAGE = "https://github.com/hotdoc/hotdoc" | ||
| 4 | |||
| 5 | LICENSE = "LGPL-2.1-or-later" | ||
| 6 | LIC_FILES_CHKSUM = "file://COPYING;md5=90263a49bc1d9a204656fec4d5616c66" | ||
| 7 | |||
| 8 | SRC_URI[sha256sum] = "c4d5dff647f03aa87a1d2d06035d2819edd099b91635e3b2ee390829357ae9fc" | ||
| 9 | |||
| 10 | SRC_URI = "file://0001-c_comment_scanner-fix-function-prototypes.patch \ | ||
| 11 | file://0002-avoid-third-party-backports-dependency-on-sufficient.patch \ | ||
| 12 | file://0003-CMake-4-compatibility.patch;patchdir=cmark \ | ||
| 13 | " | ||
| 14 | |||
| 15 | SRC_URI:append:class-target = "file://0004-Use-flex-with-noline-option-to-prevent.patch" | ||
| 16 | |||
| 17 | DEPENDS += "libxml2 glib-2.0 json-glib" | ||
| 18 | |||
| 19 | inherit pypi python_setuptools_build_meta pkgconfig | ||
| 20 | |||
| 21 | #Fix LIBDIR path to fix buildpaths QA check of hotdoc/parsers/cmark.cpython-314-x86_64-linux-gnu.so | ||
| 22 | do_configure:prepend:class-target() { | ||
| 23 | sed -i -e "s#'\"%s\"' % CMARK_BUILD_DIR#'\"${PYTHON_SITEPACKAGES_DIR}/${PN}\"'#" ${S}/setup.py | ||
| 24 | } | ||
| 25 | |||
| 26 | RDEPENDS:${PN} += "clang python3-appdirs python3-cchardet python3-dbus-deviation python3-lxml python3-networkx python3-pkgconfig python3-pyyaml python3-schema python3-toposort python3-wheezy-template" | ||
| 27 | |||
| 28 | BBCLASSEXTEND = "native" | ||
