All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH][v2 00/10] Make MIME work on desktops
@ 2020-01-17 21:28 Andreas Müller
  2020-01-17 21:28 ` [PATCH][v2 01/10] itstool: add from meta-oe Andreas Müller
                   ` (11 more replies)
  0 siblings, 12 replies; 16+ messages in thread
From: Andreas Müller @ 2020-01-17 21:28 UTC (permalink / raw)
  To: openembedded-core

On fresh images file-browsers do not know how to open files and usually open a
dialog with ALL applications available on the machine. This is not what users
are used to when working with linux: For just one application installed per
Mime-Type, the application is opened automatically.

To get a working MIME on desktop it needs two 'databases' on target:

1. Mime-Types: This is handled by mime.bbclass and creates database in
   /usr/share/mime/mime.cache.
2. Mime associations: A simple text-list of pairs Mime-Type <-> application
   in /usr/share/applications/mimeinfo.cache

This patch series updates/implements/enhances both parts to get images work as
expected.

@Khem: This series creates many QA warnings for layers in meta-openembedded and
a patch series fixing many was prepared [1]. Once this series get's applied (or
you ask for it) I can send them out.

[1] https://github.com/schnitzeltony/meta-openembedded/tree/work-2020-01

V1 -> V2:
* Shelve global path export thingy
* Add me as maintainer of itstool (let's consider 'ü' in my name as test case :)
* Change "to to" to "to" in commit message
* Build shared-mime-info from git to allow automated upgrades
* mime-xdg.bbclass: Be prepared for packages as libreoffice: Desktop files
  installed are absolut symlinks broken for us. In case other projects do same: 
  Offer asolution and guide recipe writers how to handle by generating warnings
  with instructions how to handle.

Andreas Müller (10):
  itstool: add from meta-oe
  itstool: extend to nativesdk
  shared-mime-info: upgrade 1.10 -> 1.15
  mime.bbclass: rework
  insane.bbclass: introduce a warning for mime missing in inherit
  shared-mime-info: add mime to inherit
  gcr: add mime to inherit
  mime-xdg.bbclass: initial add
  insane.bbclass: Spawn warning for missing mime-xdg in inherit
  gcr: add mime-xdg to inherit

 meta/classes/insane.bbclass                   | 41 ++++++++++
 meta/classes/mime-xdg.bbclass                 | 74 +++++++++++++++++++
 meta/classes/mime.bbclass                     | 62 ++++++++--------
 meta/conf/distro/include/maintainers.inc      |  1 +
 meta/recipes-gnome/gcr/gcr_3.34.0.bb          |  2 +-
 ...-build-time-hardcoded-python-binary-.patch | 35 +++++++++
 ...ld-time-hardcoded-python-binary-path.patch | 29 ++++++++
 meta/recipes-support/itstool/itstool_2.0.6.bb | 21 ++++++
 .../shared-mime-info/install-data-hook.patch  | 25 -------
 .../shared-mime-info/parallelmake.patch       | 33 ---------
 .../shared-mime-info/shared-mime-info_1.10.bb |  7 --
 ...-mime-info.inc => shared-mime-info_git.bb} |  9 ++-
 .../update_desktop_database                   |  8 ++
 .../postinst-intercepts/update_mime_database  |  9 +++
 14 files changed, 257 insertions(+), 99 deletions(-)
 create mode 100644 meta/classes/mime-xdg.bbclass
 create mode 100644 meta/recipes-support/itstool/itstool/0001-Native-Don-t-use-build-time-hardcoded-python-binary-.patch
 create mode 100644 meta/recipes-support/itstool/itstool/0002-Don-t-use-build-time-hardcoded-python-binary-path.patch
 create mode 100644 meta/recipes-support/itstool/itstool_2.0.6.bb
 delete mode 100644 meta/recipes-support/shared-mime-info/shared-mime-info/install-data-hook.patch
 delete mode 100644 meta/recipes-support/shared-mime-info/shared-mime-info/parallelmake.patch
 delete mode 100644 meta/recipes-support/shared-mime-info/shared-mime-info_1.10.bb
 rename meta/recipes-support/shared-mime-info/{shared-mime-info.inc => shared-mime-info_git.bb} (75%)
 create mode 100644 scripts/postinst-intercepts/update_desktop_database
 create mode 100644 scripts/postinst-intercepts/update_mime_database

-- 
2.21.0



^ permalink raw reply	[flat|nested] 16+ messages in thread

* [PATCH][v2 01/10] itstool: add from meta-oe
  2020-01-17 21:28 [PATCH][v2 00/10] Make MIME work on desktops Andreas Müller
@ 2020-01-17 21:28 ` Andreas Müller
  2020-01-17 21:29 ` [PATCH][v2 02/10] itstool: extend to nativesdk Andreas Müller
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 16+ messages in thread
From: Andreas Müller @ 2020-01-17 21:28 UTC (permalink / raw)
  To: openembedded-core

Recent versions of shared-mime-info depend on itstool

Signed-off-by: Andreas Müller <schnitzeltony@gmail.com>
---
 meta/conf/distro/include/maintainers.inc      |  1 +
 ...-build-time-hardcoded-python-binary-.patch | 35 +++++++++++++++++++
 ...ld-time-hardcoded-python-binary-path.patch | 29 +++++++++++++++
 meta/recipes-support/itstool/itstool_2.0.6.bb | 20 +++++++++++
 4 files changed, 85 insertions(+)
 create mode 100644 meta/recipes-support/itstool/itstool/0001-Native-Don-t-use-build-time-hardcoded-python-binary-.patch
 create mode 100644 meta/recipes-support/itstool/itstool/0002-Don-t-use-build-time-hardcoded-python-binary-path.patch
 create mode 100644 meta/recipes-support/itstool/itstool_2.0.6.bb

diff --git a/meta/conf/distro/include/maintainers.inc b/meta/conf/distro/include/maintainers.inc
index 7d47677d3b..ffb6da7dae 100644
--- a/meta/conf/distro/include/maintainers.inc
+++ b/meta/conf/distro/include/maintainers.inc
@@ -281,6 +281,7 @@ RECIPE_MAINTAINER_pn-iproute2 = "Changhyeok Bae <changhyeok.bae@gmail.com>"
 RECIPE_MAINTAINER_pn-iptables = "Changhyeok Bae <changhyeok.bae@gmail.com>"
 RECIPE_MAINTAINER_pn-iputils = "Changhyeok Bae <changhyeok.bae@gmail.com>"
 RECIPE_MAINTAINER_pn-iso-codes = "Alexander Kanavin <alex.kanavin@gmail.com>"
+RECIPE_MAINTAINER_pn-itstool = "Andreas Müller <schnitzeltony@gmail.com>"
 RECIPE_MAINTAINER_pn-iw = "Changhyeok Bae <changhyeok.bae@gmail.com>"
 RECIPE_MAINTAINER_pn-libjpeg-turbo = "Anuj Mittal <anuj.mittal@intel.com>"
 RECIPE_MAINTAINER_pn-json-c = "Yi Zhao <yi.zhao@windriver.com>"
