blob: dcd01b14eafa73556654e61c6de749fab25df28d [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001SUMMARY = "Image loading library for GTK+"
2HOMEPAGE = "http://www.gtk.org/"
3BUGTRACKER = "https://bugzilla.gnome.org/"
4
5LICENSE = "LGPLv2"
6LIC_FILES_CHKSUM = "file://COPYING;md5=3bf50002aefd002f49e7bb854063f7e7 \
7 file://gdk-pixbuf/gdk-pixbuf.h;endline=26;md5=72b39da7cbdde2e665329fef618e1d6b"
8
9SECTION = "libs"
10
11DEPENDS = "glib-2.0"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050012
13MAJ_VER = "${@oe.utils.trim_version("${PV}", 2)}"
14
15SRC_URI = "${GNOME_MIRROR}/${BPN}/${MAJ_VER}/${BPN}-${PV}.tar.xz \
16 file://hardcoded_libtool.patch \
17 file://extending-libinstall-dependencies.patch \
18 file://run-ptest \
19 file://fatal-loader.patch \
20 file://0001-pixops-Be-more-careful-about-integer-overflow.patch \
Patrick Williamsf1e5d692016-03-30 15:21:19 -050021 file://CVE-2015-7674.patch \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050022 "
23
24SRC_URI[md5sum] = "4fed0d54432f1b69fc6e66e608bd5542"
25SRC_URI[sha256sum] = "4853830616113db4435837992c0aebd94cbb993c44dc55063cee7f72a7bef8be"
26
27inherit autotools pkgconfig gettext pixbufcache ptest-gnome
28
29LIBV = "2.10.0"
30
31GDK_PIXBUF_LOADERS ?= "png jpeg"
32
33PACKAGECONFIG ??= "${GDK_PIXBUF_LOADERS}"
34PACKAGECONFIG_linuxstdbase = "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)} ${GDK_PIXBUF_LOADERS}"
35PACKAGECONFIG_class-native = "${GDK_PIXBUF_LOADERS}"
36
37PACKAGECONFIG[png] = "--with-libpng,--without-libpng,libpng"
38PACKAGECONFIG[jpeg] = "--with-libjpeg,--without-libjpeg,jpeg"
39PACKAGECONFIG[tiff] = "--with-libtiff,--without-libtiff,tiff"
40PACKAGECONFIG[jpeg2000] = "--with-libjasper,--without-libjasper,jasper"
41
42# Use GIO to sniff image format instead of trying all loaders
43PACKAGECONFIG[gio-sniff] = "--enable-gio-sniffing,--disable-gio-sniffing,,shared-mime-info"
44PACKAGECONFIG[x11] = "--with-x11,--without-x11,virtual/libx11"
45
46EXTRA_OECONF = "--disable-introspection"
47
48PACKAGES =+ "${PN}-xlib"
49
50FILES_${PN}-xlib = "${libdir}/*pixbuf_xlib*${SOLIBS}"
51ALLOW_EMPTY_${PN}-xlib = "1"
52
Patrick Williamsf1e5d692016-03-30 15:21:19 -050053FILES_${PN} = "${libdir}/gdk-pixbuf-2.0/gdk-pixbuf-query-loaders \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050054 ${libdir}/lib*.so.*"
55
56FILES_${PN}-dev += " \
57 ${bindir}/gdk-pixbuf-csource \
Patrick Williamsf1e5d692016-03-30 15:21:19 -050058 ${bindir}/gdk-pixbuf-pixdata \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050059 ${includedir}/* \
60 ${libdir}/gdk-pixbuf-2.0/${LIBV}/loaders/*.la \
61"
62
63FILES_${PN}-dbg += " \
Patrick Williamsf1e5d692016-03-30 15:21:19 -050064 ${libdir}/.debug/* \
65 ${libdir}/gdk-pixbuf-2.0/.debug/* \
Patrick Williamsc124f4f2015-09-15 14:41:29 -050066 ${libdir}/gdk-pixbuf-2.0/${LIBV}/loaders/.debug/* \
67"
68
69PACKAGES_DYNAMIC += "^gdk-pixbuf-loader-.*"
70PACKAGES_DYNAMIC_class-native = ""
71
72python populate_packages_prepend () {
73 postinst_pixbufloader = d.getVar("postinst_pixbufloader", True)
74
75 loaders_root = d.expand('${libdir}/gdk-pixbuf-2.0/${LIBV}/loaders')
76
77 packages = ' '.join(do_split_packages(d, loaders_root, '^libpixbufloader-(.*)\.so$', 'gdk-pixbuf-loader-%s', 'GDK pixbuf loader for %s'))
78 d.setVar('PIXBUF_PACKAGES', packages)
79
80 # The test suite exercises all the loaders, so ensure they are all
81 # dependencies of the ptest package.
82 d.appendVar("RDEPENDS_gdk-pixbuf-ptest", " " + packages)
83}
84
Patrick Williamsf1e5d692016-03-30 15:21:19 -050085do_install_append() {
86 # Move gdk-pixbuf-query-loaders into libdir so it is always available
87 # in multilib builds.
88 mv ${D}/${bindir}/gdk-pixbuf-query-loaders ${D}/${libdir}/gdk-pixbuf-2.0/
89}
90
Patrick Williamsc124f4f2015-09-15 14:41:29 -050091do_install_append_class-native() {
92 find ${D}${libdir} -name "libpixbufloader-*.la" -exec rm \{\} \;
93
94 create_wrapper ${D}/${bindir}/gdk-pixbuf-csource \
95 GDK_PIXBUF_MODULE_FILE=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/${LIBV}/loaders.cache
96
97 create_wrapper ${D}/${bindir}/gdk-pixbuf-pixdata \
98 GDK_PIXBUF_MODULE_FILE=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/${LIBV}/loaders.cache
99
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500100 create_wrapper ${D}/${libdir}/gdk-pixbuf-2.0/gdk-pixbuf-query-loaders \
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500101 GDK_PIXBUF_MODULE_FILE=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/${LIBV}/loaders.cache \
102 GDK_PIXBUF_MODULEDIR=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/${LIBV}/loaders
103}
104BBCLASSEXTEND = "native"
Patrick Williamsf1e5d692016-03-30 15:21:19 -0500105
106SSTATEPREINSTFUNCS_append_class-native = " gdkpixbuf_sstate_preinst"
107SYSROOT_PREPROCESS_FUNCS_append_class-native = " gdkpixbuf_sstate_preinst"
108
109gdkpixbuf_sstate_preinst() {
110 if [ "${BB_CURRENTTASK}" = "populate_sysroot" ]; then
111 rm -rf ${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/${LIBV}/*
112 fi
113}