All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Andreas Müller" <schnitzeltony@gmail.com>
To: openembedded-devel@lists.openembedded.org
Subject: [PATCH 05/19] gnome-help.bbclass: Handle gnome-help files with new distro feature 'helpfiles'
Date: Mon, 28 Oct 2019 00:35:31 +0100	[thread overview]
Message-ID: <20191027233545.4146-6-schnitzeltony@gmail.com> (raw)
In-Reply-To: <20191027233545.4146-1-schnitzeltony@gmail.com>

Now that we can build gnome help files, let our users decide what to do with
them:

if 'helpfiles' not in DISTRO_FEATURES
    delete all help contents during install
else
  if PACKAGE_NO_HELP_SPLIT == 1
      pack all help files to ${PN}-help
  else
      pack help files to ${PN}-help-<lingua>

Signed-off-by: Andreas Müller <schnitzeltony@gmail.com>
---
 meta-gnome/classes/gnome-help.bbclass | 69 +++++++++++++++++++++++++++
 1 file changed, 69 insertions(+)
 create mode 100644 meta-gnome/classes/gnome-help.bbclass

diff --git a/meta-gnome/classes/gnome-help.bbclass b/meta-gnome/classes/gnome-help.bbclass
new file mode 100644
index 000000000..967091ba4
--- /dev/null
+++ b/meta-gnome/classes/gnome-help.bbclass
@@ -0,0 +1,69 @@
+# Class to pack gnome help files or delete them during install
+# There are the following cases:
+#
+# if 'helpfiles' not in DISTRO_FEATURES
+#     delete all help contants during install
+# else
+#   if PACKAGE_NO_HELP_SPLIT == 1
+#       pack all help files to ${PN}-help
+#   else
+#       pack all help files to ${PN}-help-<lingua>
+
+FILES_${PN}-help = "${datadir}/*/translations"
+
+# Dummy to get yelp build & PACKAGE_NO_HELP_SPLIT set 1
+PACKAGES_append = " ${PN}-help"
+FILES_${PN}-help = "${datadir}/help"
+RRECOMMENDS_${PN}-help = "${@bb.utils.contains('DISTRO_FEATURES','helpfiles','yelp','',d)}"
+
+do_install_append() {
+    if ${@bb.utils.contains('DISTRO_FEATURES','helpfiles','false','true',d)}; then
+        rm -rf ${D}${datadir}/help/*
+    fi
+}
+
+python gnome_do_split_help() {
+    if bb.utils.contains('DISTRO_FEATURES', 'helpfiles', False, True, d):
+        return
+
+    if (d.getVar('PACKAGE_NO_HELP_SPLIT') == '1'):
+        # all help files go to ${
+        bb.debug(1, "package requested not splitting help-files")
+        return
+
+    packages = (d.getVar('PACKAGES') or "").split()
+    datadir = d.getVar('datadir')
+    dvar = d.getVar('PKGD')
+    pn = d.getVar('PN')
+
+    if pn + '-help' in packages:
+        packages.remove(pn + '-help')
+
+    helpdir = os.path.join(dvar + datadir, 'help')
+
+    if not cpath.isdir(helpdir):
+        bb.warn("No help files in this package - remove gnome-help from inherit?")
+        return
+
+    helps = os.listdir(helpdir)
+
+    summary = d.getVar('SUMMARY') or pn
+    description = d.getVar('DESCRIPTION') or ""
+    locale_section = d.getVar('LOCALE_SECTION')
+    mlprefix = d.getVar('MLPREFIX') or ""
+    for l in sorted(helps):
+        ln = legitimize_package_name(l)
+        pkg = pn + '-help-' + ln
+        packages.append(pkg)
+        d.setVar('FILES_' + pkg, os.path.join(datadir, 'help', l))
+        d.setVar('RRECOMMENDS_' + pkg, '%syelp' % mlprefix)
+        d.setVar('SUMMARY_' + pkg, '%s - %s help' % (summary, l))
+        d.setVar('DESCRIPTION_' + pkg, '%s  This package contains language help files for the %s locale.' % (description, l))
+        if locale_section:
+            d.setVar('SECTION_' + pkg, locale_section)
+
+    d.setVar('PACKAGES', ' '.join(packages))
+}
+
+PACKAGESPLITFUNCS_prepend = "gnome_do_split_help "
+
-- 
2.21.0



  parent reply	other threads:[~2019-10-27 23:36 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-27 23:35 [PATCH 00/19] next gnome batch Andreas Müller
2019-10-27 23:35 ` [PATCH 01/19] itstool: rework native shebang and add class to make native itstool work Andreas Müller
2019-10-27 23:35 ` [PATCH 02/19] yelp-tools: use itstools.bbclass Andreas Müller
2019-10-27 23:35 ` [PATCH 03/19] yelp-xsl: use itstool.bbclass Andreas Müller
2019-10-27 23:35 ` [PATCH 04/19] yelp: " Andreas Müller
2019-10-27 23:35 ` Andreas Müller [this message]
2019-10-27 23:35 ` [PATCH 06/19] zenity: rework recipe Andreas Müller
2019-10-27 23:35 ` [PATCH 07/19] colord: initial add 1.4.4 Andreas Müller
2019-10-28 20:08   ` Khem Raj
2019-10-28 20:50     ` Andreas Müller
2019-10-28 21:40       ` Khem Raj
2019-10-27 23:35 ` [PATCH 08/19] colord-gtk: initial add 0.2.0 Andreas Müller
2019-10-27 23:35 ` [PATCH 09/19] dconf: extend to native build for upcoming gdm Andreas Müller
2019-10-27 23:35 ` [PATCH 10/19] dconf-editor: upgrade 3.32.0 -> 3.34.0 Andreas Müller
2019-10-27 23:35 ` [PATCH 11/19] gtksourceview4: upgrade 4.2.0 -> 4.4.0 Andreas Müller
2019-10-27 23:35 ` [PATCH 12/19] gnome-menus3: upgrade 3.10.1 -> 3.32.0 Andreas Müller
2019-10-27 23:35 ` [PATCH 13/19] gnome-desktop3: upgrade 3.34.0 -> 3.34.1 Andreas Müller
2019-10-27 23:35 ` [PATCH 14/19] gnome-bluetooth: upgrade 3.32.1 -> 3.34.0 Andreas Müller
2019-10-27 23:35 ` [PATCH 15/19] glade3: upgrade 3.8.5 -> 3.8.6 Andreas Müller
2019-10-28 20:08   ` Khem Raj
2019-10-28 21:11     ` Andreas Müller
2019-10-27 23:35 ` [PATCH 16/19] gspell: upgrade 1.8.1 -> 1.8.2 Andreas Müller
2019-10-27 23:35 ` [PATCH 17/19] gnome-system-monitor: upgrade 3.32.0 -> 3.32.1 Andreas Müller
2019-10-27 23:35 ` [PATCH 18/19] network-manager-applet: upgrade 1.8.22 -> 1.8.23 / build with meson / cleanup Andreas Müller
2019-10-27 23:35 ` [PATCH 19/19] ibus: initial add 1.5.21 Andreas Müller
2019-10-27 23:59   ` Andreas Müller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191027233545.4146-6-schnitzeltony@gmail.com \
    --to=schnitzeltony@gmail.com \
    --cc=openembedded-devel@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.