diff --git a/meta/recipes-support/itstool/itstool/0001-Native-Don-t-use-build-time-hardcoded-python-binary-.patch b/meta/recipes-support/itstool/itstool/0001-Native-Don-t-use-build-time-hardcoded-python-binary-.patch
new file mode 100644
index 0000000000..19a858bd75
--- /dev/null
+++ b/meta/recipes-support/itstool/itstool/0001-Native-Don-t-use-build-time-hardcoded-python-binary-.patch
@@ -0,0 +1,35 @@
+From 335ef14fc801c9dfbe7e5692dc71cfbe72049d2b Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@gmail.com>
+Date: Sun, 27 Oct 2019 16:38:52 +0100
+Subject: [PATCH] Native: Don't use build time hardcoded python binary path.
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+This is same patch as used for target build except that we do not use the
+'-S' and '-s' option because '-S' is relatively young [1] and elder build-host
+don't support it [2]
+
+[1] https://github.com/coreutils/coreutils/commit/668306ed86c8c79b0af0db8b9c882654ebb66db2#diff-83d9d52b1f12ac589739ab1334ae4f30
+[2] https://errors.yoctoproject.org/Errors/Details/274743/
+
+Upstream-Status: Inappropriate [OE specific]
+
+Signed-off-by: Andreas Müller <schnitzeltony@gmail.com>
+---
+ itstool.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/itstool.in b/itstool.in
+index e64cd34..05d264f 100755
+--- a/itstool.in
++++ b/itstool.in
+@@ -1,4 +1,4 @@
+-#!@PYTHON@ -s
++#!/usr/bin/env python3
+ #
+ # Copyright (c) 2010-2018 Shaun McCance <shaunm@gnome.org>
+ #
+-- 
+2.21.0
+
diff --git a/meta/recipes-support/itstool/itstool/0002-Don-t-use-build-time-hardcoded-python-binary-path.patch b/meta/recipes-support/itstool/itstool/0002-Don-t-use-build-time-hardcoded-python-binary-path.patch
new file mode 100644
index 0000000000..b91105330c
--- /dev/null
+++ b/meta/recipes-support/itstool/itstool/0002-Don-t-use-build-time-hardcoded-python-binary-path.patch
@@ -0,0 +1,29 @@
+From cd9b56224895576125e91cca317ace8a80f3eb77 Mon Sep 17 00:00:00 2001
+From: Piotr Tworek <tworaz@tworaz.net>
+Date: Sat, 27 Jul 2019 10:19:11 +0200
+Subject: [PATCH] Don't use build time hardcoded python binary path.
+
+This path obviously won't work on target since they refer to build
+machine directory structure. Native builds will also fail if local.conf
+has INHERIT+=rm_work. Instread of hardcoding path to python binary use
+whatever is found in PATH first. This should also allow the tool to use
+python3 binary provided in recipe-sysroot-native.
+
+Upstream-Status: Inappropriate [OE specific]
+---
+ itstool.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/itstool.in b/itstool.in
+index b3c0033..7df2476 100755
+--- a/itstool.in
++++ b/itstool.in
+@@ -1,4 +1,4 @@
+-#!@PYTHON@ -s
++#!/usr/bin/env -S python3 -s
+ #
+ # Copyright (c) 2010-2018 Shaun McCance <shaunm@gnome.org>
+ #
+--
+2.21.0
+
diff --git a/meta/recipes-support/itstool/itstool_2.0.6.bb b/meta/recipes-support/itstool/itstool_2.0.6.bb
new file mode 100644
index 0000000000..8290c5e581
--- /dev/null
+++ b/meta/recipes-support/itstool/itstool_2.0.6.bb
@@ -0,0 +1,20 @@
+SUMMARY = "ITS Tool allows you to translate your XML documents with PO files"
+HOMEPAGE = "http://itstool.org/"
+LICENSE = "GPLv3"
+LIC_FILES_CHKSUM = "file://COPYING;md5=59c57b95fd7d0e9e238ebbc7ad47c5a5"
+
+inherit autotools python3native
+
+DEPENDS = "libxml2-native"
+
+SRC_URI = "http://files.itstool.org/${BPN}/${BPN}-${PV}.tar.bz2"
+SRC_URI_append_class-native = " file://0001-Native-Don-t-use-build-time-hardcoded-python-binary-.patch"
+SRC_URI_append_class-target = " file://0002-Don-t-use-build-time-hardcoded-python-binary-path.patch"
+
+SRC_URI[md5sum] = "4306eeba4f4aee6b393d14f9c3c57ca1"
+SRC_URI[sha256sum] = "6233cc22726a9a5a83664bf67d1af79549a298c23185d926c3677afa917b92a9"
+
+BBCLASSEXTEND = "native"
+
+RDEPENDS_${PN} += "libxml2-python"
+RDEPENDS_${PN}_class-native = ""
-- 
2.21.0



