summaryrefslogtreecommitdiffstats
path: root/meta/recipes-support/shared-mime-info
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-support/shared-mime-info')
-rw-r--r--meta/recipes-support/shared-mime-info/shared-mime-info/0001-Fix-build-with-libxml2-2.12.0-and-clang-17.patch26
-rw-r--r--meta/recipes-support/shared-mime-info/shared-mime-info/0002-Handle-build-with-older-versions-of-GCC.patch54
-rw-r--r--meta/recipes-support/shared-mime-info/shared-mime-info_2.4.bb (renamed from meta/recipes-support/shared-mime-info/shared-mime-info_git.bb)19
3 files changed, 91 insertions, 8 deletions
diff --git a/meta/recipes-support/shared-mime-info/shared-mime-info/0001-Fix-build-with-libxml2-2.12.0-and-clang-17.patch b/meta/recipes-support/shared-mime-info/shared-mime-info/0001-Fix-build-with-libxml2-2.12.0-and-clang-17.patch
new file mode 100644
index 0000000000..936f72ccf8
--- /dev/null
+++ b/meta/recipes-support/shared-mime-info/shared-mime-info/0001-Fix-build-with-libxml2-2.12.0-and-clang-17.patch
@@ -0,0 +1,26 @@
1From 665383306c725f299a1b373f947cda01949d49e4 Mon Sep 17 00:00:00 2001
2From: David Faure <faure@kde.org>
3Date: Sun, 19 Nov 2023 11:18:11 +0100
4Subject: [PATCH] Fix build with libxml2-2.12.0 and clang-17
5
6Fixes #219
7
8Upstream-Status: Backport [https://gitlab.freedesktop.org/xdg/shared-mime-info/-/commit/c918fe77e255150938e83a6aec259f153d303573]
9Signed-off-by: Khem Raj <raj.khem@gmail.com>
10---
11 src/test-subclassing.c | 1 +
12 1 file changed, 1 insertion(+)
13
14diff --git a/src/test-subclassing.c b/src/test-subclassing.c
15index dd099e4..0758164 100644
16--- a/src/test-subclassing.c
17+++ b/src/test-subclassing.c
18@@ -1,4 +1,5 @@
19 #include <libxml/tree.h>
20+#include <libxml/parser.h>
21 #include <stdio.h>
22 #include <string.h>
23
24--
252.43.0
26
diff --git a/meta/recipes-support/shared-mime-info/shared-mime-info/0002-Handle-build-with-older-versions-of-GCC.patch b/meta/recipes-support/shared-mime-info/shared-mime-info/0002-Handle-build-with-older-versions-of-GCC.patch
new file mode 100644
index 0000000000..2af6b461b6
--- /dev/null
+++ b/meta/recipes-support/shared-mime-info/shared-mime-info/0002-Handle-build-with-older-versions-of-GCC.patch
@@ -0,0 +1,54 @@
1From 461d00fcd5c5842b9a56f7462d55d46bf21163cc Mon Sep 17 00:00:00 2001
2From: Patrick Williams <patrick@stwcx.xyz>
3Date: Fri, 1 Dec 2023 11:19:02 -0600
4Subject: [PATCH] Handle build with older versions of GCC
5
6Older versions of GCC (prior to 9.1) did not put the `std::filesystem`
7support directly into libstdcpp, but in a separate `libstdc++fs`. Add
8meson logic to detect if an extra linker flag is necessary.
9
10Fixes #223.
11
12Tested on AlmaLinux 8 which uses GCC-8.
13
14Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
15Upstream-Status: Submitted [https://gitlab.freedesktop.org/xdg/shared-mime-info/-/merge_requests/278]
16---
17 meson.build | 14 ++++++++++++++
18 1 file changed, 14 insertions(+)
19
20diff --git a/meson.build b/meson.build
21index ecc012f..93acd40 100644
22--- a/meson.build
23+++ b/meson.build
24@@ -11,6 +11,7 @@ config = configuration_data()
25 i18n = import('i18n')
26
27 cc = meson.get_compiler('c')
28+cxx = meson.get_compiler('cpp')
29
30 ###############################################################################
31 # Project configuration
32@@ -46,6 +47,19 @@ if not xdgmime_found
33 ''')
34 endif
35
36+###############################################################################
37+# Check if GCC needs -lstdc++fs (before 9.1)
38+
39+if not cxx.links('''
40+ #include <filesystem>
41+ int main() {
42+ return std::filesystem::is_directory(
43+ std::filesystem::status("/tmp")) ? 0 : 1;
44+ }
45+ ''', name: 'std++fs-check')
46+ add_project_link_arguments('-lstdc++fs', language : 'cpp')
47+endif
48+
49 ###############################################################################
50 # Dependencies
51
52--
532.41.0
54
diff --git a/meta/recipes-support/shared-mime-info/shared-mime-info_git.bb b/meta/recipes-support/shared-mime-info/shared-mime-info_2.4.bb
index 5509c99c46..ef5df44ad6 100644
--- a/meta/recipes-support/shared-mime-info/shared-mime-info_git.bb
+++ b/meta/recipes-support/shared-mime-info/shared-mime-info_2.4.bb
@@ -1,28 +1,31 @@
1SUMMARY = "Shared MIME type database and specification" 1SUMMARY = "Shared MIME type database and specification"
2DESCRIPTION = "The shared-mime-info package contains the core database of common types."
2HOMEPAGE = "http://freedesktop.org/wiki/Software/shared-mime-info" 3HOMEPAGE = "http://freedesktop.org/wiki/Software/shared-mime-info"
3SECTION = "base" 4SECTION = "base"
4 5
5LICENSE = "GPLv2" 6LICENSE = "GPL-2.0-only"
6LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263" 7LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
7 8
8DEPENDS = "libxml2 itstool-native glib-2.0 shared-mime-info-native xmlto-native" 9DEPENDS = "libxml2 itstool-native glib-2.0 shared-mime-info-native xmlto-native"
9 10
10SRC_URI = "git://gitlab.freedesktop.org/xdg/shared-mime-info.git;protocol=https" 11SRC_URI = "git://gitlab.freedesktop.org/xdg/shared-mime-info.git;protocol=https;branch=master \
11SRCREV = "18e558fa1c8b90b86757ade09a4ba4d6a6cf8f70" 12 file://0001-Fix-build-with-libxml2-2.12.0-and-clang-17.patch \
12PV = "2.1" 13 file://0002-Handle-build-with-older-versions-of-GCC.patch"
14SRCREV = "9a6d6b8e963935f145f3a1ef446552de6996dada"
15
13S = "${WORKDIR}/git" 16S = "${WORKDIR}/git"
14 17
15inherit meson pkgconfig gettext python3native mime 18inherit meson pkgconfig gettext python3native mime
16 19
17EXTRA_OEMESON = "-Dupdate-mimedb=true" 20EXTRA_OEMESON = "-Dupdate-mimedb=true"
18 21
19FILES_${PN} += "${datadir}/mime" 22FILES:${PN} += "${datadir}/mime"
20FILES_${PN}-dev += "${datadir}/pkgconfig/shared-mime-info.pc ${datadir}/gettext/its" 23FILES:${PN}-dev += "${datadir}/pkgconfig/shared-mime-info.pc ${datadir}/gettext/its"
21 24
22# freedesktop.org.xml is only required when updating the mime database, 25# freedesktop.org.xml is only required when updating the mime database,
23# package it separately 26# package it separately
24PACKAGES =+ "shared-mime-info-data" 27PACKAGES =+ "shared-mime-info-data"
25FILES_shared-mime-info-data = "${datadir}/mime/packages/freedesktop.org.xml" 28FILES:shared-mime-info-data = "${datadir}/mime/packages/freedesktop.org.xml"
26RDEPENDS_shared-mime-info-data = "shared-mime-info" 29RDEPENDS:shared-mime-info-data = "shared-mime-info"
27 30
28BBCLASSEXTEND = "native nativesdk" 31BBCLASSEXTEND = "native nativesdk"