From 934ccdf9589cebc13a9fc51776803eed95357894 Mon Sep 17 00:00:00 2001 From: meator Date: Thu, 25 May 2023 19:51:37 +0200 Subject: [PATCH] doxygen: update to 1.9.7 + add documentation This adds a new subpackage doxygen-doc which contains doxygen's documentation in PDF and HTML form. This uses the .repack version of doxygen which contains some fixes, notably for https://github.com/doxygen/doxygen/issues/10094 and https://github.com/doxygen/doxygen/issues/10053#10053 --- srcpkgs/doxygen-doc | 1 + .../doxygen/files/use-native-doxygen.patch | 39 +++++++++++++++ srcpkgs/doxygen/template | 48 +++++++++++++++---- 3 files changed, 80 insertions(+), 8 deletions(-) create mode 120000 srcpkgs/doxygen-doc create mode 100644 srcpkgs/doxygen/files/use-native-doxygen.patch diff --git a/srcpkgs/doxygen-doc b/srcpkgs/doxygen-doc new file mode 120000 index 000000000000..a7610321645c --- /dev/null +++ b/srcpkgs/doxygen-doc @@ -0,0 +1 @@ +doxygen \ No newline at end of file diff --git a/srcpkgs/doxygen/files/use-native-doxygen.patch b/srcpkgs/doxygen/files/use-native-doxygen.patch new file mode 100644 index 000000000000..bb8c516e40ec --- /dev/null +++ b/srcpkgs/doxygen/files/use-native-doxygen.patch @@ -0,0 +1,39 @@ +This patch is applied only when cross building. It makes sure that the native +version of doxygen is used for documentation generation and not the freshly built +one (which cannot be executed on host). +--- a/doc/CMakeLists.txt ++++ b/doc/CMakeLists.txt +@@ -21,13 +21,9 @@ + find_program(MAKEINDEX NAMES makeindex ) + include(GNUInstallDirs) + +-if (doxygen_BINARY_DIR) +- set(DOXYGEN_EXECUTABLE ${doxygen_BINARY_DIR}/bin/doxygen) +-else() + # when building only the doxygen_doc, from the doc/ directory, the + # doxygen project variables are unknown so look for doxygen in PATH + find_package(Doxygen) +-endif() + + set(DOC_INSTALL_DIR "share/doc/packages/doxygen" CACHE STRING "Relative path where to install the documentation") + set(DOC_FILES +--- a/examples/CMakeLists.txt ++++ b/examples/CMakeLists.txt +@@ -62,6 +62,8 @@ + EXAMPLE_manual EXAMPLE_mux + ) + ++find_package(Doxygen) ++ + foreach (f_inp ${BASIC_EXAMPLES}) + list(LENGTH ${f_inp} f_len) + list(GET ${f_inp} 0 f) +@@ -74,7 +76,7 @@ + add_custom_command( + COMMAND ${CMAKE_COMMAND} -E make_directory ${PROJECT_BINARY_DIR}/html/examples/${f} + COMMAND ${CMAKE_COMMAND} -E make_directory ${PROJECT_BINARY_DIR}/latex/examples/${f} +- COMMAND ${CMAKE_COMMAND} -E env PROJECT_BINARY_DIR=${PROJECT_BINARY_DIR} ${EXECUTABLE_OUTPUT_PATH}/doxygen ${f}.cfg ++ COMMAND ${CMAKE_COMMAND} -E env PROJECT_BINARY_DIR=${PROJECT_BINARY_DIR} ${DOXYGEN_EXECUTABLE} ${f}.cfg + COMMAND ${PYTHON_EXECUTABLE} ${TOP}/examples/strip_example.py < ${PROJECT_BINARY_DIR}/latex/examples/${f}/latex/refman.tex > ${PROJECT_BINARY_DIR}/latex/examples/${f}/latex/refman_doc.tex + DEPENDS doxygen ${f}.${f_ext} ${f}.cfg ${TOP}/examples/strip_example.py ${f_dep} + OUTPUT ${PROJECT_BINARY_DIR}/html/examples/${f}/html/index.html ${PROJECT_BINARY_DIR}/latex/examples/${f}/latex/refman_doc.tex diff --git a/srcpkgs/doxygen/template b/srcpkgs/doxygen/template index 981eb49049a9..46378ec8131a 100644 --- a/srcpkgs/doxygen/template +++ b/srcpkgs/doxygen/template @@ -1,17 +1,24 @@ # Template file for 'doxygen' pkgname=doxygen -version=1.9.5 -revision=2 +version=1.9.7 +revision=1 build_style=cmake -hostmakedepends="perl python3 flex" +configure_args="-Dbuild_doc=ON" +hostmakedepends="perl python3 flex texlive-ConTeXt texlive-latexextra + texlive-dvi" checkdepends="libxml2 texlive-BibTeX" short_desc="Source code documentation generator tool" maintainer="Érico Nogueira " license="GPL-2.0-only" homepage="http://www.doxygen.org/" changelog="https://www.doxygen.nl/manual/changelog.html" -distfiles="http://doxygen.nl/files/doxygen-${version}.src.tar.gz" -checksum=55b454b35d998229a96f3d5485d57a0a517ce2b78d025efb79d57b5a2e4b2eec +# This archive contains few fixes. Next update must remove .repack +distfiles="https://doxygen.nl/files/doxygen-${version}.repack.src.tar.gz" +checksum=aa9b2118578f4d277954c8584eb7228be47cdf29e8041ce4dcba21e41dfb89f3 + +if [ "$CROSS_BUILD" ]; then + hostmakedepends+=" doxygen" +fi build_options="wizard" desc_option_wizard="build Qt5 GUI configuration tool, doxywizard" @@ -25,9 +32,34 @@ if [ "$build_option_wizard" ]; then makedepends+=" qt5-devel" fi +# Use the host doxygen when building documentation on cross. +do_patch() { + if [ "$CROSS_BUILD" ]; then + patch -Np1 < ${FILESDIR}/use-native-doxygen.patch + fi +} + +post_build() { + ninja -C build docs +} + post_install() { - vman doc/doxygen.1 - if [ "$build_option_wizard" ]; then - vman doc/doxywizard.1 + if [ ! "$build_option_wizard" ]; then + rm ${DESTDIR}/usr/share/man/man1/doxywizard.1 fi + + # These manpages are generated because build_doc is ON, but we don't + # build these programs. + rm ${DESTDIR}/usr/share/man/man1/doxyindexer.1 + rm ${DESTDIR}/usr/share/man/man1/doxysearch.1 + + mv ${DESTDIR}/usr/share/doc/packages/doxygen ${DESTDIR}/usr/share/doc/doxygen +} + +doxygen-doc_package() { + short_desc+=" - documentation" + depends="${sourcepkg}>=${version}_${revision}" + pkg_install() { + vmove usr/share/doc/doxygen + } }