^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH][v2 02/10] itstool: extend to nativesdk
  2020-01-17 21:28 [PATCH][v2 00/10] Make MIME work on desktops Andreas Müller
  2020-01-17 21:28 ` [PATCH][v2 01/10] itstool: add from meta-oe Andreas Müller
@ 2020-01-17 21:29 ` Andreas Müller
  2020-01-17 21:29 ` [PATCH][v2 03/10] shared-mime-info: upgrade 1.10 -> 1.15 Andreas Müller
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 16+ messages in thread
From: Andreas Müller @ 2020-01-17 21:29 UTC (permalink / raw)
  To: openembedded-core

This was not done in meta-oe but shared-mime-info extends to nativesdk either.

Signed-off-by: Andreas Müller <schnitzeltony@gmail.com>
---
 meta/recipes-support/itstool/itstool_2.0.6.bb | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/meta/recipes-support/itstool/itstool_2.0.6.bb b/meta/recipes-support/itstool/itstool_2.0.6.bb
index 8290c5e581..5f358f463d 100644
--- a/meta/recipes-support/itstool/itstool_2.0.6.bb
+++ b/meta/recipes-support/itstool/itstool_2.0.6.bb
@@ -9,12 +9,13 @@ DEPENDS = "libxml2-native"
 
 SRC_URI = "http://files.itstool.org/${BPN}/${BPN}-${PV}.tar.bz2"
 SRC_URI_append_class-native = " file://0001-Native-Don-t-use-build-time-hardcoded-python-binary-.patch"
+SRC_URI_append_class-nativesdk = " file://0001-Native-Don-t-use-build-time-hardcoded-python-binary-.patch"
 SRC_URI_append_class-target = " file://0002-Don-t-use-build-time-hardcoded-python-binary-path.patch"
 
 SRC_URI[md5sum] = "4306eeba4f4aee6b393d14f9c3c57ca1"
 SRC_URI[sha256sum] = "6233cc22726a9a5a83664bf67d1af79549a298c23185d926c3677afa917b92a9"
 
-BBCLASSEXTEND = "native"
+BBCLASSEXTEND = "native nativesdk"
 
 RDEPENDS_${PN} += "libxml2-python"
 RDEPENDS_${PN}_class-native = ""
-- 
2.21.0



^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH][v2 03/10] shared-mime-info: upgrade 1.10 -> 1.15
  2020-01-17 21:28 [PATCH][v2 00/10] Make MIME work on desktops Andreas Müller
  2020-01-17 21:28 ` [PATCH][v2 01/10] itstool: add from meta-oe Andreas Müller
  2020-01-17 21:29 ` [PATCH][v2 02/10] itstool: extend to nativesdk Andreas Müller
@ 2020-01-17 21:29 ` Andreas Müller
  2020-01-17 21:29 ` [PATCH][v2 04/10] mime.bbclass: rework Andreas Müller
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 16+ messages in thread
From: Andreas Müller @ 2020-01-17 21:29 UTC (permalink / raw)
  To: openembedded-core

* sources/development moved to freedesktop's gitlab
* patches do not apply any more due to major changes in Makefile.am
* give up bb/inc separation

Signed-off-by: Andreas Müller <schnitzeltony@gmail.com>
---
 .../shared-mime-info/install-data-hook.patch  | 25 --------------
 .../shared-mime-info/parallelmake.patch       | 33 -------------------
 .../shared-mime-info/shared-mime-info_1.10.bb |  7 ----
 ...-mime-info.inc => shared-mime-info_git.bb} |  9 +++--
 4 files changed, 6 insertions(+), 68 deletions(-)
 delete mode 100644 meta/recipes-support/shared-mime-info/shared-mime-info/install-data-hook.patch
 delete mode 100644 meta/recipes-support/shared-mime-info/shared-mime-info/parallelmake.patch
 delete mode 100644 meta/recipes-support/shared-mime-info/shared-mime-info_1.10.bb
 rename meta/recipes-support/shared-mime-info/{shared-mime-info.inc => shared-mime-info_git.bb} (75%)

diff --git a/meta/recipes-support/shared-mime-info/shared-mime-info/install-data-hook.patch b/meta/recipes-support/shared-mime-info/shared-mime-info/install-data-hook.patch
deleted file mode 100644
index 262ff7562c..0000000000
--- a/meta/recipes-support/shared-mime-info/shared-mime-info/install-data-hook.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-fix shared-mime-info build race condition
-
-The definition of install-data-hook in Makefile.am leads
-to multiple, overlapping, executions of install-binPROGRAMS
-target.  We modify the definition to avoid that.
-
-Upstream-Status: Pending
-
-Signed-off-by: Joe Slater <jslater@windriver.com>
-
-Index: shared-mime-info-1.9/Makefile.am
-===================================================================
---- shared-mime-info-1.9.orig/Makefile.am
-+++ shared-mime-info-1.9/Makefile.am
-@@ -50,7 +50,9 @@ else
-   update_mime_database="$(top_builddir)/update-mime-database$(EXEEXT)"
- endif
- 
--install-data-hook: install-binPROGRAMS
-+# do NOT make this dependent on anything!
-+#
-+install-data-hook:
- if ENABLE_UPDATE_MIMEDB
- 	$(update_mime_database) -V "$(DESTDIR)$(datadir)/mime"
- endif
diff --git a/meta/recipes-support/shared-mime-info/shared-mime-info/parallelmake.patch b/meta/recipes-support/shared-mime-info/shared-mime-info/parallelmake.patch
deleted file mode 100644
index fea34a55a2..0000000000
--- a/meta/recipes-support/shared-mime-info/shared-mime-info/parallelmake.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-The Makefile used by shared-mime-info is one big race with the SUBDIRS 
-option and the dependency specifically calling make all combining to
-create multiple make instances all of which may try and build targets
-like update-mime-database.
-
-This patch removes those options meaning make can correctly identify
-dependencies and stop itself racing itself.
-
-RP 10/10/2011
-
-Upstream-Status: Pending
-Signed-off-by: Constantin Musca <constantinx.musca@intel.com>
-
-Index: shared-mime-info-1.9/Makefile.am
-===================================================================
---- shared-mime-info-1.9.orig/Makefile.am
-+++ shared-mime-info-1.9/Makefile.am
-@@ -1,5 +1,3 @@
--SUBDIRS=. po
--
- AM_CPPFLAGS = $(ALL_CFLAGS)
- 
- packagesdir = $(datadir)/mime/packages
-@@ -81,8 +79,7 @@ endif
- 
- all: $(defaultmakedeps)
- 
--create-pot:
--	$(AM_V_GEN) $(MAKE) -C po shared-mime-info.pot
-+create-pot: po
- 
- local-test: create-pot freedesktop.org.xml update-mime-database$(EXEEXT)
- if CROSS_COMPILING
diff --git a/meta/recipes-support/shared-mime-info/shared-mime-info_1.10.bb b/meta/recipes-support/shared-mime-info/shared-mime-info_1.10.bb
deleted file mode 100644
index 9fc210b718..0000000000
--- a/meta/recipes-support/shared-mime-info/shared-mime-info_1.10.bb
+++ /dev/null
@@ -1,7 +0,0 @@
-require shared-mime-info.inc
-
-SRC_URI += "file://parallelmake.patch \
-	    file://install-data-hook.patch"
-
-SRC_URI[md5sum] = "418c2ced9dc4dd5ca8b06a755e6d64e9"
-SRC_URI[sha256sum] = "c625a83b4838befc8cafcd54e3619946515d9e44d63d61c4adf7f5513ddfbebf"
diff --git a/meta/recipes-support/shared-mime-info/shared-mime-info.inc b/meta/recipes-support/shared-mime-info/shared-mime-info_git.bb
similarity index 75%
rename from meta/recipes-support/shared-mime-info/shared-mime-info.inc
rename to meta/recipes-support/shared-mime-info/shared-mime-info_git.bb
index 3fe1a445b0..bf48e453a0 100644
--- a/meta/recipes-support/shared-mime-info/shared-mime-info.inc
+++ b/meta/recipes-support/shared-mime-info/shared-mime-info_git.bb
@@ -5,11 +5,14 @@ SECTION = "base"
 LICENSE = "GPLv2"
 LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
 
-DEPENDS = "libxml2 intltool-native glib-2.0 shared-mime-info-native"
+DEPENDS = "libxml2 itstool glib-2.0 shared-mime-info-native"
 
-SRC_URI = "http://freedesktop.org/~hadess/shared-mime-info-${PV}.tar.xz"
+SRC_URI = "git://gitlab.freedesktop.org/xdg/shared-mime-info.git;protocol=https"
+SRCREV = "829b26d85e7d89a0caee03046c3bce373f04c80a"
+PV = "1.15"
+S = "${WORKDIR}/git"
 
-inherit autotools pkgconfig gettext
+inherit autotools pkgconfig gettext python3native
 
 EXTRA_OECONF = "--disable-update-mimedb"
 
-- 
2.21.0



^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH][v2 04/10] mime.bbclass: rework
  2020-01-17 21:28 [PATCH][v2 00/10] Make MIME work on desktops Andreas Müller
                   ` (2 preceding siblings ...)
  2020-01-17 21:29 ` [PATCH][v2 03/10] shared-mime-info: upgrade 1.10 -> 1.15 Andreas Müller
@ 2020-01-17 21:29 ` Andreas Müller
  2020-01-17 21:29 ` [PATCH][v2 05/10] insane.bbclass: introduce a warning for mime missing in inherit Andreas Müller
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 16+ messages in thread
From: Andreas Müller @ 2020-01-17 21:29 UTC (permalink / raw)
  To: openembedded-core

* add a short descriptions of class' use case
* remove checks for update-mime-database - it can be considered available:
  * at build time by PACKAGE_WRITE_DEPS
  * at package upgrade by RDEPENDS chain
    pkg -> shared-mime-info-data -> shared-mime-info
* simplify (accelerate?) xml file extension detection
* run update-mime-database once only at image creation to avoid expensive
  redundant operations
* allow shared-mime-info to inherit mime.bbclass by avoiding circular
  dependencies

Signed-off-by: Andreas Müller <schnitzeltony@gmail.com>
---
 meta/classes/mime.bbclass                     | 62 ++++++++++---------
 .../postinst-intercepts/update_mime_database  |  9 +++
 2 files changed, 41 insertions(+), 30 deletions(-)
 create mode 100644 scripts/postinst-intercepts/update_mime_database

diff --git a/meta/classes/mime.bbclass b/meta/classes/mime.bbclass
index 6c7b868f79..c9072adf3b 100644
--- a/meta/classes/mime.bbclass
+++ b/meta/classes/mime.bbclass
@@ -1,46 +1,47 @@
-DEPENDS += "shared-mime-info"
+#
+# This class is used by recipes installing mime types
+#
+
+DEPENDS += "${@bb.utils.contains('BPN', 'shared-mime-info', '', 'shared-mime-info', d)}"
 PACKAGE_WRITE_DEPS += "shared-mime-info-native"
+MIMEDIR = "${datadir}/mime"
 
 mime_postinst() {
-if [ "$1" = configure ]; then
-	UPDATEMIMEDB=`which update-mime-database`
-	if [ -x "$UPDATEMIMEDB" ] ; then
-		echo "Updating MIME database... this may take a while."
-		$UPDATEMIMEDB $D${datadir}/mime
-	else
-		echo "Missing update-mime-database, update of mime database failed!"
-		exit 1
-	fi
+if [ "x$D" != "x" ]; then
+	$INTERCEPT_DIR/postinst_intercept update_mime_database ${PKG} \
+		mlprefix=${MLPREFIX} \
+		mimedir=${MIMEDIR}
+else
+	echo "Updating MIME database... this may take a while."
+	update-mime-database $D${MIMEDIR}
 fi
 }
 
 mime_postrm() {
-if [ "$1" = remove ] || [ "$1" = upgrade ]; then
-	UPDATEMIMEDB=`which update-mime-database`
-	if [ -x "$UPDATEMIMEDB" ] ; then
-		echo "Updating MIME database... this may take a while."
-		$UPDATEMIMEDB $D${datadir}/mime
-	else
-		echo "Missing update-mime-database, update of mime database failed!"
-		exit 1
-	fi
+if [ "x$D" != "x" ]; then
+	$INTERCEPT_DIR/postinst_intercept update_mime_database ${PKG} \
+		mlprefix=${MLPREFIX} \
+		mimedir=${MIMEDIR}
+else
+	echo "Updating MIME database... this may take a while."
+	update-mime-database $D${MIMEDIR}
 fi
 }
 
 python populate_packages_append () {
-    import re
     packages = d.getVar('PACKAGES').split()
     pkgdest =  d.getVar('PKGDEST')
+    mimedir = d.getVar('MIMEDIR')
 
     for pkg in packages:
-        mime_dir = '%s/%s/usr/share/mime/packages' % (pkgdest, pkg)
-        mimes = []
-        mime_re = re.compile(".*\.xml$")
-        if os.path.exists(mime_dir):
-            for f in os.listdir(mime_dir):
-                if mime_re.match(f):
-                    mimes.append(f)
-        if mimes:
+        mime_packages_dir = '%s/%s%s/packages' % (pkgdest, pkg, mimedir)
+        mimes_types_found = False
+        if os.path.exists(mime_packages_dir):
+            for f in os.listdir(mime_packages_dir):
+                if f.endswith('.xml'):
+                    mimes_types_found = True
+                    break
+        if mimes_types_found:
             bb.note("adding mime postinst and postrm scripts to %s" % pkg)
             postinst = d.getVar('pkg_postinst_%s' % pkg)
             if not postinst:
@@ -52,6 +53,7 @@ python populate_packages_append () {
                 postrm = '#!/bin/sh\n'
             postrm += d.getVar('mime_postrm')
             d.setVar('pkg_postrm_%s' % pkg, postrm)
-            bb.note("adding shared-mime-info-data dependency to %s" % pkg)
-            d.appendVar('RDEPENDS_' + pkg, " " + d.getVar('MLPREFIX')+"shared-mime-info-data")
+            if pkg != 'shared-mime-info-data':
+                bb.note("adding shared-mime-info-data dependency to %s" % pkg)
+                d.appendVar('RDEPENDS_' + pkg, " " + d.getVar('MLPREFIX')+"shared-mime-info-data")
 }
diff --git a/scripts/postinst-intercepts/update_mime_database b/scripts/postinst-intercepts/update_mime_database
new file mode 100644
index 0000000000..582d1e162c
--- /dev/null
+++ b/scripts/postinst-intercepts/update_mime_database
@@ -0,0 +1,9 @@
+#!/bin/sh
+#
+# SPDX-License-Identifier: MIT
+#
+# Post-install intercept for mime.bbclass
+
+echo "Updating MIME database... this may take a while."
+update-mime-database $D${mimedir}
+
-- 
2.21.0



^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH][v2 05/10] insane.bbclass: introduce a warning for mime missing in inherit
  2020-01-17 21:28 [PATCH][v2 00/10] Make MIME work on desktops Andreas Müller
                   ` (3 preceding siblings ...)
  2020-01-17 21:29 ` [PATCH][v2 04/10] mime.bbclass: rework Andreas Müller
@ 2020-01-17 21:29 ` Andreas Müller
  2020-01-17 21:29 ` [PATCH][v2 06/10] shared-mime-info: add mime to inherit Andreas Müller
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 16+ messages in thread
From: Andreas Müller @ 2020-01-17 21:29 UTC (permalink / raw)
  To: openembedded-core

* looking through layers it looks that usage of mime.bbclass is somewhat
  orphaned
* now that update-mime-database is called once only at image creation time,
  costs of mime.bbclass are limited

Signed-off-by: Andreas Müller <schnitzeltony@gmail.com>
---
 meta/classes/insane.bbclass | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass
index 723348fc8e..a2d9318276 100644
--- a/meta/classes/insane.bbclass
+++ b/meta/classes/insane.bbclass
@@ -28,6 +28,7 @@ WARN_QA ?= "ldflags useless-rpaths rpaths staticdev libdir xorg-driver-abi \
             pn-overrides infodir build-deps src-uri-bad \
             unknown-configure-option symlink-to-sysroot multilib \
             invalid-packageconfig host-user-contaminated uppercase-pn patch-fuzz \
+            mime \
             "
 ERROR_QA ?= "dev-so debug-deps dev-deps debug-files arch pkgconfig la \
             perms dep-cmp pkgvarcheck perm-config perm-line perm-link \
@@ -185,6 +186,17 @@ def package_qa_check_staticdev(path, name, d, elf, messages):
         package_qa_add_message(messages, "staticdev", "non -staticdev package contains static .a library: %s path '%s'" % \
                  (name, package_qa_clean_path(path,d)))
 
+QAPATHTEST[mime] = "package_qa_check_mime"
+def package_qa_check_mime(path, name, d, elf, messages):
+    """
+    Check if package installs mime types to /usr/share/mime/packages
+    while no inheriting mime.bbclass
+    """
+
+    if d.getVar("datadir") + "/mime/packages" in path and path.endswith('.xml') and not bb.data.inherits_class("mime", d):
+        package_qa_add_message(messages, "mime", "package contains mime types but does not inhert mime: %s path '%s'" % \
+                 (name, package_qa_clean_path(path,d)))
+
 def package_qa_check_libdir(d):
     """
     Check for wrong library installation paths. For instance, catch
-- 
2.21.0



^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH][v2 06/10] shared-mime-info: add mime to inherit
  2020-01-17 21:28 [PATCH][v2 00/10] Make MIME work on desktops Andreas Müller
                   ` (4 preceding siblings ...)
  2020-01-17 21:29 ` [PATCH][v2 05/10] insane.bbclass: introduce a warning for mime missing in inherit Andreas Müller
@ 2020-01-17 21:29 ` Andreas Müller
  2020-01-17 21:29 ` [PATCH][v2 07/10] gcr: " Andreas Müller
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 16+ messages in thread
From: Andreas Müller @ 2020-01-17 21:29 UTC (permalink / raw)
  To: openembedded-core

shared-mime-info-data: is the base for mime database

Signed-off-by: Andreas Müller <schnitzeltony@gmail.com>
---
 meta/recipes-support/shared-mime-info/shared-mime-info_git.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/recipes-support/shared-mime-info/shared-mime-info_git.bb b/meta/recipes-support/shared-mime-info/shared-mime-info_git.bb
index bf48e453a0..b2d562157b 100644
--- a/meta/recipes-support/shared-mime-info/shared-mime-info_git.bb
+++ b/meta/recipes-support/shared-mime-info/shared-mime-info_git.bb
@@ -12,7 +12,7 @@ SRCREV = "829b26d85e7d89a0caee03046c3bce373f04c80a"
 PV = "1.15"
 S = "${WORKDIR}/git"
 
-inherit autotools pkgconfig gettext python3native
+inherit autotools pkgconfig gettext python3native mime
 
 EXTRA_OECONF = "--disable-update-mimedb"
 
-- 
2.21.0



^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH][v2 07/10] gcr: add mime to inherit
  2020-01-17 21:28 [PATCH][v2 00/10] Make MIME work on desktops Andreas Müller
                   ` (5 preceding siblings ...)
  2020-01-17 21:29 ` [PATCH][v2 06/10] shared-mime-info: add mime to inherit Andreas Müller
@ 2020-01-17 21:29 ` Andreas Müller
  2020-01-17 21:29 ` [PATCH][v2 08/10] mime-xdg.bbclass: initial add Andreas Müller
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 16+ messages in thread
From: Andreas Müller @ 2020-01-17 21:29 UTC (permalink / raw)
  To: openembedded-core

gcr installs mime types we want in our mime-database

Signed-off-by: Andreas Müller <schnitzeltony@gmail.com>
---
 meta/recipes-gnome/gcr/gcr_3.34.0.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/recipes-gnome/gcr/gcr_3.34.0.bb b/meta/recipes-gnome/gcr/gcr_3.34.0.bb
index e3e8999635..272112dd12 100644
--- a/meta/recipes-gnome/gcr/gcr_3.34.0.bb
+++ b/meta/recipes-gnome/gcr/gcr_3.34.0.bb
@@ -11,7 +11,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=55ca817ccb7d5b5b66355690e9abc605"
 DEPENDS = "gtk+3 p11-kit glib-2.0 libgcrypt \
            ${@bb.utils.contains('GI_DATA_ENABLED', 'True', 'libxslt-native', '', d)}"
 
-inherit gnomebase gtk-icon-cache gtk-doc features_check upstream-version-is-even vala gobject-introspection gettext
+inherit gnomebase gtk-icon-cache gtk-doc features_check upstream-version-is-even vala gobject-introspection gettext mime
 # depends on gtk+3, but also x11 through gtk+-x11
 REQUIRED_DISTRO_FEATURES = "x11"
 
-- 
2.21.0



^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH][v2 08/10] mime-xdg.bbclass: initial add
  2020-01-17 21:28 [PATCH][v2 00/10] Make MIME work on desktops Andreas Müller
                   ` (6 preceding siblings ...)
  2020-01-17 21:29 ` [PATCH][v2 07/10] gcr: " Andreas Müller
@ 2020-01-17 21:29 ` Andreas Müller
  2020-01-17 21:29 ` [PATCH][v2 09/10] insane.bbclass: Spawn warning for missing mime-xdg in inherit Andreas Müller
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 16+ messages in thread
From: Andreas Müller @ 2020-01-17 21:29 UTC (permalink / raw)
  To: openembedded-core

When opening files by file-browsers on fresh images, user has to choose the
application to open from the pool af ALL known applications even those not
designed to open the file selected. By inheriting this classs in recipes the
assosiations in /usr/share/applications/mimeinfo.cache are build by calling
update-desktop-database.

Signed-off-by: Andreas Müller <schnitzeltony@gmail.com>
---
 meta/classes/mime-xdg.bbclass                 | 74 +++++++++++++++++++
 .../update_desktop_database                   |  8 ++
 2 files changed, 82 insertions(+)
 create mode 100644 meta/classes/mime-xdg.bbclass
 create mode 100644 scripts/postinst-intercepts/update_desktop_database

diff --git a/meta/classes/mime-xdg.bbclass b/meta/classes/mime-xdg.bbclass
new file mode 100644
index 0000000000..63169e990d
--- /dev/null
+++ b/meta/classes/mime-xdg.bbclass
@@ -0,0 +1,74 @@
+#
+# This class creates mime <-> application associations based on entry 
+# 'MimeType' in *.desktop files
+#
+
+DEPENDS += "desktop-file-utils"
+PACKAGE_WRITE_DEPS += "desktop-file-utils-native"
+DESKTOPDIR = "${datadir}/applications"
+
+# There are recipes out there installing their .desktop files as absolute
+# symlinks. For us these are dangling and cannot be introspected for "MymeType"
+# easily. By addding package-names to MIME_XDG_PACKAGES, packager can force
+# proper update-desktop-database handling. Note that all introspection is
+# skipped for MIME_XDG_PACKAGES not empty
+MIME_XDG_PACKAGES ?= ""
+
+mime_xdg_postinst() {
+if [ "x$D" != "x" ]; then
+	$INTERCEPT_DIR/postinst_intercept update_desktop_database ${PKG} \
+		mlprefix=${MLPREFIX} \
+		desktop_dir=${DESKTOPDIR}
+else
+	update-desktop-database $D${DESKTOPDIR}
+fi
+}
+
+mime_xdg_postrm() {
+if [ "x$D" != "x" ]; then
+	$INTERCEPT_DIR/postinst_intercept update_desktop_database ${PKG} \
+		mlprefix=${MLPREFIX} \
+		desktop_dir=${DESKTOPDIR}
+else
+	update-desktop-database $D${DESKTOPDIR}
+fi
+}
+
+python populate_packages_append () {
+    packages = d.getVar('PACKAGES').split()
+    pkgdest =  d.getVar('PKGDEST')
+    desktop_base = d.getVar('DESKTOPDIR')
+    forced_mime_xdg_pkgs = (d.getVar('MIME_XDG_PACKAGES') or '').split()
+
+    for pkg in packages:
+        desktops_with_mime_found = pkg in forced_mime_xdg_pkgs
+        if d.getVar('MIME_XDG_PACKAGES') == '':
+            desktop_dir = '%s/%s%s' % (pkgdest, pkg, desktop_base)
+            if os.path.exists(desktop_dir):
+                for df in os.listdir(desktop_dir):
+                    if df.endswith('.desktop'):
+                        try:
+                            with open(desktop_dir + '/'+ df, 'r') as f:
+                                for line in f.read().split('\n'):
+                                    if 'MimeType' in line:
+                                        desktops_with_mime_found = True
+                                        break;
+                        except:
+                            bb.warn('Could not open %s. Set MIME_XDG_PACKAGES in recipe or add mime-xdg to INSANE_SKIP.' % desktop_dir + '/'+ df)
+                    if desktops_with_mime_found:
+                        break
+        if desktops_with_mime_found:
+            bb.note("adding mime-xdg postinst and postrm scripts to %s" % pkg)
+            postinst = d.getVar('pkg_postinst_%s' % pkg)
+            if not postinst:
+                postinst = '#!/bin/sh\n'
+            postinst += d.getVar('mime_xdg_postinst')
+            d.setVar('pkg_postinst_%s' % pkg, postinst)
+            postrm = d.getVar('pkg_postrm_%s' % pkg)
+            if not postrm:
+                postrm = '#!/bin/sh\n'
+            postrm += d.getVar('mime_xdg_postrm')
+            d.setVar('pkg_postrm_%s' % pkg, postrm)
+            bb.note("adding desktop-file-utils dependency to %s" % pkg)
+            d.appendVar('RDEPENDS_' + pkg, " " + d.getVar('MLPREFIX')+"desktop-file-utils")
+}
diff --git a/scripts/postinst-intercepts/update_desktop_database b/scripts/postinst-intercepts/update_desktop_database
new file mode 100644
index 0000000000..8903b496f3
--- /dev/null
+++ b/scripts/postinst-intercepts/update_desktop_database
@@ -0,0 +1,8 @@
+#!/bin/sh
+#
+# SPDX-License-Identifier: MIT
+#
+# Post-install intercept for mime-xdg.bbclass
+
+update-desktop-database $D${desktop_dir}
+
-- 
2.21.0



^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH][v2 09/10] insane.bbclass: Spawn warning for missing mime-xdg in inherit
  2020-01-17 21:28 [PATCH][v2 00/10] Make MIME work on desktops Andreas Müller
                   ` (7 preceding siblings ...)
  2020-01-17 21:29 ` [PATCH][v2 08/10] mime-xdg.bbclass: initial add Andreas Müller
@ 2020-01-17 21:29 ` Andreas Müller
  2020-01-17 21:29 ` [PATCH][v2 10/10] gcr: add mime-xdg to inherit Andreas Müller
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 16+ messages in thread
From: Andreas Müller @ 2020-01-17 21:29 UTC (permalink / raw)
  To: openembedded-core

If a package signals that it can open mime-types but does not inharit mime-xdg,
a warning is created.

Signed-off-by: Andreas Müller <schnitzeltony@gmail.com>
---
 meta/classes/insane.bbclass | 31 ++++++++++++++++++++++++++++++-
 1 file changed, 30 insertions(+), 1 deletion(-)

diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass
index a2d9318276..d6c60326db 100644
--- a/meta/classes/insane.bbclass
+++ b/meta/classes/insane.bbclass
@@ -28,7 +28,7 @@ WARN_QA ?= "ldflags useless-rpaths rpaths staticdev libdir xorg-driver-abi \
             pn-overrides infodir build-deps src-uri-bad \
             unknown-configure-option symlink-to-sysroot multilib \
             invalid-packageconfig host-user-contaminated uppercase-pn patch-fuzz \
-            mime \
+            mime mime-xdg \
             "
 ERROR_QA ?= "dev-so debug-deps dev-deps debug-files arch pkgconfig la \
             perms dep-cmp pkgvarcheck perm-config perm-line perm-link \
@@ -197,6 +197,35 @@ def package_qa_check_mime(path, name, d, elf, messages):
         package_qa_add_message(messages, "mime", "package contains mime types but does not inhert mime: %s path '%s'" % \
                  (name, package_qa_clean_path(path,d)))
 
+QAPATHTEST[mime-xdg] = "package_qa_check_mime_xdg"
+def package_qa_check_mime_xdg(path, name, d, elf, messages):
+    """
+    Check if package installs desktop file containing MimeType and requires
+    mime-types.bbclass to create /usr/share/applications/mimeinfo.cache
+    """
+
+    if d.getVar("datadir") + "/applications" in path and path.endswith('.desktop') and not bb.data.inherits_class("mime-xdg", d):
+        mime_type_found = False
+        try:
+            with open(path, 'r') as f:
+                for line in f.read().split('\n'):
+                    if 'MimeType' in line:
+                        mime_type_found = True
+                        break;
+        except:
+            # At least libreoffice installs symlinks with absolute paths that are dangling here.
+            # We could implement some magic but for few (one) recipes it is not worth the effort so just warn:
+            wstr = "%s cannot open %s - is it a symlink with absolute path?\n" % (name, package_qa_clean_path(path,d))
+            wstr += "Please check if (linked) file contains key 'MimeType'.\n"
+            pkgname = name
+            if name == d.getVar('PN'):
+                pkgname = '${PN}'
+            wstr += "If yes: add \'inhert mime-xdg\' and \'MIME_XDG_PACKAGES += \"%s\"\' / if no add \'INSANE_SKIP_%s += \"mime-xdg\"\' to recipe." % (pkgname, pkgname)
+            package_qa_add_message(messages, "mime-xdg", wstr)
+        if mime_type_found:
+            package_qa_add_message(messages, "mime-xdg", "package contains desktop file with key 'MimeType' but does not inhert mime-xdg: %s path '%s'" % \
+                    (name, package_qa_clean_path(path,d)))
+
 def package_qa_check_libdir(d):
     """
     Check for wrong library installation paths. For instance, catch
-- 
2.21.0



^ permalink raw reply related	[flat|nested] 16+ messages in thread

* [PATCH][v2 10/10] gcr: add mime-xdg to inherit
  2020-01-17 21:28 [PATCH][v2 00/10] Make MIME work on desktops Andreas Müller
                   ` (8 preceding siblings ...)
  2020-01-17 21:29 ` [PATCH][v2 09/10] insane.bbclass: Spawn warning for missing mime-xdg in inherit Andreas Müller
@ 2020-01-17 21:29 ` Andreas Müller
  2020-01-17 21:32 ` ✗ patchtest: failure for Make MIME work on desktops (rev2) Patchwork
  2020-01-18  8:40 ` [PATCH][v2 00/10] Make MIME work on desktops Richard Purdie
  11 siblings, 0 replies; 16+ messages in thread
