blob: 226e1c7b89fef0aa035f69e403740bdd9e6d2d93 [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 \
25 file://0004-Do-not-run-tests-when-building.patch \
26 file://0006-Build-thumbnailer-and-tests-also-in-cross-builds.patch \
27 file://missing-test-data.patch \
Andrew Geisslerd1e89492021-02-12 15:35:20 -060028 file://CVE-2020-29385.patch \
Andrew Geissler82c905d2020-04-13 13:39:40 -050029 "
30
31SRC_URI_append_class-target = " \
32 file://0003-target-only-Work-around-thumbnailer-cross-compile-fa.patch \
33 "
34SRC_URI_append_class-nativesdk = " \
35 file://0003-target-only-Work-around-thumbnailer-cross-compile-fa.patch \
36 "
37
38SRC_URI[md5sum] = "05eb1ebc258ba905f1c8644ef49de064"
39SRC_URI[sha256sum] = "1582595099537ca8ff3b99c6804350b4c058bb8ad67411bbaae024ee7cead4e6"
40
41inherit meson pkgconfig gettext pixbufcache ptest-gnome upstream-version-is-even gobject-introspection gtk-doc lib_package
42
43GIR_MESON_OPTION = 'gir'
44
Andrew Geissler82c905d2020-04-13 13:39:40 -050045LIBV = "2.10.0"
46
47GDK_PIXBUF_LOADERS ?= "png jpeg"
48
Andrew Geisslerc9f78652020-09-18 14:11:35 -050049PACKAGECONFIG = "${GDK_PIXBUF_LOADERS} \
50 ${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)} \
51 ${@bb.utils.contains('PTEST_ENABLED', '1', 'tests', '', d)}"
Andrew Geissler82c905d2020-04-13 13:39:40 -050052PACKAGECONFIG_class-native = "${GDK_PIXBUF_LOADERS}"
53
54PACKAGECONFIG[png] = "-Dpng=true,-Dpng=false,libpng"
55PACKAGECONFIG[jpeg] = "-Djpeg=true,-Djpeg=false,jpeg"
56PACKAGECONFIG[tiff] = "-Dtiff=true,-Dtiff=false,tiff"
57PACKAGECONFIG[jpeg2000] = "-Djasper=true,-Djasper=false,jasper"
Andrew Geisslerc9f78652020-09-18 14:11:35 -050058PACKAGECONFIG[tests] = "-Dinstalled_tests=true,-Dinstalled_tests=false"
Andrew Geissler82c905d2020-04-13 13:39:40 -050059PACKAGECONFIG[x11] = "-Dx11=true,-Dx11=false,virtual/libx11"
60
61PACKAGES =+ "${PN}-xlib"
62
63# For GIO image type sniffing
64RDEPENDS_${PN} = "shared-mime-info"
65
66FILES_${PN}-xlib = "${libdir}/*pixbuf_xlib*${SOLIBS}"
67ALLOW_EMPTY_${PN}-xlib = "1"
68
69FILES_${PN} += "${libdir}/gdk-pixbuf-2.0/gdk-pixbuf-query-loaders"
70
71FILES_${PN}-bin += "${datadir}/thumbnailers/gdk-pixbuf-thumbnailer.thumbnailer"
72
73FILES_${PN}-dev += " \
74 ${bindir}/gdk-pixbuf-csource \
75 ${bindir}/gdk-pixbuf-pixdata \
76 ${bindir}/gdk-pixbuf-print-mime-types \
77 ${includedir}/* \
78 ${libdir}/gdk-pixbuf-2.0/${LIBV}/loaders/*.la \
79"
80
81PACKAGES_DYNAMIC += "^gdk-pixbuf-loader-.*"
82PACKAGES_DYNAMIC_class-native = ""
83
84python populate_packages_prepend () {
85 postinst_pixbufloader = d.getVar("postinst_pixbufloader")
86
87 loaders_root = d.expand('${libdir}/gdk-pixbuf-2.0/${LIBV}/loaders')
88
89 packages = ' '.join(do_split_packages(d, loaders_root, r'^libpixbufloader-(.*)\.so$', 'gdk-pixbuf-loader-%s', 'GDK pixbuf loader for %s'))
90 d.setVar('PIXBUF_PACKAGES', packages)
91
92 # The test suite exercises all the loaders, so ensure they are all
93 # dependencies of the ptest package.
94 d.appendVar("RDEPENDS_%s-ptest" % d.getVar('PN'), " " + packages)
95}
96
97do_install_append() {
98 # Copy gdk-pixbuf-query-loaders into libdir so it is always available
99 # in multilib builds.
100 cp ${D}/${bindir}/gdk-pixbuf-query-loaders ${D}/${libdir}/gdk-pixbuf-2.0/
101
102}
103
104# Remove a bad fuzzing attempt that sporadically fails without a way to reproduce
105do_install_ptest() {
106 rm ${D}/${datadir}/installed-tests/gdk-pixbuf/pixbuf-randomly-modified.test
107}
108
109do_install_append_class-native() {
110 find ${D}${libdir} -name "libpixbufloader-*.la" -exec rm \{\} \;
111
112 create_wrapper ${D}/${bindir}/gdk-pixbuf-csource \
113 XDG_DATA_DIRS=${STAGING_DATADIR} \
114 GDK_PIXBUF_MODULE_FILE=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/${LIBV}/loaders.cache
115
116 create_wrapper ${D}/${bindir}/gdk-pixbuf-pixdata \
117 XDG_DATA_DIRS=${STAGING_DATADIR} \
118 GDK_PIXBUF_MODULE_FILE=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/${LIBV}/loaders.cache
119
120 create_wrapper ${D}/${bindir}/gdk-pixbuf-print-mime-types \
121 XDG_DATA_DIRS=${STAGING_DATADIR} \
122 GDK_PIXBUF_MODULE_FILE=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/${LIBV}/loaders.cache
123
124 create_wrapper ${D}/${libdir}/gdk-pixbuf-2.0/gdk-pixbuf-query-loaders \
125 XDG_DATA_DIRS=${STAGING_DATADIR} \
126 GDK_PIXBUF_MODULE_FILE=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/${LIBV}/loaders.cache \
127 GDK_PIXBUF_MODULEDIR=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/${LIBV}/loaders
128
129 create_wrapper ${D}/${bindir}/gdk-pixbuf-query-loaders \
130 XDG_DATA_DIRS=${STAGING_DATADIR} \
131 GDK_PIXBUF_MODULE_FILE=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/${LIBV}/loaders.cache \
132 GDK_PIXBUF_MODULEDIR=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/${LIBV}/loaders
133}
134BBCLASSEXTEND = "native nativesdk"