forked from gentoo/gentoo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Aaron W. Swenson <[email protected]>
- Loading branch information
1 parent
5708793
commit 2c6b17f
Showing
3 changed files
with
148 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
DIST gnucash-docs-4.12.tar.gz 76306600 BLAKE2B 78fb413099701da8c251681fa9724867f94cd731f396a80fd2be647790f32285a45eb857bfeae4ed6c36f5ec7664bc5aabfbdc2237d155a9f95aab78bf3227fa SHA512 29db1a402f7d417ad1a2f4db683974447add597e1b9e1b421789f3d2c8f987d1692202bb9052548b5ce544973c12bd538abab5ff33d3253330f0535ef920c8f7 | ||
DIST gnucash-docs-4.13.tar.gz 76306335 BLAKE2B 61944e3da12d4f7b4a26f1301e640deca87656c4a9c7cd935f4c52ae69e49bf746850f09513d8fbd92314827f683c3a9c83c59479d583c192d977afdf9d8fce4 SHA512 7081a84c3426ef84e88aef520458a0d06382853cb9a51880766033b655f873d0926848387d573a38eca82cf0c6bceecdbd56704ab9ecb3068c78d7ce5c8d4da0 |
75 changes: 75 additions & 0 deletions
75
app-doc/gnucash-docs/files/gnucash-docs-4.13-reverese-kde-help-dir.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
From 513747413efc4732f5ae824ccc84316169b1523f Mon Sep 17 00:00:00 2001 | ||
From: Geert Janssens <[email protected]> | ||
Date: Thu, 20 Oct 2022 11:25:19 +0200 | ||
Subject: [PATCH] Ensure our documentation is also found when gnucash is run in | ||
KDE | ||
|
||
Turns out KDE is not adhering to the xdg spec after all. | ||
It has support for the old ghelp mechanism, but when using | ||
the help: prefix, it falls back to an internal protocol. | ||
In that case the requested document is searched for in | ||
<prefix>/share/doc/HTML/<lang>. | ||
Extra caveat - the English documentation is searched for | ||
in a directory 'en' instead of 'C'. | ||
This is not a problem in yelp, only in khelpcenter. Unfortunately | ||
khelpcenter is the default application to process help: prefixes | ||
in a Kde plasma desktop, hence the workaround. | ||
--- | ||
cmake/AddXdgHelpTarget.cmake | 28 +++++++++++++++++++++++++--- | ||
1 file changed, 25 insertions(+), 3 deletions(-) | ||
|
||
diff --git a/cmake/AddXdgHelpTarget.cmake b/cmake/AddXdgHelpTarget.cmake | ||
index efbe20f25..f0c800f2e 100644 | ||
--- a/cmake/AddXdgHelpTarget.cmake | ||
+++ b/cmake/AddXdgHelpTarget.cmake | ||
@@ -10,7 +10,16 @@ | ||
|
||
function (add_xdghelp_target docname lang entities figures) | ||
|
||
- set(BUILD_DIR "${DATADIR_BUILD}/help/${lang}/${docname}") | ||
+ set(BUILD_DIR_BASE "${DATADIR_BUILD}/help/${lang}") | ||
+ set(BUILD_DIR "${BUILD_DIR_BASE}/${docname}") | ||
+ | ||
+ # Define location where KDE's help system looks for <doc> | ||
+ # when invoked with help:<doc> | ||
+ set(kde_lang ${lang}) | ||
+ if (lang STREQUAL "C") | ||
+ set(kde_lang "en") | ||
+ endif() | ||
+ set(BUILD_DIR_KDE_BASE "${DATADIR_BUILD}/doc/HTML") | ||
|
||
set(source_files "") | ||
foreach(xml_file ${entities} index.docbook) | ||
@@ -33,6 +42,10 @@ function (add_xdghelp_target docname lang entities figures) | ||
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/xdghelptrigger" | ||
COMMAND ${CMAKE_COMMAND} -E make_directory "${BUILD_DIR}" | ||
COMMAND ${CMAKE_COMMAND} -E make_directory "${BUILD_DIR}/figures" | ||
+ | ||
+ # Add links to make our documentation visible for KDE's help system | ||
+ COMMAND ${CMAKE_COMMAND} -E make_directory "${BUILD_DIR_KDE_BASE}" | ||
+ COMMAND ${CMAKE_COMMAND} -E create_symlink "${BUILD_DIR_BASE}" "${BUILD_DIR_KDE_BASE}/${kde_lang}" | ||
COMMAND touch "${CMAKE_CURRENT_BINARY_DIR}/xdghelptrigger") | ||
|
||
|
||
@@ -66,10 +79,19 @@ function (add_xdghelp_target docname lang entities figures) | ||
|
||
add_dependencies(${docname}-xdghelp "${lang}-${docname}-xdghelp") | ||
|
||
+ set(doc_install_dir_base "${CMAKE_INSTALL_DATADIR}/help/${lang}") | ||
+ set(doc_install_dir "${doc_install_dir_base}/${docname}") | ||
install(FILES ${source_files} | ||
- DESTINATION "${CMAKE_INSTALL_DATADIR}/help/${lang}/${docname}" | ||
+ DESTINATION "${doc_install_dir}" | ||
COMPONENT "xdghelp") | ||
install(FILES ${figures} | ||
- DESTINATION "${CMAKE_INSTALL_DATADIR}/help/${lang}/${docname}/figures" | ||
+ DESTINATION "${doc_install_dir}/figures" | ||
+ COMPONENT "xdghelp") | ||
+ | ||
+ # Add links to make our documentation visible for KDE's help system | ||
+ set(doc_install_dir_kde_base "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_DATADIR}/doc/HTML") | ||
+ install(CODE "execute_process (COMMAND ${CMAKE_COMMAND} -E make_directory \"${doc_install_dir_kde_base}\")" | ||
+ COMPONENT "xdghelp") | ||
+ install(CODE "execute_process (COMMAND ${CMAKE_COMMAND} -E create_symlink \"../../../${doc_install_dir_base}\" \"${doc_install_dir_kde_base}/${kde_lang}\")" | ||
COMPONENT "xdghelp") | ||
endfunction() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
# Copyright 1999-2023 Gentoo Authors | ||
# Distributed under the terms of the GNU General Public License v2 | ||
|
||
EAPI=8 | ||
|
||
# Please bump with app-office/gnucash | ||
|
||
CMAKE_MAKEFILE_GENERATOR=emake | ||
inherit cmake optfeature | ||
|
||
DESCRIPTION="Documentation package for GnuCash" | ||
HOMEPAGE="https://www.gnucash.org/" | ||
SRC_URI="https://github.com/Gnucash/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz" | ||
|
||
LICENSE="GPL-2 FDL-1.1" | ||
SLOT="0" | ||
KEYWORDS="~amd64 ~arm64 ~ppc ~ppc64 ~riscv ~x86" | ||
LOCALES=( de it ja pt ) | ||
IUSE="${LOCALES[*]/#/l10n_}" | ||
|
||
BDEPEND=" | ||
app-text/docbook-xml-dtd:4.5 | ||
app-text/docbook-xsl-stylesheets | ||
dev-libs/libxml2 | ||
dev-libs/libxslt | ||
" | ||
|
||
src_prepare() { | ||
eapply -R "${FILESDIR}/${P}-reverese-kde-help-dir.patch" | ||
cmake_src_prepare | ||
} | ||
|
||
src_compile() { | ||
cmake_src_compile -j1 | ||
} | ||
|
||
src_install() { | ||
local doc_type my_lang | ||
|
||
for doc_type in manual guide; do | ||
for my_lang in C ${L10N}; do | ||
[[ -z ${my_lang} ]] && continue | ||
|
||
case "${my_lang}" in | ||
# Both help and guides translated | ||
C|de|it|pt) ;; | ||
ja|ru) # Only guides translated | ||
if [[ "${doc_type}" == "manual" ]] ; then | ||
elog "Help documentation hasn't been translated for ${my_lang}" | ||
elog "Will do English instead." | ||
continue | ||
fi | ||
;; | ||
*) | ||
die "Invalid locale: ${my_lang}" | ||
;; | ||
esac | ||
|
||
emake \ | ||
-C "${BUILD_DIR}/${doc_type}/${my_lang}" \ | ||
DESTDIR="${D}" \ | ||
install | ||
done | ||
done | ||
|
||
einstalldocs | ||
} | ||
|
||
pkg_postinst() { | ||
optfeature "generating PDF files" dev-java/fop | ||
optfeature "viewing the docs" gnome-extra/yelp | ||
} |