From: Andreas Müller @ 2020-01-17 21:29 UTC (permalink / raw)
  To: openembedded-core

Signed-off-by: Andreas Müller <schnitzeltony@gmail.com>
---
 meta/recipes-gnome/gcr/gcr_3.34.0.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/recipes-gnome/gcr/gcr_3.34.0.bb b/meta/recipes-gnome/gcr/gcr_3.34.0.bb
index 272112dd12..9853b3f416 100644
--- a/meta/recipes-gnome/gcr/gcr_3.34.0.bb
+++ b/meta/recipes-gnome/gcr/gcr_3.34.0.bb
@@ -11,7 +11,7 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=55ca817ccb7d5b5b66355690e9abc605"
 DEPENDS = "gtk+3 p11-kit glib-2.0 libgcrypt \
            ${@bb.utils.contains('GI_DATA_ENABLED', 'True', 'libxslt-native', '', d)}"
 
-inherit gnomebase gtk-icon-cache gtk-doc features_check upstream-version-is-even vala gobject-introspection gettext mime
+inherit gnomebase gtk-icon-cache gtk-doc features_check upstream-version-is-even vala gobject-introspection gettext mime mime-xdg
 # depends on gtk+3, but also x11 through gtk+-x11
 REQUIRED_DISTRO_FEATURES = "x11"
 
