1 ################################################################################
5 ################################################################################
7 LIBGTK3_VERSION_MAJOR
= 3.22
8 LIBGTK3_VERSION
= $(LIBGTK3_VERSION_MAJOR
).7
9 LIBGTK3_SOURCE
= gtk
+-$(LIBGTK3_VERSION
).
tar.xz
10 LIBGTK3_SITE
= http
://ftp.gnome.org
/pub
/gnome
/sources
/gtk
+/$(LIBGTK3_VERSION_MAJOR
)
11 LIBGTK3_LICENSE
= LGPLv2
+
12 LIBGTK3_LICENSE_FILES
= COPYING
13 LIBGTK3_INSTALL_STAGING
= YES
14 LIBGTK3_AUTORECONF
= YES
17 ac_cv_path_GTK_UPDATE_ICON_CACHE
=$(HOST_DIR
)/usr
/bin
/gtk-update-icon-cache \
18 ac_cv_path_GDK_PIXBUF_CSOURCE
=$(HOST_DIR
)/usr
/bin
/gdk-pixbuf-csource \
19 PKG_CONFIG_FOR_BUILD
=$(HOST_DIR
)/usr
/bin
/pkgconf
23 --enable-explicit-deps
=no \
24 --enable-gtk2-dependency \
25 --disable-introspection
27 # Override pkg-config pkgdatadir variable, it needs the prefix
29 WAYLAND_PROTOCOLS_DATADIR
=$(STAGING_DIR
)/usr
/share
/wayland-protocols
31 LIBGTK3_DEPENDENCIES
= host-pkgconf host-libgtk3 atk libglib2 cairo pango gdk-pixbuf libepoxy
33 ifeq ($(BR2_PACKAGE_LIBGTK3_X11
),y
)
34 LIBGTK3_DEPENDENCIES
+= fontconfig xlib_libX11 xlib_libXext xlib_libXrender xlib_libXi
36 LIBGTK3_CONF_OPTS
+= \
37 --enable-x11-backend \
38 --x-includes
=$(STAGING_DIR
)/usr
/include/X11 \
39 --x-libraries
=$(STAGING_DIR
)/usr
/lib
41 LIBGTK3_CONF_OPTS
+= --disable-x11-backend
44 ifeq ($(BR2_PACKAGE_LIBGTK3_WAYLAND
),y
)
45 LIBGTK3_DEPENDENCIES
+= wayland wayland-protocols libxkbcommon
46 LIBGTK3_CONF_OPTS
+= --enable-wayland-backend
48 LIBGTK3_CONF_OPTS
+= --disable-wayland-backend
51 ifeq ($(BR2_PACKAGE_LIBGTK3_BROADWAY
),y
)
52 LIBGTK3_CONF_OPTS
+= --enable-broadway-backend
54 LIBGTK3_CONF_OPTS
+= --disable-broadway-backend
57 ifeq ($(BR2_PACKAGE_XLIB_LIBXINERAMA
),y
)
58 LIBGTK3_CONF_OPTS
+= --enable-xinerama
59 LIBGTK3_DEPENDENCIES
+= xlib_libXinerama
61 LIBGTK3_CONF_OPTS
+= --disable-xinerama
64 ifeq ($(BR2_PACKAGE_XLIB_LIBXRANDR
),y
)
65 LIBGTK3_CONF_OPTS
+= --enable-xrandr
66 LIBGTK3_DEPENDENCIES
+= xlib_libXrandr
68 LIBGTK3_CONF_OPTS
+= --disable-xrandr
71 ifeq ($(BR2_PACKAGE_XLIB_LIBXCURSOR
),y
)
72 LIBGTK3_DEPENDENCIES
+= xlib_libXcursor
75 ifeq ($(BR2_PACKAGE_XLIB_LIBXFIXES
),y
)
76 LIBGTK3_CONF_OPTS
+= --enable-xfixes
77 LIBGTK3_DEPENDENCIES
+= xlib_libXfixes
79 LIBGTK3_CONF_OPTS
+= --disable-xfixes
82 ifeq ($(BR2_PACKAGE_XLIB_LIBXCOMPOSITE
),y
)
83 LIBGTK3_CONF_OPTS
+= --enable-xcomposite
84 LIBGTK3_DEPENDENCIES
+= xlib_libXcomposite
86 LIBGTK3_CONF_OPTS
+= --disable-xcomposite
89 ifeq ($(BR2_PACKAGE_XLIB_LIBXDAMAGE
),y
)
90 LIBGTK3_CONF_OPTS
+= --enable-xdamage
91 LIBGTK3_DEPENDENCIES
+= xlib_libXdamage
93 LIBGTK3_CONF_OPTS
+= --disable-xdamage
96 ifeq ($(BR2_PACKAGE_XLIB_LIBXKBFILE
),y
)
97 LIBGTK3_CONF_OPTS
+= --enable-xkb
98 LIBGTK3_DEPENDENCIES
+= xlib_libxkbfile
100 LIBGTK3_CONF_OPTS
+= --disable-xkb
103 ifeq ($(BR2_PACKAGE_CUPS
),y
)
104 LIBGTK3_CONF_OPTS
+= --enable-cups
105 LIBGTK3_CONF_ENV
+= ac_cv_path_CUPS_CONFIG
=$(STAGING_DIR
)/usr
/bin
/cups-config
106 LIBGTK3_DEPENDENCIES
+= cups
108 LIBGTK3_CONF_OPTS
+= --disable-cups
111 ifeq ($(BR2_PACKAGE_LIBGTK3_DEMO
),y
)
112 LIBGTK3_DEPENDENCIES
+= hicolor-icon-theme shared-mime-info
114 define LIBGTK3_REMOVE_DEMOS
115 $(RM
) $(TARGET_DIR
)/usr
/bin
/gtk3-demo \
116 $(TARGET_DIR
)/usr
/bin
/gtk3-demo-application
118 LIBGTK3_POST_INSTALL_TARGET_HOOKS
+= LIBGTK3_REMOVE_DEMOS
121 ifeq ($(BR2_PACKAGE_LIBGTK3_TESTS
),y
)
122 LIBGTK3_CONF_OPTS
+= --enable-installed-tests
124 LIBGTK3_CONF_OPTS
+= --disable-installed-tests
127 define LIBGTK3_COMPILE_GLIB_SCHEMAS
128 $(HOST_DIR
)/usr
/bin
/glib-compile-schemas \
129 $(TARGET_DIR
)/usr
/share
/glib-2.0
/schemas
132 LIBGTK3_POST_INSTALL_TARGET_HOOKS
+= LIBGTK3_COMPILE_GLIB_SCHEMAS
134 # gtk+ >= 3.10 can build a native version of gtk-update-icon-cache if
135 # --enable-gtk2-dependency=no is set when invoking './configure'.
137 # Unfortunately, if the target toolchain is based on uClibc, the macro
138 # AM_GLIB_GNU_GETTEXT will detect the libintl built for the target and
139 # will add '-lintl' to the default list of libraries for the linker (used
140 # for both native and target builds).
142 # But no native version of libintl is available (the functions are
143 # provided by glibc). So gtk-update-icon-cache will not build.
145 # As a workaround, we build gtk-update-icon-cache on our own, set
146 # --enable-gtk2-dependency=yes and force './configure' to use our version.
148 HOST_LIBGTK3_DEPENDENCIES
= \
155 HOST_LIBGTK3_CFLAGS
= \
156 `$(HOST_DIR)/usr/bin/pkgconf --cflags --libs gdk-pixbuf-2.0` \
157 `$(HOST_DIR)/usr/bin/pkgconf --cflags --libs gio-2.0`
159 define HOST_LIBGTK3_CONFIGURE_CMDS
160 echo
"#define GETTEXT_PACKAGE \"gtk30\"" >> $(@D
)/gtk
/config.h
161 echo
"#define HAVE_UNISTD_H 1" >> $(@D
)/gtk
/config.h
162 echo
"#define HAVE_FTW_H 1" >> $(@D
)/gtk
/config.h
165 define HOST_LIBGTK3_BUILD_CMDS
166 $(HOSTCC
) $(HOST_CFLAGS
) $(HOST_LDFLAGS
) \
167 $(@D
)/gtk
/updateiconcache.c \
168 $(HOST_LIBGTK3_CFLAGS
) \
169 -o
$(@D
)/gtk
/gtk-update-icon-cache
170 $(HOSTCC
) $(HOST_CFLAGS
) $(HOST_LDFLAGS
) \
171 $(@D
)/gtk
/encodesymbolic.c \
172 $(HOST_LIBGTK3_CFLAGS
) \
173 -o
$(@D
)/gtk
/gtk-encode-symbolic-svg
176 define HOST_LIBGTK3_INSTALL_CMDS
177 $(INSTALL
) -D
-m
0755 $(@D
)/gtk
/gtk-update-icon-cache \
178 $(HOST_DIR
)/usr
/bin
/gtk-update-icon-cache
179 $(INSTALL
) -D
-m
0755 $(@D
)/gtk
/gtk-encode-symbolic-svg \
180 $(HOST_DIR
)/usr
/bin
/gtk-encode-symbolic-svg
183 # Create icon-theme.cache for each of the icon directories/themes
184 # It's not strictly necessary but speeds up lookups
185 define LIBGTK3_UPDATE_ICON_CACHE
186 find
$(TARGET_DIR
)/usr
/share
/icons
-maxdepth
1 -mindepth
1 -type d \
187 -exec
$(HOST_DIR
)/usr
/bin
/gtk-update-icon-cache
{} \
;
189 LIBGTK3_TARGET_FINALIZE_HOOKS
+= LIBGTK3_UPDATE_ICON_CACHE
191 $(eval
$(autotools-package
))
192 $(eval
$(host-autotools-package
))