From 2ed1c005c9f95c7b33e99cab38a53fc562c920bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C5=99emysl=20Eric=20Janouch?= Date: Sat, 10 Jun 2023 12:06:52 +0200 Subject: [PATCH] Import liberty for its manpage generator It cannot parse the page well, so it's just a convenience fallback. --- .gitmodules | 3 +++ CMakeLists.txt | 11 ++++++++++- liberty | 1 + 3 files changed, 14 insertions(+), 1 deletion(-) create mode 160000 liberty diff --git a/.gitmodules b/.gitmodules index 67fbcf5..0db6604 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,6 @@ [submodule "termo"] path = termo url = https://git.janouch.name/p/termo.git +[submodule "liberty"] + path = liberty + url = https://git.janouch.name/p/liberty.git diff --git a/CMakeLists.txt b/CMakeLists.txt index fd2cc27..86c49ff 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -132,7 +132,8 @@ GETTEXT_CREATE_TRANSLATIONS ( find_program (ASCIIDOCTOR_EXECUTABLE asciidoctor) find_program (A2X_EXECUTABLE a2x) if (NOT ASCIIDOCTOR_EXECUTABLE AND NOT A2X_EXECUTABLE) - message (FATAL_ERROR "Neither asciidoctor nor a2x were found") + message (WARNING "Neither asciidoctor nor a2x were found, " + "falling back to a substandard manual page generator") endif () foreach (page "${PROJECT_NAME}.1") @@ -154,6 +155,14 @@ foreach (page "${PROJECT_NAME}.1") "${PROJECT_SOURCE_DIR}/docs/${page}.adoc" DEPENDS "docs/${page}.adoc" COMMENT "Generating man page for ${page}" VERBATIM) + else () + set (ASCIIMAN ${PROJECT_SOURCE_DIR}/liberty/tools/asciiman.awk) + add_custom_command (OUTPUT ${page_output} + COMMAND env LC_ALL=C asciidoc-release-version=${PROJECT_VERSION} + awk -f ${ASCIIMAN} "${PROJECT_SOURCE_DIR}/docs/${page}.adoc" + > ${page_output} + DEPENDS "docs/${page}.adoc" ${ASCIIMAN} + COMMENT "Generating man page for ${page}" VERBATIM) endif () endforeach () diff --git a/liberty b/liberty new file mode 160000 index 0000000..29bf109 --- /dev/null +++ b/liberty @@ -0,0 +1 @@ +Subproject commit 29bf109a51951e9c6d94bd2fedffb405bead849c