]> rtime.felk.cvut.cz Git - coffee/buildroot.git/blob - package/gdk-pixbuf/gdk-pixbuf.mk
Globally replace $(HOST_DIR)/usr/bin with $(HOST_DIR)/bin
[coffee/buildroot.git] / package / gdk-pixbuf / gdk-pixbuf.mk
1 ################################################################################
2 #
3 # gdk-pixbuf
4 #
5 ################################################################################
6
7 GDK_PIXBUF_VERSION_MAJOR = 2.36
8 GDK_PIXBUF_VERSION = $(GDK_PIXBUF_VERSION_MAJOR).6
9 GDK_PIXBUF_SOURCE = gdk-pixbuf-$(GDK_PIXBUF_VERSION).tar.xz
10 GDK_PIXBUF_SITE = http://ftp.gnome.org/pub/gnome/sources/gdk-pixbuf/$(GDK_PIXBUF_VERSION_MAJOR)
11 GDK_PIXBUF_LICENSE = LGPL-2.0+
12 GDK_PIXBUF_LICENSE_FILES = COPYING
13 GDK_PIXBUF_INSTALL_STAGING = YES
14 GDK_PIXBUF_DEPENDENCIES = \
15         host-gdk-pixbuf host-libglib2 host-pkgconf \
16         libglib2 $(if $(BR2_ENABLE_LOCALE),,libiconv)
17 HOST_GDK_PIXBUF_DEPENDENCIES = host-libpng host-pkgconf host-libglib2
18
19 GDK_PIXBUF_CONF_ENV = \
20         ac_cv_path_GLIB_GENMARSHAL=$(LIBGLIB2_HOST_BINARY) \
21         gio_can_sniff=no
22
23 GDK_PIXBUF_CONF_OPTS = --disable-glibtest
24
25 ifneq ($(BR2_PACKAGE_LIBPNG),y)
26 GDK_PIXBUF_CONF_OPTS += --without-libpng
27 else
28 GDK_PIXBUF_DEPENDENCIES += libpng
29 endif
30
31 ifneq ($(BR2_PACKAGE_JPEG),y)
32 HOST_GDK_PIXBUF_CONF_OPTS += --without-libjpeg
33 GDK_PIXBUF_CONF_OPTS += --without-libjpeg
34 else
35 GDK_PIXBUF_DEPENDENCIES += jpeg
36 HOST_GDK_PIXBUF_DEPENDENCIES += host-libjpeg
37 endif
38
39 ifneq ($(BR2_PACKAGE_TIFF),y)
40 GDK_PIXBUF_CONF_OPTS += --without-libtiff
41 HOST_GDK_PIXBUF_CONF_OPTS += --without-libtiff
42 else
43 GDK_PIXBUF_DEPENDENCIES += tiff
44 GDK_PIXBUF_CONF_ENV += \
45         LIBS="`$(PKG_CONFIG_HOST_BINARY) --libs libtiff-4`"
46 HOST_GDK_PIXBUF_DEPENDENCIES += host-tiff
47 endif
48
49 ifeq ($(BR2_PACKAGE_XLIB_LIBX11),y)
50 GDK_PIXBUF_CONF_OPTS += --with-x11
51 GDK_PIXBUF_DEPENDENCIES += xlib_libX11
52 endif
53
54 # gdk-pixbuf requires the loaders.cache file populated to work properly
55 # Rather than doing so at runtime, since the fs can be read-only, do so
56 # here after building and installing to target.
57 # And since the cache file will contain absolute host directory names we
58 # need to sanitize (strip) them.
59 ifeq ($(BR2_STATIC_LIBS),)
60 define GDK_PIXBUF_UPDATE_CACHE
61         GDK_PIXBUF_MODULEDIR=$(HOST_DIR)/usr/lib/gdk-pixbuf-2.0/2.10.0/loaders \
62                 $(HOST_DIR)/bin/gdk-pixbuf-query-loaders \
63                 > $(TARGET_DIR)/usr/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache
64         $(SED) "s,$(HOST_DIR),,g" \
65                 $(TARGET_DIR)/usr/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache
66 endef
67 GDK_PIXBUF_POST_INSTALL_TARGET_HOOKS += GDK_PIXBUF_UPDATE_CACHE
68 endif
69
70 # Tests don't build correctly with uClibc
71 define GDK_PIXBUF_DISABLE_TESTS
72         $(SED) 's/ tests//' $(@D)/Makefile.in
73 endef
74 GDK_PIXBUF_POST_PATCH_HOOKS += GDK_PIXBUF_DISABLE_TESTS
75
76 # Target gdk-pixbuf needs loaders.cache populated to build for the
77 # thumbnailer. Use the host-built since it matches the target options
78 # regarding mime types (which is the used information).
79 define GDK_PIXBUF_COPY_LOADERS_CACHE
80         cp -f $(HOST_DIR)/usr/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache \
81                 $(@D)/gdk-pixbuf
82 endef
83 GDK_PIXBUF_PRE_BUILD_HOOKS += GDK_PIXBUF_COPY_LOADERS_CACHE
84
85 $(eval $(autotools-package))
86 $(eval $(host-autotools-package))