-- 
2.21.0



^ permalink raw reply related	[flat|nested] 16+ messages in thread

* ✗ patchtest: failure for Make MIME work on desktops (rev2)
  2020-01-17 21:28 [PATCH][v2 00/10] Make MIME work on desktops Andreas Müller
                   ` (9 preceding siblings ...)
  2020-01-17 21:29 ` [PATCH][v2 10/10] gcr: add mime-xdg to inherit Andreas Müller
@ 2020-01-17 21:32 ` Patchwork
  2020-01-18  8:40 ` [PATCH][v2 00/10] Make MIME work on desktops Richard Purdie
  11 siblings, 0 replies; 16+ messages in thread
From: Patchwork @ 2020-01-17 21:32 UTC (permalink / raw)
  To: Andreas Müller; +Cc: openembedded-core

== Series Details ==

Series: Make MIME work on desktops (rev2)
Revision: 2
URL   : https://patchwork.openembedded.org/series/21945/
State : failure

== Summary ==


Thank you for submitting this patch series to OpenEmbedded Core. This is
an automated response. Several tests have been executed on the proposed
series by patchtest resulting in the following failures:



* Issue             A patch file has been added, but does not have a Signed-off-by tag [test_signed_off_by_presence] 
  Suggested fix    Sign off the added patch file (meta/recipes-support/itstool/itstool/0002-Don-t-use-build-time-hardcoded-python-binary-path.patch)



