make use of feature-flag "drawing backend" to choose whether linking e.g. against...
[openwrt/svn-archive/archive.git] / Xorg / lib / gtk2 / Makefile
1 #
2 # Copyright (C) 2008-2009 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=gtk2
11 PKG_VERSION:=2.17.0
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=gtk+-$(PKG_VERSION).tar.bz2
15 PKG_SOURCE_URL:=@GNOME/gtk+/2.17
16 PKG_BUILD_DIR=$(BUILD_DIR)/gtk+-$(PKG_VERSION)
17 PKG_FIXUP:=libtool
18
19 include $(INCLUDE_DIR)/package.mk
20
21 PKG_INSTALL:=1
22
23 TARGET_CFLAGS+=\
24 -I$(STAGING_DIR)/usr/lib/libintl/include/ \
25 -I$(STAGING_DIR)/usr/lib/libiconv/include/
26
27 TARGET_LDFLAGS+=\
28 -Wl,-rpath-link=$(STAGING_DIR)/usr/lib \
29 -L$(STAGING_DIR)/usr/lib/libintl/lib/ \
30 -L$(STAGING_DIR)/usr/lib/libiconv/lib/
31
32 STAMP_CONFIGURED:=$(STAMP_CONFIGURED)_$(call confvar,CONFIG_PACKAGE_gtk2 CONFIG_PACKAGE_gtk2-cups)
33
34 # We can _either_ compile gtk2 with directfb-support _or_ against libX11 (libX11 is preferred when both libs are selected)
35
36 define Package/gtk2
37 SECTION:=xorg-framework
38 CATEGORY:=Xorg
39 SUBMENU:=framework
40 TITLE:=GTK+-2.0
41 DEPENDS:=+cairo +pango +libpng +libjpeg +atk +libtiff \
42 +FEATURE_drawing-backend_DirectFB:DirectFB \
43 +FEATURE_drawing-backend_libX11:libX11 \
44 +FEATURE_drawing-backend_libX11:libXext \
45 +FEATURE_drawing-backend_libX11:libXrender \
46 +FEATURE_drawing-backend_libX11:libXfixes \
47 +FEATURE_drawing-backend_libX11:libXrandr \
48 +FEATURE_drawing-backend_libX11:libXcursor \
49 +FEATURE_drawing-backend_libX11:libXdamage \
50 +FEATURE_drawing-backend_libX11:libXcomposite \
51 +FEATURE_drawing-backend_libX11:libXi
52 endef
53
54 define Package/gtk2-cups
55 SECTION:=xorg-framework
56 CATEGORY:=Xorg
57 SUBMENU:=framework
58 TITLE:=CUPS print backend for GTK+-2.0
59 DEPENDS:=gtk2 +cups
60 endef
61
62 define Build/Configure
63 $(call Build/Configure/Default, \
64 --enable-shm \
65 --disable-xkb \
66 --disable-glibtest \
67 --disable-gdiplus \
68 --disable-xinerama \
69 --without-libjasper \
70 --without-xinput \
71 $(if $(CONFIG_FEATURE_drawing-backend_DirectFB),--with-gdktarget=directfb,) \
72 $(if $(CONFIG_FEATURE_drawing-backend_libX11),--with-x --with-gdktarget=x11,--without-x) \
73 $(if $(CONFIG_PACKAGE_gtk2-cups),--enable-cups=auto,--disable-cups), \
74 gio_can_sniff=no \
75 )
76 endef
77
78 define Build/InstallDev
79 $(INSTALL_DIR) $(1)/usr/{lib/pkgconfig,include}
80 $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
81 $(CP) $(PKG_INSTALL_DIR)/usr/lib/gtk-2.0/include/* $(1)/usr/include/
82
83 $(CP) \
84 $(PKG_INSTALL_DIR)/usr/lib/*.{so*,a,la} \
85 $(1)/usr/lib/
86
87 $(INSTALL_DATA) \
88 $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/* \
89 $(1)/usr/lib/pkgconfig/
90 endef
91
92 define Package/gtk2/install
93 $(INSTALL_DIR) $(1)/etc/gtk-2.0
94 $(INSTALL_DATA) \
95 $(PKG_INSTALL_DIR)/etc/gtk-2.0/* \
96 $(1)/etc/gtk-2.0/
97
98 $(INSTALL_DIR) $(1)/usr/lib
99 $(CP) \
100 $(PKG_INSTALL_DIR)/usr/lib/*.so* \
101 $(1)/usr/lib/
102
103 $(foreach d,engines immodules loaders, \
104 $(INSTALL_DIR) $(1)/usr/lib/gtk-2.0/2.10.0/$(d); \
105 $(INSTALL_DATA) \
106 $(PKG_INSTALL_DIR)/usr/lib/gtk-2.0/2.10.0/$(d)/*.so \
107 $(1)/usr/lib/gtk-2.0/2.10.0/$(d)/;\
108 )
109 $(INSTALL_DIR) $(1)/usr/lib/gtk-2.0/2.10.0/printbackends/
110 $(INSTALL_DATA) \
111 $(PKG_INSTALL_DIR)/usr/lib/gtk-2.0/2.10.0/printbackends/libprintbackend-{file,lpr}.so \
112 $(1)/usr/lib/gtk-2.0/2.10.0/printbackends/
113
114 $(INSTALL_DIR) $(1)/usr/bin/
115 $(INSTALL_BIN) \
116 $(PKG_INSTALL_DIR)/usr/bin/{gdk-pixbuf-query-loaders,gtk-query-immodules-2.0,gtk-update-icon-cache} \
117 $(1)/usr/bin/
118
119 $(INSTALL_DIR) $(1)/usr/share/themes/
120 $(CP) \
121 $(PKG_INSTALL_DIR)/usr/share/themes/* \
122 $(1)/usr/share/themes/
123
124 $(INSTALL_DIR) $(1)/etc/init.d/
125 $(INSTALL_BIN) ./files/gdk-pixbuf-query-loaders.init $(1)/etc/init.d/gdk-pixbuf-query-loaders
126 endef
127
128 define Package/gtk2-cups/install
129 $(INSTALL_DIR) $(1)/usr/lib/gtk-2.0/2.10.0/printbackends/
130 $(INSTALL_DATA) \
131 $(PKG_INSTALL_DIR)/usr/lib/gtk-2.0/2.10.0/printbackends/libprintbackend-cups.so \
132 $(1)/usr/lib/gtk-2.0/2.10.0/printbackends/
133 endef
134
135 $(eval $(call BuildPackage,gtk2))
136 $(eval $(call BuildPackage,gtk2-cups))