blob: dd1ea508d2ced011c9f5285d0b5927ba1f3d1e0c [file] [log] [blame]
Andrew Geissler9aee5002022-03-30 16:27:02 +00001require 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 Geissler9aee5002022-03-30 16:27:02 +000019 "
20SRC_URI:append:class-native = " file://relocate-modules.patch"
21
Andrew Geissler615f2f12022-07-15 14:00:58 -050022SRC_URI[sha256sum] = "4a39a2f624b8512d500d5840173eda7fa85f51c109052eae806acece85d345f0"
Andrew Geissler9aee5002022-03-30 16:27:02 +000023
24# Find any meson cross files in FILESPATH that are relevant for the current
25# build (using siteinfo) and add them to EXTRA_OEMESON.
26inherit siteinfo
27def find_meson_cross_files(d):
28 if bb.data.inherits_class('native', d):
29 return ""
30
31 thisdir = os.path.normpath(d.getVar("THISDIR"))
32 import collections
33 sitedata = siteinfo_data(d)
34 # filename -> found
35 files = collections.OrderedDict()
36 for path in d.getVar("FILESPATH").split(":"):
37 for element in sitedata:
38 filename = os.path.normpath(os.path.join(path, "meson.cross.d", element))
39 sanitized_path = filename.replace(thisdir, "${THISDIR}")
40 if sanitized_path == filename:
41 if os.path.exists(filename):
42 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))
43 continue
44 files[filename.replace(thisdir, "${THISDIR}")] = os.path.exists(filename)
45
46 items = ["--cross-file=" + k for k,v in files.items() if v]
47 d.appendVar("EXTRA_OEMESON", " " + " ".join(items))
48 items = ["%s:%s" % (k, "True" if v else "False") for k,v in files.items()]
49 d.appendVarFlag("do_configure", "file-checksums", " " + " ".join(items))
50
51python () {
52 find_meson_cross_files(d)
53}