If you believe any of these test results are incorrect, please reply to the
mailing list (openembedded-core@lists.openembedded.org) raising your concerns.
Otherwise we would appreciate you correcting the issues and submitting a new
version of the patchset if applicable. Please ensure you add/increment the
version number when sending the new version (i.e. [PATCH] -> [PATCH v2] ->
[PATCH v3] -> ...).

---
Guidelines:     https://www.openembedded.org/wiki/Commit_Patch_Message_Guidelines
Test framework: http://git.yoctoproject.org/cgit/cgit.cgi/patchtest
Test suite:     http://git.yoctoproject.org/cgit/cgit.cgi/patchtest-oe



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH][v2 00/10] Make MIME work on desktops
  2020-01-17 21:28 [PATCH][v2 00/10] Make MIME work on desktops Andreas Müller
                   ` (10 preceding siblings ...)
  2020-01-17 21:32 ` ✗ patchtest: failure for Make MIME work on desktops (rev2) Patchwork
@ 2020-01-18  8:40 ` Richard Purdie
  2020-01-18 11:08   ` Andreas Müller
  11 siblings, 1 reply; 16+ messages in thread
From: Richard Purdie @ 2020-01-18  8:40 UTC (permalink / raw)
  To: Andreas Müller, openembedded-core

On Fri, 2020-01-17 at 22:28 +0100, Andreas Müller wrote:
> On fresh images file-browsers do not know how to open files and
> usually open a
> dialog with ALL applications available on the machine. This is not
> what users
> are used to when working with linux: For just one application
> installed per
> Mime-Type, the application is opened automatically.
> 
> To get a working MIME on desktop it needs two 'databases' on target:
> 
> 1. Mime-Types: This is handled by mime.bbclass and creates database
> in
>    /usr/share/mime/mime.cache.
> 2. Mime associations: A simple text-list of pairs Mime-Type <->
> application
>    in /usr/share/applications/mimeinfo.cache
> 
> This patch series updates/implements/enhances both parts to get
> images work as
> expected.
> 
> @Khem: This series creates many QA warnings for layers in meta-
> openembedded and
> a patch series fixing many was prepared [1]. Once this series get's
> applied (or
> you ask for it) I can send them out.
> 
> [1] 
> https://github.com/schnitzeltony/meta-openembedded/tree/work-2020-01
> 
> V1 -> V2:
> * Shelve global path export thingy
> * Add me as maintainer of itstool (let's consider 'ü' in my name as
> test case :)
> * Change "to to" to "to" in commit message
> * Build shared-mime-info from git to allow automated upgrades
> * mime-xdg.bbclass: Be prepared for packages as libreoffice: Desktop
> files
>   installed are absolut symlinks broken for us. In case other
> projects do same: 
>   Offer asolution and guide recipe writers how to handle by
> generating warnings
>   with instructions how to handle.

