blob: 50d58ef807bfe1e907c4740972ef41bd21f90135 [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 \
William A. Kennington IIIac69b482021-06-02 12:28:27 -070023 file://0001-Add-use_prebuilt_tools-option.patch \
Andrew Geissler82c905d2020-04-13 13:39:40 -050024 "
25
Andrew Geisslerc926e172021-05-07 16:11:35 -050026SRC_URI[sha256sum] = "c4a6b75b7ed8f58ca48da830b9fa00ed96d668d3ab4b1f723dcf902f78bde77f"
Andrew Geissler82c905d2020-04-13 13:39:40 -050027
William A. Kennington IIIac69b482021-06-02 12:28:27 -070028inherit meson pkgconfig gettext pixbufcache ptest-gnome upstream-version-is-even gobject-introspection gi-docgen lib_package
Andrew Geissler82c905d2020-04-13 13:39:40 -050029
Andrew Geisslerc926e172021-05-07 16:11:35 -050030GIR_MESON_OPTION = 'introspection'
31GIR_MESON_ENABLE_FLAG = "enabled"
32GIR_MESON_DISABLE_FLAG = "disabled"
Andrew Geissler82c905d2020-04-13 13:39:40 -050033
Andrew Geissler82c905d2020-04-13 13:39:40 -050034LIBV = "2.10.0"
35
36GDK_PIXBUF_LOADERS ?= "png jpeg"
37
Andrew Geisslerc9f78652020-09-18 14:11:35 -050038PACKAGECONFIG = "${GDK_PIXBUF_LOADERS} \
Andrew Geisslerc9f78652020-09-18 14:11:35 -050039 ${@bb.utils.contains('PTEST_ENABLED', '1', 'tests', '', d)}"
Andrew Geissler82c905d2020-04-13 13:39:40 -050040PACKAGECONFIG_class-native = "${GDK_PIXBUF_LOADERS}"
41
42PACKAGECONFIG[png] = "-Dpng=true,-Dpng=false,libpng"
43PACKAGECONFIG[jpeg] = "-Djpeg=true,-Djpeg=false,jpeg"
44PACKAGECONFIG[tiff] = "-Dtiff=true,-Dtiff=false,tiff"
Andrew Geisslerc9f78652020-09-18 14:11:35 -050045PACKAGECONFIG[tests] = "-Dinstalled_tests=true,-Dinstalled_tests=false"
Andrew Geissler82c905d2020-04-13 13:39:40 -050046
William A. Kennington IIIac69b482021-06-02 12:28:27 -070047EXTRA_OEMESON_class-target = " \
48 -Duse_prebuilt_tools=true \
49"
50
51EXTRA_OEMESON_class-nativesdk = " \
52 -Duse_prebuilt_tools=true \
53"
54
Andrew Geissler82c905d2020-04-13 13:39:40 -050055PACKAGES =+ "${PN}-xlib"
56
57# For GIO image type sniffing
58RDEPENDS_${PN} = "shared-mime-info"
59
60FILES_${PN}-xlib = "${libdir}/*pixbuf_xlib*${SOLIBS}"
61ALLOW_EMPTY_${PN}-xlib = "1"
62
63FILES_${PN} += "${libdir}/gdk-pixbuf-2.0/gdk-pixbuf-query-loaders"
64
65FILES_${PN}-bin += "${datadir}/thumbnailers/gdk-pixbuf-thumbnailer.thumbnailer"
66
67FILES_${PN}-dev += " \
68 ${bindir}/gdk-pixbuf-csource \
69 ${bindir}/gdk-pixbuf-pixdata \
70 ${bindir}/gdk-pixbuf-print-mime-types \
71 ${includedir}/* \
72 ${libdir}/gdk-pixbuf-2.0/${LIBV}/loaders/*.la \
73"
74
75PACKAGES_DYNAMIC += "^gdk-pixbuf-loader-.*"
76PACKAGES_DYNAMIC_class-native = ""
77
78python populate_packages_prepend () {
79 postinst_pixbufloader = d.getVar("postinst_pixbufloader")
80
81 loaders_root = d.expand('${libdir}/gdk-pixbuf-2.0/${LIBV}/loaders')
82
83 packages = ' '.join(do_split_packages(d, loaders_root, r'^libpixbufloader-(.*)\.so$', 'gdk-pixbuf-loader-%s', 'GDK pixbuf loader for %s'))
84 d.setVar('PIXBUF_PACKAGES', packages)
85
86 # The test suite exercises all the loaders, so ensure they are all
87 # dependencies of the ptest package.
88 d.appendVar("RDEPENDS_%s-ptest" % d.getVar('PN'), " " + packages)
89}
90
91do_install_append() {
92 # Copy gdk-pixbuf-query-loaders into libdir so it is always available
93 # in multilib builds.
94 cp ${D}/${bindir}/gdk-pixbuf-query-loaders ${D}/${libdir}/gdk-pixbuf-2.0/
95
96}
97
98# Remove a bad fuzzing attempt that sporadically fails without a way to reproduce
99do_install_ptest() {
100 rm ${D}/${datadir}/installed-tests/gdk-pixbuf/pixbuf-randomly-modified.test
101}
102
103do_install_append_class-native() {
104 find ${D}${libdir} -name "libpixbufloader-*.la" -exec rm \{\} \;
105
106 create_wrapper ${D}/${bindir}/gdk-pixbuf-csource \
107 XDG_DATA_DIRS=${STAGING_DATADIR} \
108 GDK_PIXBUF_MODULE_FILE=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/${LIBV}/loaders.cache
109
110 create_wrapper ${D}/${bindir}/gdk-pixbuf-pixdata \
111 XDG_DATA_DIRS=${STAGING_DATADIR} \
112 GDK_PIXBUF_MODULE_FILE=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/${LIBV}/loaders.cache
113
114 create_wrapper ${D}/${bindir}/gdk-pixbuf-print-mime-types \
115 XDG_DATA_DIRS=${STAGING_DATADIR} \
116 GDK_PIXBUF_MODULE_FILE=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/${LIBV}/loaders.cache
117
118 create_wrapper ${D}/${libdir}/gdk-pixbuf-2.0/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
123 create_wrapper ${D}/${bindir}/gdk-pixbuf-query-loaders \
124 XDG_DATA_DIRS=${STAGING_DATADIR} \
125 GDK_PIXBUF_MODULE_FILE=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/${LIBV}/loaders.cache \
126 GDK_PIXBUF_MODULEDIR=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/${LIBV}/loaders
127}
128BBCLASSEXTEND = "native nativesdk"