1 ################################################################################
5 ################################################################################
7 LIBGTK3_VERSION_MAJOR
= 3.22
8 LIBGTK3_VERSION
= $(LIBGTK3_VERSION_MAJOR
).10
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
25 # Override pkg-config pkgdatadir variable, it needs the prefix
27 WAYLAND_PROTOCOLS_DATADIR
=$(STAGING_DIR
)/usr
/share
/wayland-protocols
29 LIBGTK3_DEPENDENCIES
= host-pkgconf host-libgtk3 atk libglib2 cairo pango gdk-pixbuf libepoxy
31 ifeq ($(BR2_PACKAGE_LIBGTK3_X11
),y
)
32 LIBGTK3_DEPENDENCIES
+= fontconfig xlib_libX11 xlib_libXext xlib_libXrender xlib_libXi
34 LIBGTK3_CONF_OPTS
+= \
35 --enable-x11-backend \
36 --x-includes
=$(STAGING_DIR
)/usr
/include/X11 \
37 --x-libraries
=$(STAGING_DIR
)/usr
/lib
39 LIBGTK3_CONF_OPTS
+= --disable-x11-backend
42 ifeq ($(BR2_PACKAGE_LIBGTK3_WAYLAND
),y
)
43 LIBGTK3_DEPENDENCIES
+= wayland wayland-protocols libxkbcommon
44 LIBGTK3_CONF_OPTS
+= --enable-wayland-backend
46 LIBGTK3_CONF_OPTS
+= --disable-wayland-backend
49 ifeq ($(BR2_PACKAGE_LIBGTK3_BROADWAY
),y
)
50 LIBGTK3_CONF_OPTS
+= --enable-broadway-backend
52 LIBGTK3_CONF_OPTS
+= --disable-broadway-backend
55 ifeq ($(BR2_PACKAGE_XLIB_LIBXINERAMA
),y
)
56 LIBGTK3_CONF_OPTS
+= --enable-xinerama
57 LIBGTK3_DEPENDENCIES
+= xlib_libXinerama
59 LIBGTK3_CONF_OPTS
+= --disable-xinerama
62 ifeq ($(BR2_PACKAGE_XLIB_LIBXRANDR
),y
)
63 LIBGTK3_CONF_OPTS
+= --enable-xrandr
64 LIBGTK3_DEPENDENCIES
+= xlib_libXrandr
66 LIBGTK3_CONF_OPTS
+= --disable-xrandr
69 ifeq ($(BR2_PACKAGE_XLIB_LIBXCURSOR
),y
)
70 LIBGTK3_DEPENDENCIES
+= xlib_libXcursor
73 ifeq ($(BR2_PACKAGE_XLIB_LIBXFIXES
),y
)
74 LIBGTK3_CONF_OPTS
+= --enable-xfixes
75 LIBGTK3_DEPENDENCIES
+= xlib_libXfixes
77 LIBGTK3_CONF_OPTS
+= --disable-xfixes
80 ifeq ($(BR2_PACKAGE_XLIB_LIBXCOMPOSITE
),y
)
81 LIBGTK3_CONF_OPTS
+= --enable-xcomposite
82 LIBGTK3_DEPENDENCIES
+= xlib_libXcomposite
84 LIBGTK3_CONF_OPTS
+= --disable-xcomposite
87 ifeq ($(BR2_PACKAGE_XLIB_LIBXDAMAGE
),y
)
88 LIBGTK3_CONF_OPTS
+= --enable-xdamage
89 LIBGTK3_DEPENDENCIES
+= xlib_libXdamage
91 LIBGTK3_CONF_OPTS
+= --disable-xdamage
94 ifeq ($(BR2_PACKAGE_XLIB_LIBXKBFILE
),y
)
95 LIBGTK3_CONF_OPTS
+= --enable-xkb
96 LIBGTK3_DEPENDENCIES
+= xlib_libxkbfile
98 LIBGTK3_CONF_OPTS
+= --disable-xkb
101 ifeq ($(BR2_PACKAGE_CUPS
),y
)
102 LIBGTK3_CONF_OPTS
+= --enable-cups
103 LIBGTK3_CONF_ENV
+= ac_cv_path_CUPS_CONFIG
=$(STAGING_DIR
)/usr
/bin
/cups-config
104 LIBGTK3_DEPENDENCIES
+= cups
106 LIBGTK3_CONF_OPTS
+= --disable-cups
109 ifeq ($(BR2_PACKAGE_LIBGTK3_DEMO
),y
)
110 LIBGTK3_DEPENDENCIES
+= hicolor-icon-theme shared-mime-info
112 define LIBGTK3_REMOVE_DEMOS
113 $(RM
) $(TARGET_DIR
)/usr
/bin
/gtk3-demo \
114 $(TARGET_DIR
)/usr
/bin
/gtk3-demo-application
116 LIBGTK3_POST_INSTALL_TARGET_HOOKS
+= LIBGTK3_REMOVE_DEMOS
119 ifeq ($(BR2_PACKAGE_LIBGTK3_TESTS
),y
)
120 LIBGTK3_CONF_OPTS
+= --enable-installed-tests
122 LIBGTK3_CONF_OPTS
+= --disable-installed-tests
125 define LIBGTK3_COMPILE_GLIB_SCHEMAS
126 $(HOST_DIR
)/usr
/bin
/glib-compile-schemas \
127 $(TARGET_DIR
)/usr
/share
/glib-2.0
/schemas
130 LIBGTK3_POST_INSTALL_TARGET_HOOKS
+= LIBGTK3_COMPILE_GLIB_SCHEMAS
132 # gtk+ >= 3.10 can build a native version of gtk-update-icon-cache if
133 # --enable-gtk2-dependency=no is set when invoking './configure'.
135 # Unfortunately, if the target toolchain is based on uClibc, the macro
136 # AM_GLIB_GNU_GETTEXT will detect the libintl built for the target and
137 # will add '-lintl' to the default list of libraries for the linker (used
138 # for both native and target builds).
140 # But no native version of libintl is available (the functions are
141 # provided by glibc). So gtk-update-icon-cache will not build.
143 # As a workaround, we build gtk-update-icon-cache on our own, set
144 # --enable-gtk2-dependency=yes and force './configure' to use our version.
146 HOST_LIBGTK3_DEPENDENCIES
= \
153 HOST_LIBGTK3_CFLAGS
= \
154 `$(HOST_DIR)/usr/bin/pkgconf --cflags --libs gdk-pixbuf-2.0` \
155 `$(HOST_DIR)/usr/bin/pkgconf --cflags --libs gio-2.0`
157 define HOST_LIBGTK3_CONFIGURE_CMDS
158 echo
"#define GETTEXT_PACKAGE \"gtk30\"" >> $(@D
)/gtk
/config.h
159 echo
"#define HAVE_UNISTD_H 1" >> $(@D
)/gtk
/config.h
160 echo
"#define HAVE_FTW_H 1" >> $(@D
)/gtk
/config.h
163 define HOST_LIBGTK3_BUILD_CMDS
164 $(HOSTCC
) $(HOST_CFLAGS
) $(HOST_LDFLAGS
) \
165 $(@D
)/gtk
/updateiconcache.c \
166 $(HOST_LIBGTK3_CFLAGS
) \
167 -o
$(@D
)/gtk
/gtk-update-icon-cache
168 $(HOSTCC
) $(HOST_CFLAGS
) $(HOST_LDFLAGS
) \
169 $(@D
)/gtk
/encodesymbolic.c \
170 $(HOST_LIBGTK3_CFLAGS
) \
171 -o
$(@D
)/gtk
/gtk-encode-symbolic-svg
174 define HOST_LIBGTK3_INSTALL_CMDS
175 $(INSTALL
) -D
-m
0755 $(@D
)/gtk
/gtk-update-icon-cache \
176 $(HOST_DIR
)/usr
/bin
/gtk-update-icon-cache
177 $(INSTALL
) -D
-m
0755 $(@D
)/gtk
/gtk-encode-symbolic-svg \
178 $(HOST_DIR
)/usr
/bin
/gtk-encode-symbolic-svg
181 # Create icon-theme.cache for each of the icon directories/themes
182 # It's not strictly necessary but speeds up lookups
183 define LIBGTK3_UPDATE_ICON_CACHE
184 find
$(TARGET_DIR
)/usr
/share
/icons
-maxdepth
1 -mindepth
1 -type d \
185 -exec
$(HOST_DIR
)/usr
/bin
/gtk-update-icon-cache
{} \
;
187 LIBGTK3_TARGET_FINALIZE_HOOKS
+= LIBGTK3_UPDATE_ICON_CACHE
189 $(eval
$(autotools-package
))
190 $(eval
$(host-autotools-package
))