blob: 882a89da7a87f9b5125e732c9cf2ee014a1f32aa [file] [log] [blame]
Andrew Geissler82c905d2020-04-13 13:39:40 -05001require glib.inc
2
3PE = "1"
4
5SHRT_VER = "${@oe.utils.trim_version("${PV}", 2)}"
6
7SRC_URI = "${GNOME_MIRROR}/glib/${SHRT_VER}/glib-${PV}.tar.xz \
8 file://run-ptest \
9 file://0001-Fix-DATADIRNAME-on-uclibc-Linux.patch \
10 file://Enable-more-tests-while-cross-compiling.patch \
11 file://0001-Remove-the-warning-about-deprecated-paths-in-schemas.patch \
12 file://0001-Install-gio-querymodules-as-libexec_PROGRAM.patch \
13 file://0001-Do-not-ignore-return-value-of-write.patch \
14 file://0010-Do-not-hardcode-python-path-into-various-tools.patch \
15 file://0001-Set-host_machine-correctly-when-building-with-mingw3.patch \
16 file://0001-Do-not-write-bindir-into-pkg-config-files.patch \
17 file://0001-meson-Run-atomics-test-on-clang-as-well.patch \
18 file://0001-gio-tests-resources.c-comment-out-a-build-host-only-.patch \
Andrew Geisslerd1e89492021-02-12 15:35:20 -060019 file://0001-gio-tests-codegen.py-bump-timeout-to-100-seconds.patch \
20 file://0001-tests-codegen.py-removing-unecessary-print-statement.patch \
Andrew Geissler82c905d2020-04-13 13:39:40 -050021 "
22
23SRC_URI_append_class-native = " file://relocate-modules.patch"
24
Andrew Geissler9b4d8b02021-02-19 12:26:16 -060025SRC_URI[sha256sum] = "09f158769f6f26b31074e15b1ac80ec39b13b53102dfae66cfe826fb2cc65502"
Andrew Geissler82c905d2020-04-13 13:39:40 -050026
27# Find any meson cross files in FILESPATH that are relevant for the current
28# build (using siteinfo) and add them to EXTRA_OEMESON.
29inherit siteinfo
30def find_meson_cross_files(d):
31 if bb.data.inherits_class('native', d):
32 return ""
33
Andrew Geissler90fd73c2021-03-05 15:25:55 -060034 thisdir = d.getVar("THISDIR")
Andrew Geissler82c905d2020-04-13 13:39:40 -050035 import collections
36 sitedata = siteinfo_data(d)
37 # filename -> found
38 files = collections.OrderedDict()
39 for path in d.getVar("FILESPATH").split(":"):
40 for element in sitedata:
41 filename = os.path.normpath(os.path.join(path, "meson.cross.d", element))
Andrew Geissler90fd73c2021-03-05 15:25:55 -060042 sanitized_path = filename.replace(thisdir, "${THISDIR}")
43 if sanitized_path == filename:
44 bb.error("Cannot add '%s' to --cross-file, because it's not relative to THISDIR '%s' and sstate signature would contain this full path" % (filename, thisdir))
45 continue
46 files[filename.replace(thisdir, "${THISDIR}")] = os.path.exists(filename)
Andrew Geissler82c905d2020-04-13 13:39:40 -050047
48 items = ["--cross-file=" + k for k,v in files.items() if v]
49 d.appendVar("EXTRA_OEMESON", " " + " ".join(items))
50 items = ["%s:%s" % (k, "True" if v else "False") for k,v in files.items()]
51 d.appendVarFlag("do_configure", "file-checksums", " " + " ".join(items))
52
53python () {
54 find_meson_cross_files(d)
55}