summaryrefslogtreecommitdiffstats
path: root/meta/recipes-support/shared-mime-info
diff options
context:
space:
mode:
authorPatrick Williams <patrick@stwcx.xyz>2023-12-01 13:01:48 -0600
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-12-04 11:23:37 +0000
commitedc72a4bd1cc8f97612fc4cae68c7d1d5a402c30 (patch)
tree605f320976b0e6f6bc9dd980aa18100d8ea34b7f /meta/recipes-support/shared-mime-info
parentde401f80ae4f2944942ee472b84b0564b1b3807e (diff)
downloadpoky-edc72a4bd1cc8f97612fc4cae68c7d1d5a402c30.tar.gz
shared-mime-info-native: handle old GCC for AlmaLinux8
shared-mime-info-native fails to build on AlmaLinux 8 due to its use of GCC-8 and the upstream package missing a required `-lstdc++fs` on that compiler. Submitted a patch upstream which fixes this and am porting. (From OE-Core rev: 664c7f09ddc15ec9bcb7d8a5bac453922be86a37) Signed-off-by: Patrick Williams <patrick@stwcx.xyz> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-support/shared-mime-info')
-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.bb3
2 files changed, 56 insertions, 1 deletions
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_2.4.bb b/meta/recipes-support/shared-mime-info/shared-mime-info_2.4.bb
index c7da0ca2d2..ef5df44ad6 100644
--- a/meta/recipes-support/shared-mime-info/shared-mime-info_2.4.bb
+++ b/meta/recipes-support/shared-mime-info/shared-mime-info_2.4.bb
@@ -9,7 +9,8 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
9DEPENDS = "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"
10 10
11SRC_URI = "git://gitlab.freedesktop.org/xdg/shared-mime-info.git;protocol=https;branch=master \ 11SRC_URI = "git://gitlab.freedesktop.org/xdg/shared-mime-info.git;protocol=https;branch=master \
12 file://0001-Fix-build-with-libxml2-2.12.0-and-clang-17.patch" 12 file://0001-Fix-build-with-libxml2-2.12.0-and-clang-17.patch \
13 file://0002-Handle-build-with-older-versions-of-GCC.patch"
13SRCREV = "9a6d6b8e963935f145f3a1ef446552de6996dada" 14SRCREV = "9a6d6b8e963935f145f3a1ef446552de6996dada"
14 15
15S = "${WORKDIR}/git" 16S = "${WORKDIR}/git"