Thanks, this looks good to me. It did generate a warning on master-next 
builds in many places:

WARNING: libfm-1.3.1-r0 do_package_qa: QA Issue: package contains desktop file with key 'MimeType' but does not inhert mime-xdg: libfm-gtk path '/work/armv7vet2hf-neon-oe-linux-gnueabi/libfm/1.3.1-r0/packages-split/libfm-gtk/usr/share/applications/lxshortcut.desktop' [mime-xdg]
WARNING: libfm-1.3.1-r0 do_package_qa: QA Issue: package contains mime types but does not inhert mime: libfm-mime path '/work/armv7vet2hf-neon-oe-linux-gnueabi/libfm/1.3.1-r0/packages-split/libfm-mime/usr/share/mime/packages/libfm.xml' [mime]

It also generated:

https://autobuilder.yoctoproject.org/typhoon/#/builders/75/builds/1458

which partly is the python2 removal that was in with the test and
partly this series since itstool is GPLv3 :(.

I have to admit I'm not sure how reasonable it is to keep hacking the
gplv2 layer to work...

Cheers,

Richard





^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH][v2 00/10] Make MIME work on desktops
  2020-01-18  8:40 ` [PATCH][v2 00/10] Make MIME work on desktops Richard Purdie
@ 2020-01-18 11:08   ` Andreas Müller
  2020-01-18 11:13     ` Richard Purdie
  0 siblings, 1 reply; 16+ messages in thread
From: Andreas Müller @ 2020-01-18 11:08 UTC (permalink / raw)
  To: Richard Purdie; +Cc: Patches and discussions about the oe-core layer

On Sat, Jan 18, 2020 at 9:40 AM Richard Purdie
<richard.purdie@linuxfoundation.org> wrote:
> >
> > V1 -> V2:
> > * Shelve global path export thingy
> > * Add me as maintainer of itstool (let's consider 'ü' in my name as
> > test case :)
> > * Change "to to" to "to" in commit message
> > * Build shared-mime-info from git to allow automated upgrades
> > * mime-xdg.bbclass: Be prepared for packages as libreoffice: Desktop
> > files
> >   installed are absolut symlinks broken for us. In case other
> > projects do same:
> >   Offer asolution and guide recipe writers how to handle by
> > generating warnings
> >   with instructions how to handle.
>
> Thanks, this looks good to me. It did generate a warning on master-next
> builds in many places:
>
> WARNING: libfm-1.3.1-r0 do_package_qa: QA Issue: package contains desktop file with key 'MimeType' but does not inhert mime-xdg: libfm-gtk path '/work/armv7vet2hf-neon-oe-linux-gnueabi/libfm/1.3.1-r0/packages-split/libfm-gtk/usr/share/applications/lxshortcut.desktop' [mime-xdg]
> WARNING: libfm-1.3.1-r0 do_package_qa: QA Issue: package contains mime types but does not inhert mime: libfm-mime path '/work/armv7vet2hf-neon-oe-linux-gnueabi/libfm/1.3.1-r0/packages-split/libfm-mime/usr/share/mime/packages/libfm.xml' [mime]
Slipped through - will send a follow up
>
> It also generated:
>
> https://autobuilder.yoctoproject.org/typhoon/#/builders/75/builds/1458
>
> which partly is the python2 removal that was in with the test and
> partly this series since itstool is GPLv3 :(.
Is there any activity required from my side?
>
> I have to admit I'm not sure how reasonable it is to keep hacking the
> gplv2 layer to work...
>
> Cheers,
>
> Richard
>
Andreas


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH][v2 00/10] Make MIME work on desktops
  2020-01-18 11:08   ` Andreas Müller
@ 2020-01-18 11:13     ` Richard Purdie
  2020-01-18 17:49       ` Richard Purdie
  0 siblings, 1 reply; 16+ messages in thread
From: Richard Purdie @ 2020-01-18 11:13 UTC (permalink / raw)
  To: Andreas Müller; +Cc: Patches and discussions about the oe-core layer

