blob: 2734a11f9647fbabc547f796003ddb1e7d36cb34 [file] [log] [blame]
Andrew Geissler82c905d2020-04-13 13:39:40 -05001SUMMARY = "Image loading library for GTK+"
2DESCRIPTION = "The GDK Pixbuf library provides: Image loading and saving \
3facilities, fast scaling and compositing of pixbufs and Simple animation \
4loading (ie. animated GIFs)"
5HOMEPAGE = "https://wiki.gnome.org/Projects/GdkPixbuf"
6BUGTRACKER = "https://gitlab.gnome.org/GNOME/gdk-pixbuf/issues"
7
Andrew Geissler4c19ea12020-10-27 13:52:24 -05008LICENSE = "LGPLv2.1+"
Andrew Geissler82c905d2020-04-13 13:39:40 -05009LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c \
10 file://gdk-pixbuf/gdk-pixbuf.h;endline=26;md5=72b39da7cbdde2e665329fef618e1d6b \
11 "
12
13SECTION = "libs"
14
15DEPENDS = "glib-2.0 gdk-pixbuf-native shared-mime-info"
Andrew Geisslerd1e89492021-02-12 15:35:20 -060016DEPENDS_remove_class-native = "gdk-pixbuf-native"
Andrew Geissler82c905d2020-04-13 13:39:40 -050017
18MAJ_VER = "${@oe.utils.trim_version("${PV}", 2)}"
19
20SRC_URI = "${GNOME_MIRROR}/${BPN}/${MAJ_VER}/${BPN}-${PV}.tar.xz \
21 file://run-ptest \
22 file://fatal-loader.patch \
23 file://0001-Work-around-thumbnailer-cross-compile-failure.patch \
24 file://0001-Fix-a-couple-of-decisions-around-cross-compilation.patch \
Andrew Geissler82c905d2020-04-13 13:39:40 -050025 file://0006-Build-thumbnailer-and-tests-also-in-cross-builds.patch \
Andrew Geisslerc926e172021-05-07 16:11:35 -050026 file://0001-Work-around-thumbnailer-and-pixdata-cross-compile-fa.patch \
Andrew Geissler82c905d2020-04-13 13:39:40 -050027 "
28
Andrew Geisslerc926e172021-05-07 16:11:35 -050029SRC_URI[sha256sum] = "c4a6b75b7ed8f58ca48da830b9fa00ed96d668d3ab4b1f723dcf902f78bde77f"
Andrew Geissler82c905d2020-04-13 13:39:40 -050030
31inherit meson pkgconfig gettext pixbufcache ptest-gnome upstream-version-is-even gobject-introspection gtk-doc lib_package
32
Andrew Geisslerc926e172021-05-07 16:11:35 -050033GIR_MESON_OPTION = 'introspection'
34GIR_MESON_ENABLE_FLAG = "enabled"
35GIR_MESON_DISABLE_FLAG = "disabled"
Andrew Geissler82c905d2020-04-13 13:39:40 -050036
Andrew Geissler82c905d2020-04-13 13:39:40 -050037LIBV = "2.10.0"
38
39GDK_PIXBUF_LOADERS ?= "png jpeg"
40
Andrew Geisslerc9f78652020-09-18 14:11:35 -050041PACKAGECONFIG = "${GDK_PIXBUF_LOADERS} \
Andrew Geisslerc9f78652020-09-18 14:11:35 -050042 ${@bb.utils.contains('PTEST_ENABLED', '1', 'tests', '', d)}"
Andrew Geissler82c905d2020-04-13 13:39:40 -050043PACKAGECONFIG_class-native = "${GDK_PIXBUF_LOADERS}"
44
45PACKAGECONFIG[png] = "-Dpng=true,-Dpng=false,libpng"
46PACKAGECONFIG[jpeg] = "-Djpeg=true,-Djpeg=false,jpeg"
47PACKAGECONFIG[tiff] = "-Dtiff=true,-Dtiff=false,tiff"
Andrew Geisslerc9f78652020-09-18 14:11:35 -050048PACKAGECONFIG[tests] = "-Dinstalled_tests=true,-Dinstalled_tests=false"
Andrew Geissler82c905d2020-04-13 13:39:40 -050049
50PACKAGES =+ "${PN}-xlib"
51
52# For GIO image type sniffing
53RDEPENDS_${PN} = "shared-mime-info"
54
55FILES_${PN}-xlib = "${libdir}/*pixbuf_xlib*${SOLIBS}"
56ALLOW_EMPTY_${PN}-xlib = "1"
57
58FILES_${PN} += "${libdir}/gdk-pixbuf-2.0/gdk-pixbuf-query-loaders"
59
60FILES_${PN}-bin += "${datadir}/thumbnailers/gdk-pixbuf-thumbnailer.thumbnailer"
61
62FILES_${PN}-dev += " \
63 ${bindir}/gdk-pixbuf-csource \
64 ${bindir}/gdk-pixbuf-pixdata \
65 ${bindir}/gdk-pixbuf-print-mime-types \
66 ${includedir}/* \
67 ${libdir}/gdk-pixbuf-2.0/${LIBV}/loaders/*.la \
68"
69
70PACKAGES_DYNAMIC += "^gdk-pixbuf-loader-.*"
71PACKAGES_DYNAMIC_class-native = ""
72
73python populate_packages_prepend () {
74 postinst_pixbufloader = d.getVar("postinst_pixbufloader")
75
76 loaders_root = d.expand('${libdir}/gdk-pixbuf-2.0/${LIBV}/loaders')
77
78 packages = ' '.join(do_split_packages(d, loaders_root, r'^libpixbufloader-(.*)\.so$', 'gdk-pixbuf-loader-%s', 'GDK pixbuf loader for %s'))
79 d.setVar('PIXBUF_PACKAGES', packages)
80
81 # The test suite exercises all the loaders, so ensure they are all
82 # dependencies of the ptest package.
83 d.appendVar("RDEPENDS_%s-ptest" % d.getVar('PN'), " " + packages)
84}
85
86do_install_append() {
87 # Copy gdk-pixbuf-query-loaders into libdir so it is always available
88 # in multilib builds.
89 cp ${D}/${bindir}/gdk-pixbuf-query-loaders ${D}/${libdir}/gdk-pixbuf-2.0/
90
91}
92
93# Remove a bad fuzzing attempt that sporadically fails without a way to reproduce
94do_install_ptest() {
95 rm ${D}/${datadir}/installed-tests/gdk-pixbuf/pixbuf-randomly-modified.test
96}
97
98do_install_append_class-native() {
99 find ${D}${libdir} -name "libpixbufloader-*.la" -exec rm \{\} \;
100
101 create_wrapper ${D}/${bindir}/gdk-pixbuf-csource \
102 XDG_DATA_DIRS=${STAGING_DATADIR} \
103 GDK_PIXBUF_MODULE_FILE=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/${LIBV}/loaders.cache
104
105 create_wrapper ${D}/${bindir}/gdk-pixbuf-pixdata \
106 XDG_DATA_DIRS=${STAGING_DATADIR} \
107 GDK_PIXBUF_MODULE_FILE=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/${LIBV}/loaders.cache
108
109 create_wrapper ${D}/${bindir}/gdk-pixbuf-print-mime-types \
110 XDG_DATA_DIRS=${STAGING_DATADIR} \
111 GDK_PIXBUF_MODULE_FILE=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/${LIBV}/loaders.cache
112
113 create_wrapper ${D}/${libdir}/gdk-pixbuf-2.0/gdk-pixbuf-query-loaders \
114 XDG_DATA_DIRS=${STAGING_DATADIR} \
115 GDK_PIXBUF_MODULE_FILE=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/${LIBV}/loaders.cache \
116 GDK_PIXBUF_MODULEDIR=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/${LIBV}/loaders
117
118 create_wrapper ${D}/${bindir}/gdk-pixbuf-query-loaders \
119 XDG_DATA_DIRS=${STAGING_DATADIR} \
120 GDK_PIXBUF_MODULE_FILE=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/${LIBV}/loaders.cache \
121 GDK_PIXBUF_MODULEDIR=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/${LIBV}/loaders
122}
123BBCLASSEXTEND = "native nativesdk"