blob: 3145cc2089b861d88984e33e8387d3a322448a64 [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
45PACKAGECONFIG ??= "${GDK_PIXBUF_LOADERS}"
46PACKAGECONFIG_linuxstdbase = "${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)} ${GDK_PIXBUF_LOADERS}"
47PACKAGECONFIG_class-native = "${GDK_PIXBUF_LOADERS}"
48
49PACKAGECONFIG[png] = "-Dpng=true,-Dpng=false,libpng"
50PACKAGECONFIG[jpeg] = "-Djpeg=true,-Djpeg=false,jpeg"
51PACKAGECONFIG[tiff] = "-Dtiff=true,-Dtiff=false,tiff"
52PACKAGECONFIG[jpeg2000] = "-Djasper=true,-Djasper=false,jasper"
53
54PACKAGECONFIG[x11] = "-Dx11=true,-Dx11=false,virtual/libx11"
55
56PACKAGES =+ "${PN}-xlib"
57
58# For GIO image type sniffing
59RDEPENDS_${PN} = "shared-mime-info"
60
61FILES_${PN}-xlib = "${libdir}/*pixbuf_xlib*${SOLIBS}"
62ALLOW_EMPTY_${PN}-xlib = "1"
63
64FILES_${PN} += "${libdir}/gdk-pixbuf-2.0/gdk-pixbuf-query-loaders"
65
66FILES_${PN}-bin += "${datadir}/thumbnailers/gdk-pixbuf-thumbnailer.thumbnailer"
67
68FILES_${PN}-dev += " \
69 ${bindir}/gdk-pixbuf-csource \
70 ${bindir}/gdk-pixbuf-pixdata \
71 ${bindir}/gdk-pixbuf-print-mime-types \
72 ${includedir}/* \
73 ${libdir}/gdk-pixbuf-2.0/${LIBV}/loaders/*.la \
74"
75
76PACKAGES_DYNAMIC += "^gdk-pixbuf-loader-.*"
77PACKAGES_DYNAMIC_class-native = ""
78
79python populate_packages_prepend () {
80 postinst_pixbufloader = d.getVar("postinst_pixbufloader")
81
82 loaders_root = d.expand('${libdir}/gdk-pixbuf-2.0/${LIBV}/loaders')
83
84 packages = ' '.join(do_split_packages(d, loaders_root, r'^libpixbufloader-(.*)\.so$', 'gdk-pixbuf-loader-%s', 'GDK pixbuf loader for %s'))
85 d.setVar('PIXBUF_PACKAGES', packages)
86
87 # The test suite exercises all the loaders, so ensure they are all
88 # dependencies of the ptest package.
89 d.appendVar("RDEPENDS_%s-ptest" % d.getVar('PN'), " " + packages)
90}
91
92do_install_append() {
93 # Copy gdk-pixbuf-query-loaders into libdir so it is always available
94 # in multilib builds.
95 cp ${D}/${bindir}/gdk-pixbuf-query-loaders ${D}/${libdir}/gdk-pixbuf-2.0/
96
97}
98
99do_install_append_class-native() {
100 find ${D}${libdir} -name "libpixbufloader-*.la" -exec rm \{\} \;
101
102 create_wrapper ${D}/${bindir}/gdk-pixbuf-csource \
103 XDG_DATA_DIRS=${STAGING_DATADIR} \
104 GDK_PIXBUF_MODULE_FILE=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/${LIBV}/loaders.cache
105
106 create_wrapper ${D}/${bindir}/gdk-pixbuf-pixdata \
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-print-mime-types \
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}/${libdir}/gdk-pixbuf-2.0/gdk-pixbuf-query-loaders \
115 XDG_DATA_DIRS=${STAGING_DATADIR} \
116 GDK_PIXBUF_MODULE_FILE=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/${LIBV}/loaders.cache \
117 GDK_PIXBUF_MODULEDIR=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/${LIBV}/loaders
118
119 create_wrapper ${D}/${bindir}/gdk-pixbuf-query-loaders \
120 XDG_DATA_DIRS=${STAGING_DATADIR} \
121 GDK_PIXBUF_MODULE_FILE=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/${LIBV}/loaders.cache \
122 GDK_PIXBUF_MODULEDIR=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/${LIBV}/loaders
123}
124BBCLASSEXTEND = "native nativesdk"