On Sat, 2020-01-18 at 12:08 +0100, Andreas Müller wrote:
> On Sat, Jan 18, 2020 at 9:40 AM Richard Purdie
> <richard.purdie@linuxfoundation.org> wrote:
> > > V1 -> V2:
> > > * Shelve global path export thingy
> > > * Add me as maintainer of itstool (let's consider 'ü' in my name
> > > as
> > > test case :)
> > > * Change "to to" to "to" in commit message
> > > * Build shared-mime-info from git to allow automated upgrades
> > > * mime-xdg.bbclass: Be prepared for packages as libreoffice:
> > > Desktop
> > > files
> > >   installed are absolut symlinks broken for us. In case other
> > > projects do same:
> > >   Offer asolution and guide recipe writers how to handle by
> > > generating warnings
> > >   with instructions how to handle.
> > 
> > Thanks, this looks good to me. It did generate a warning on master-
> > next
> > builds in many places:
> > 
> > WARNING: libfm-1.3.1-r0 do_package_qa: QA Issue: package contains desktop file with key 'MimeType' but does not inhert mime-xdg: libfm-gtk path '/work/armv7vet2hf-neon-oe-linux-gnueabi/libfm/1.3.1-r0/packages-split/libfm-gtk/usr/share/applications/lxshortcut.desktop' [mime-xdg]
> > WARNING: libfm-1.3.1-r0 do_package_qa: QA Issue: package contains mime types but does not inhert mime: libfm-mime path '/work/armv7vet2hf-neon-oe-linux-gnueabi/libfm/1.3.1-r0/packages-split/libfm-mime/usr/share/mime/packages/libfm.xml' [mime]
> Slipped through - will send a follow up

Thanks, should be simple at least! :)

> > It also generated:
> > 
> > https://autobuilder.yoctoproject.org/typhoon/#/builders/75/builds/1458
> > 
> > which partly is the python2 removal that was in with the test and
> > partly this series since itstool is GPLv3 :(.
> Is there any activity required from my side?

Well, as things stand this series breaks meta-gplv2. This is currently
tested on the autobuilder and turns it red. I'm therefore blocked on
merging.

> > I have to admit I'm not sure how reasonable it is to keep hacking the
> > gplv2 layer to work...

The question now is really whether we want to continue supporting meta-
gplv2 with master?

I don't like the layer, I think there are other approaches we're going
to need to take going forward and the project may need to send that
message.

If someone steps up and fixes it, great, we can move forward and I'll
defer that discussion.

If nobody does, quickly, then I will need to start a discussion about
dropping it from the core YP testing. This patch is blocked until
something changes though :(

Cheers,

Richard




^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [PATCH][v2 00/10] Make MIME work on desktops
  2020-01-18 11:13     ` Richard Purdie
@ 2020-01-18 17:49       ` Richard Purdie
  0 siblings, 0 replies; 16+ messages in thread
From: Richard Purdie @ 2020-01-18 17:49 UTC (permalink / raw)
  To: Andreas Müller; +Cc: Patches and discussions about the oe-core layer

On Sat, 2020-01-18 at 11:13 +0000, Richard Purdie wrote:
> On Sat, 2020-01-18 at 12:08 +0100, Andreas Müller wrote:
> > On Sat, Jan 18, 2020 at 9:40 AM Richard Purdie
> > <richard.purdie@linuxfoundation.org> wrote:
> > > > V1 -> V2:
> > > > * Shelve global path export thingy
> > > > * Add me as maintainer of itstool (let's consider 'ü' in my
> > > > name
> > > > as
> > > > test case :)
> > > > * Change "to to" to "to" in commit message
> > > > * Build shared-mime-info from git to allow automated upgrades
> > > > * mime-xdg.bbclass: Be prepared for packages as libreoffice:
> > > > Desktop
> > > > files
> > > >   installed are absolut symlinks broken for us. In case other
> > > > projects do same:
> > > >   Offer asolution and guide recipe writers how to handle by
> > > > generating warnings
> > > >   with instructions how to handle.
> > > 
> > > Thanks, this looks good to me. It did generate a warning on
> > > master-
> > > next
> > > builds in many places:
> > > 
> > > WARNING: libfm-1.3.1-r0 do_package_qa: QA Issue: package contains
> > > desktop file with key 'MimeType' but does not inhert mime-xdg:
> > > libfm-gtk path '/work/armv7vet2hf-neon-oe-linux-
> > > gnueabi/libfm/1.3.1-r0/packages-split/libfm-
> > > gtk/usr/share/applications/lxshortcut.desktop' [mime-xdg]
> > > WARNING: libfm-1.3.1-r0 do_package_qa: QA Issue: package contains
> > > mime types but does not inhert mime: libfm-mime path
> > > '/work/armv7vet2hf-neon-oe-linux-gnueabi/libfm/1.3.1-r0/packages-
> > > split/libfm-mime/usr/share/mime/packages/libfm.xml' [mime]
> > Slipped through - will send a follow up
> 
> Thanks, should be simple at least! :)

I've sent a fix out which I think is right...

> 
> > > It also generated:
> > > 
> > > https://autobuilder.yoctoproject.org/typhoon/#/builders/75/builds/1458
> > > 
> > > which partly is the python2 removal that was in with the test and
> > > partly this series since itstool is GPLv3 :(.
> > Is there any activity required from my side?
> 
> Well, as things stand this series breaks meta-gplv2. This is
> currently
> tested on the autobuilder and turns it red. I'm therefore blocked on
> merging.
> 
> > > I have to admit I'm not sure how reasonable it is to keep hacking
> > > the
> > > gplv2 layer to work...
> 
> The question now is really whether we want to continue supporting
> meta-
> gplv2 with master?
> 
> I don't like the layer, I think there are other approaches we're
> going
> to need to take going forward and the project may need to send that
> message.
> 
> If someone steps up and fixes it, great, we can move forward and I'll
> defer that discussion.
> 
> If nobody does, quickly, then I will need to start a discussion about
> dropping it from the core YP testing. This patch is blocked until
> something changes though :(

I figured out how to fix the issues so I've sent patches as well and am
rerunning the autobuilder tests.

Cheers,

Richard



^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2020-01-18 17:49 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-17 21:28 [PATCH][v2 00/10] Make MIME work on desktops Andreas Müller
2020-01-17 21:28 ` [PATCH][v2 01/10] itstool: add from meta-oe Andreas Müller
2020-01-17 21:29 ` [PATCH][v2 02/10] itstool: extend to nativesdk Andreas Müller
2020-01-17 21:29 ` [PATCH][v2 03/10] shared-mime-info: upgrade 1.10 -> 1.15 Andreas Müller
2020-01-17 21:29 ` [PATCH][v2 04/10] mime.bbclass: rework Andreas Müller
2020-01-17 21:29 ` [PATCH][v2 05/10] insane.bbclass: introduce a warning for mime missing in inherit Andreas Müller
2020-01-17 21:29 ` [PATCH][v2 06/10] shared-mime-info: add mime to inherit Andreas Müller
2020-01-17 21:29 ` [PATCH][v2 07/10] gcr: " Andreas Müller
2020-01-17 21:29 ` [PATCH][v2 08/10] mime-xdg.bbclass: initial add Andreas Müller
2020-01-17 21:29 ` [PATCH][v2 09/10] insane.bbclass: Spawn warning for missing mime-xdg in inherit Andreas Müller
2020-01-17 21:29 ` [PATCH][v2 10/10] gcr: add mime-xdg to inherit Andreas Müller
2020-01-17 21:32 ` ✗ patchtest: failure for Make MIME work on desktops (rev2) Patchwork
2020-01-18  8:40 ` [PATCH][v2 00/10] Make MIME work on desktops Richard Purdie
2020-01-18 11:08   ` Andreas Müller
2020-01-18 11:13     ` Richard Purdie
2020-01-18 17:49       ` Richard Purdie

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.