blob: fb6829a7d1c0360f10bebf05d0e0a2f002b9563b [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 Geissler7e0e3c02022-02-25 20:34:39 +00008LICENSE = "LGPL-2.1-or-later"
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"
Patrick Williams213cb262021-08-07 19:21:33 -050016DEPENDS: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
Patrick Williams03907ee2022-05-01 06:28:52 -050026SRC_URI[sha256sum] = "84acea3acb2411b29134b32015a5b1aaa62844b19c4b1ef8b8971c6b0759f4c6"
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)}"
Patrick Williams213cb262021-08-07 19:21:33 -050040PACKAGECONFIG:class-native = "${GDK_PIXBUF_LOADERS}"
Andrew Geissler82c905d2020-04-13 13:39:40 -050041
Patrick Williams03907ee2022-05-01 06:28:52 -050042PACKAGECONFIG[png] = "-Dpng=enabled,-Dpng=disabled,libpng"
43PACKAGECONFIG[jpeg] = "-Djpeg=enabled,-Djpeg=disabled,jpeg"
44PACKAGECONFIG[tiff] = "-Dtiff=enabled,-Dtiff=disabled,tiff"
Andrew Geisslerc9f78652020-09-18 14:11:35 -050045PACKAGECONFIG[tests] = "-Dinstalled_tests=true,-Dinstalled_tests=false"
Andrew Geissler82c905d2020-04-13 13:39:40 -050046
Patrick Williams213cb262021-08-07 19:21:33 -050047EXTRA_OEMESON:class-target = " \
William A. Kennington IIIac69b482021-06-02 12:28:27 -070048 -Duse_prebuilt_tools=true \
49"
50
Patrick Williams213cb262021-08-07 19:21:33 -050051EXTRA_OEMESON:class-nativesdk = " \
William A. Kennington IIIac69b482021-06-02 12:28:27 -070052 -Duse_prebuilt_tools=true \
53"
54
Andrew Geissler82c905d2020-04-13 13:39:40 -050055PACKAGES =+ "${PN}-xlib"
56
57# For GIO image type sniffing
Patrick Williams213cb262021-08-07 19:21:33 -050058RDEPENDS:${PN} = "shared-mime-info"
Andrew Geissler82c905d2020-04-13 13:39:40 -050059
Patrick Williams213cb262021-08-07 19:21:33 -050060FILES:${PN}-xlib = "${libdir}/*pixbuf_xlib*${SOLIBS}"
61ALLOW_EMPTY:${PN}-xlib = "1"
Andrew Geissler82c905d2020-04-13 13:39:40 -050062
Patrick Williams213cb262021-08-07 19:21:33 -050063FILES:${PN} += "${libdir}/gdk-pixbuf-2.0/gdk-pixbuf-query-loaders"
Andrew Geissler82c905d2020-04-13 13:39:40 -050064
Patrick Williams213cb262021-08-07 19:21:33 -050065FILES:${PN}-bin += "${datadir}/thumbnailers/gdk-pixbuf-thumbnailer.thumbnailer"
Andrew Geissler82c905d2020-04-13 13:39:40 -050066
Patrick Williams213cb262021-08-07 19:21:33 -050067FILES:${PN}-dev += " \
Andrew Geissler82c905d2020-04-13 13:39:40 -050068 ${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-.*"
Patrick Williams213cb262021-08-07 19:21:33 -050076PACKAGES_DYNAMIC:class-native = ""
Andrew Geissler82c905d2020-04-13 13:39:40 -050077
Patrick Williams213cb262021-08-07 19:21:33 -050078python populate_packages:prepend () {
Andrew Geissler82c905d2020-04-13 13:39:40 -050079 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.
Patrick Williams213cb262021-08-07 19:21:33 -050088 d.appendVar("RDEPENDS:%s-ptest" % d.getVar('PN'), " " + packages)
Andrew Geissler82c905d2020-04-13 13:39:40 -050089}
90
Patrick Williams213cb262021-08-07 19:21:33 -050091do_install:append() {
Andrew Geissler82c905d2020-04-13 13:39:40 -050092 # 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
Patrick Williams213cb262021-08-07 19:21:33 -0500103do_install:append:class-native() {
Andrew Geissler82c905d2020-04-13 13:39:40 -0500104 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"