blob: c5de7a92a5d44c4ce25e12bfff71aa8787d87a53 [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 \
21 file://0001-loaders.cache-depend-on-loaders-being-fully-build.patch \
22 file://0004-Do-not-run-tests-when-building.patch \
23 "
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
32SRC_URI[md5sum] = "77765f24496dc8c90c6e0cbe10fd8f0e"
33SRC_URI[sha256sum] = "dd50973c7757bcde15de6bcd3a6d462a445efd552604ae6435a0532fbbadae47"
34
35inherit meson pkgconfig gettext pixbufcache ptest-gnome upstream-version-is-even gobject-introspection gtk-doc lib_package
36
37GTKDOC_ENABLE_FLAG = "-Ddocs=true"
38GTKDOC_DISABLE_FLAG = "-Ddocs=false"
39
40GI_ENABLE_FLAG = "-Dgir=true"
41GI_DISABLE_FLAG = "-Dgir=false"
42
43EXTRA_OEMESON_append_class-nativesdk = " ${GI_DISABLE_FLAG}"
44
45EXTRA_OEMESON_append_class-target = " ${@bb.utils.contains('GI_DATA_ENABLED', 'True', '${GI_ENABLE_FLAG}', \
46 '${GI_DISABLE_FLAG}', d)} "
47
48EXTRA_OEMESON_append_class-target = " ${@bb.utils.contains('GTKDOC_ENABLED', 'True', '${GTKDOC_ENABLE_FLAG}', \
49 '${GTKDOC_DISABLE_FLAG}', d)} "
50
51EXTRA_OEMESON_append = " ${@bb.utils.contains('PTEST_ENABLED', '1', '-Dinstalled_tests=true', '-Dinstalled_tests=false', d)}"
52
53LIBV = "2.10.0"
54
55GDK_PIXBUF_LOADERS ?= "png jpeg"
56
57PACKAGECONFIG ??= "${GDK_PIXBUF_LOADERS}"
58PACKAGECONFIG_linuxstdbase = "${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)} ${GDK_PIXBUF_LOADERS}"
59PACKAGECONFIG_class-native = "${GDK_PIXBUF_LOADERS}"
60
61PACKAGECONFIG[png] = "-Dpng=true,-Dpng=false,libpng"
62PACKAGECONFIG[jpeg] = "-Djpeg=true,-Djpeg=false,jpeg"
63PACKAGECONFIG[tiff] = "-Dtiff=true,-Dtiff=false,tiff"
64PACKAGECONFIG[jpeg2000] = "-Djasper=true,-Djasper=false,jasper"
65
66PACKAGECONFIG[x11] = "-Dx11=true,-Dx11=false,virtual/libx11"
67
68PACKAGES =+ "${PN}-xlib"
69
70# For GIO image type sniffing
71RDEPENDS_${PN} = "shared-mime-info"
72
73FILES_${PN}-xlib = "${libdir}/*pixbuf_xlib*${SOLIBS}"
74ALLOW_EMPTY_${PN}-xlib = "1"
75
76FILES_${PN} += "${libdir}/gdk-pixbuf-2.0/gdk-pixbuf-query-loaders"
77
78FILES_${PN}-bin += "${datadir}/thumbnailers/gdk-pixbuf-thumbnailer.thumbnailer"
79
80FILES_${PN}-dev += " \
81 ${bindir}/gdk-pixbuf-csource \
82 ${bindir}/gdk-pixbuf-pixdata \
83 ${bindir}/gdk-pixbuf-print-mime-types \
84 ${includedir}/* \
85 ${libdir}/gdk-pixbuf-2.0/${LIBV}/loaders/*.la \
86"
87
88PACKAGES_DYNAMIC += "^gdk-pixbuf-loader-.*"
89PACKAGES_DYNAMIC_class-native = ""
90
91python populate_packages_prepend () {
92 postinst_pixbufloader = d.getVar("postinst_pixbufloader")
93
94 loaders_root = d.expand('${libdir}/gdk-pixbuf-2.0/${LIBV}/loaders')
95
96 packages = ' '.join(do_split_packages(d, loaders_root, r'^libpixbufloader-(.*)\.so$', 'gdk-pixbuf-loader-%s', 'GDK pixbuf loader for %s'))
97 d.setVar('PIXBUF_PACKAGES', packages)
98
99 # The test suite exercises all the loaders, so ensure they are all
100 # dependencies of the ptest package.
101 d.appendVar("RDEPENDS_%s-ptest" % d.getVar('PN'), " " + packages)
102}
103
104do_install_append() {
105 # Copy gdk-pixbuf-query-loaders into libdir so it is always available
106 # in multilib builds.
107 cp ${D}/${bindir}/gdk-pixbuf-query-loaders ${D}/${libdir}/gdk-pixbuf-2.0/
108
109}
110
111do_install_append_class-native() {
112 find ${D}${libdir} -name "libpixbufloader-*.la" -exec rm \{\} \;
113
114 create_wrapper ${D}/${bindir}/gdk-pixbuf-csource \
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}/${bindir}/gdk-pixbuf-pixdata \
119 XDG_DATA_DIRS=${STAGING_DATADIR} \
120 GDK_PIXBUF_MODULE_FILE=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/${LIBV}/loaders.cache
121
122 create_wrapper ${D}/${bindir}/gdk-pixbuf-print-mime-types \
123 XDG_DATA_DIRS=${STAGING_DATADIR} \
124 GDK_PIXBUF_MODULE_FILE=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/${LIBV}/loaders.cache
125
126 create_wrapper ${D}/${libdir}/gdk-pixbuf-2.0/gdk-pixbuf-query-loaders \
127 XDG_DATA_DIRS=${STAGING_DATADIR} \
128 GDK_PIXBUF_MODULE_FILE=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/${LIBV}/loaders.cache \
129 GDK_PIXBUF_MODULEDIR=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/${LIBV}/loaders
130
131 create_wrapper ${D}/${bindir}/gdk-pixbuf-query-loaders \
132 XDG_DATA_DIRS=${STAGING_DATADIR} \
133 GDK_PIXBUF_MODULE_FILE=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/${LIBV}/loaders.cache \
134 GDK_PIXBUF_MODULEDIR=${STAGING_LIBDIR_NATIVE}/gdk-pixbuf-2.0/${LIBV}/loaders
135}
136BBCLASSEXTEND = "native nativesdk"