blob: eb1adb505048066864d6250ad82d93b51d871291 [file] [log] [blame]
Brad Bishop19323692019-04-05 15:28:33 -04001SUMMARY = "Image loading library for GTK+"
2HOMEPAGE = "http://www.gtk.org/"
3BUGTRACKER = "https://bugzilla.gnome.org/"
4
5LICENSE = "LGPLv2.1"
6LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c \
7 file://gdk-pixbuf/gdk-pixbuf.h;endline=26;md5=72b39da7cbdde2e665329fef618e1d6b \
8 "
9
10SECTION = "libs"
11
12DEPENDS = "glib-2.0 gdk-pixbuf-native shared-mime-info"
13
14MAJ_VER = "${@oe.utils.trim_version("${PV}", 2)}"
15
16SRC_URI = "${GNOME_MIRROR}/${BPN}/${MAJ_VER}/${BPN}-${PV}.tar.xz \
17 file://run-ptest \
18 file://fatal-loader.patch \
19 file://0001-Work-around-thumbnailer-cross-compile-failure.patch \
20 file://0001-Fix-a-couple-of-decisions-around-cross-compilation.patch \
Brad Bishop19323692019-04-05 15:28:33 -040021 file://0004-Do-not-run-tests-when-building.patch \
Brad Bishop15ae2502019-06-18 21:44:24 -040022 file://0006-Build-thumbnailer-and-tests-also-in-cross-builds.patch \
Brad Bishop19323692019-04-05 15:28:33 -040023 "
24
25SRC_URI_append_class-target = " \
26 file://0003-target-only-Work-around-thumbnailer-cross-compile-fa.patch \
27 "
28SRC_URI_append_class-nativesdk = " \
29 file://0003-target-only-Work-around-thumbnailer-cross-compile-fa.patch \
30 "
31
Brad Bishop15ae2502019-06-18 21:44:24 -040032SRC_URI[md5sum] = "f6ba2195acd18c5c9555421f30c31cc1"
33SRC_URI[sha256sum] = "f19ff836ba991031610dcc53774e8ca436160f7d981867c8c3a37acfe493ab3a"
Brad Bishop19323692019-04-05 15:28:33 -040034
35inherit meson pkgconfig gettext pixbufcache ptest-gnome upstream-version-is-even gobject-introspection gtk-doc lib_package
36
Brad Bishopc342db32019-05-15 21:57:59 -040037GIR_MESON_OPTION = 'gir'
Brad Bishop19323692019-04-05 15:28:33 -040038
39EXTRA_OEMESON_append = " ${@bb.utils.contains('PTEST_ENABLED', '1', '-Dinstalled_tests=true', '-Dinstalled_tests=false', d)}"
40
41LIBV = "2.10.0"
42
43GDK_PIXBUF_LOADERS ?= "png jpeg"
44
Brad Bishop08902b02019-08-20 09:16:51 -040045PACKAGECONFIG = "${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)} ${GDK_PIXBUF_LOADERS}"
Brad Bishop19323692019-04-05 15:28:33 -040046PACKAGECONFIG_class-native = "${GDK_PIXBUF_LOADERS}"
47
48PACKAGECONFIG[png] = "-Dpng=true,-Dpng=false,libpng"
49PACKAGECONFIG[jpeg] = "-Djpeg=true,-Djpeg=false,jpeg"
50PACKAGECONFIG[tiff] = "-Dtiff=true,-Dtiff=false,tiff"
51PACKAGECONFIG[jpeg2000] = "-Djasper=true,-Djasper=false,jasper"
52
53PACKAGECONFIG[x11] = "-Dx11=true,-Dx11=false,virtual/libx11"
54
55PACKAGES =+ "${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
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"