[devhelp] flatpak: see books installed on the host
- From: Sébastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [devhelp] flatpak: see books installed on the host
- Date: Fri, 12 Jan 2018 20:24:59 +0000 (UTC)
commit 011f46edfce6d16860cfa2724a3174e28e622def
Author: Sébastien Wilmet <swilmet gnome org>
Date: Thu Jan 11 08:08:07 2018 +0100
flatpak: see books installed on the host
https://bugzilla.gnome.org/show_bug.cgi?id=792068
configure.ac | 11 +++++++++++
flatpak/org.gnome.Devhelp.json | 5 +++++
src/dh-book-manager.c | 21 +++++++++++++++++++++
3 files changed, 37 insertions(+), 0 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index d5bb764..087e0f8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -71,6 +71,16 @@ AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Package name for gettext
AM_PATH_PYTHON([2.3],[],[no])
+# Flatpak
+AC_ARG_ENABLE([flatpak-build],
+ [AS_HELP_STRING([--enable-flatpak-build], [Enable Flatpak build mode])],
+ [flatpak_build=${enableval}],
+ [flatpak_build=no])
+
+if test "x${flatpak_build}" = xyes; then
+ AC_DEFINE([FLATPAK_BUILD], 1, [Whether Flatpak build mode is enabled])
+fi
+
# GTK-Doc
AX_REQUIRE_DEFINED([GTK_DOC_CHECK])
GTK_DOC_CHECK([1.25],[--flavour no-tmpl])
@@ -106,4 +116,5 @@ Configuration:
Compiler: ${CC}
API documentation: ${enable_gtk_doc}
GObject introspection: ${found_introspection}
+ Flatpak build mode: ${flatpak_build}
"
diff --git a/flatpak/org.gnome.Devhelp.json b/flatpak/org.gnome.Devhelp.json
index b4190ad..5984b56 100644
--- a/flatpak/org.gnome.Devhelp.json
+++ b/flatpak/org.gnome.Devhelp.json
@@ -12,6 +12,10 @@
"--share=ipc", "--socket=x11",
/* Wayland access */
"--socket=wayland",
+ /* We want full fs access to see the API docs installed by traditional
+ * Linux distro packages.
+ */
+ "--filesystem=host:ro",
/* Needed for dconf to work */
"--filesystem=xdg-run/dconf", "--filesystem=~/.config/dconf:ro",
"--talk-name=ca.desrt.dconf", "--env=DCONF_USER_CONFIG_DIR=.config/dconf"
@@ -30,6 +34,7 @@
"modules": [
{
"name": "devhelp",
+ "config-opts": [ "--enable-flatpak-build" ],
"sources": [
{
"type": "git",
diff --git a/src/dh-book-manager.c b/src/dh-book-manager.c
index 0ed1e64..c194175 100644
--- a/src/dh-book-manager.c
+++ b/src/dh-book-manager.c
@@ -804,6 +804,27 @@ populate (DhBookManager *book_manager)
for (i = 0; system_dirs[i] != NULL; i++) {
find_books_in_data_dir (book_manager, system_dirs[i]);
}
+
+ /* For Flatpak, to see the books installed on the host by traditional
+ * Linux distro packages.
+ *
+ * It is not a good idea to add the directory to XDG_DATA_DIRS, see:
+ * https://github.com/flatpak/flatpak/issues/1299
+ * "all sorts of things will break if we add all host config to each
+ * app, which is totally opposite to the entire point of flatpak."
+ * "i don't think XDG_DATA_DIRS is the right thing, because all sorts of
+ * libraries will start reading files from there, like dconf, dbus,
+ * service files, mimetypes, etc. It would be preferable to have
+ * something that targeted just gtk-doc files."
+ *
+ * So instead of adapting XDG_DATA_DIRS, add the directory here, with
+ * the path hard-coded.
+ *
+ * https://bugzilla.gnome.org/show_bug.cgi?id=792068
+ */
+#ifdef FLATPAK_BUILD
+ find_books_in_data_dir (book_manager, "/run/host/usr/share");
+#endif
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]