780eb4f67c80aee30e3c8e1a69c9c34f6420b3a4
[openwrt/svn-archive/archive.git] / Xorg / lib / gtk2 / Makefile
1 #
2 # Copyright (C) 2008-2010 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_MD5SUM:=a1a1f0b66a240c31cb2733643f9170ba
18
19 PKG_FIXUP:=libtool
20 PKG_INSTALL:=1
21
22 include $(INCLUDE_DIR)/package.mk
23
24 TARGET_CFLAGS+=\
25 -I$(STAGING_DIR)/usr/lib/libintl/include/ \
26 -I$(STAGING_DIR)/usr/lib/libiconv/include/
27
28 TARGET_LDFLAGS+=\
29 -Wl,-rpath-link=$(STAGING_DIR)/usr/lib \
30 -L$(STAGING_DIR)/usr/lib/libintl/lib/ \
31 -L$(STAGING_DIR)/usr/lib/libiconv/lib/
32
33 STAMP_CONFIGURED:=$(STAMP_CONFIGURED)_$(call confvar,CONFIG_PACKAGE_gtk2 CONFIG_PACKAGE_gtk2-cups)
34
35 # We can _either_ compile gtk2 with directfb-support _or_ against libX11 (libX11 is preferred when both libs are selected)
36
37 define Package/gtk2
38 SECTION:=xorg-framework
39 CATEGORY:=Xorg
40 SUBMENU:=framework
41 TITLE:=GTK+-2.0
42 DEPENDS:=+cairo +pango +libpng +libjpeg +atk +libtiff \
43 +FEATURE_drawing-backend_DirectFB:DirectFB \
44 +FEATURE_drawing-backend_libX11:libX11 \
45 +FEATURE_drawing-backend_libX11:libXext \
46 +FEATURE_drawing-backend_libX11:libXrender \
47 +FEATURE_drawing-backend_libX11:libXfixes \
48 +FEATURE_drawing-backend_libX11:libXrandr \
49 +FEATURE_drawing-backend_libX11:libXcursor \
50 +FEATURE_drawing-backend_libX11:libXdamage \
51 +FEATURE_drawing-backend_libX11:libXcomposite \
52 +FEATURE_drawing-backend_libX11:libXi
53 URL:=http://www.gtk.org/
54 endef
55
56 define Package/gtk2-cups
57 SECTION:=xorg-framework
58 CATEGORY:=Xorg
59 SUBMENU:=framework
60 TITLE:=CUPS print backend for GTK+-2.0
61 DEPENDS:=gtk2 +cups
62 endef
63
64 define Build/Configure
65 $(call Build/Configure/Default, \
66 --enable-shm \
67 --disable-xkb \
68 --disable-glibtest \
69 --disable-gdiplus \
70 --disable-xinerama \
71 --without-libjasper \
72 --without-xinput \
73 $(if $(CONFIG_FEATURE_drawing-backend_DirectFB),--with-gdktarget=directfb,) \
74 $(if $(CONFIG_FEATURE_drawing-backend_libX11),--with-x --with-gdktarget=x11,--without-x) \
75 $(if $(CONFIG_PACKAGE_gtk2-cups),--enable-cups=auto,--disable-cups), \
76 gio_can_sniff=no \
77 )
78 endef
79
80 define Build/InstallDev
81 $(INSTALL_DIR) $(1)/usr/{lib/pkgconfig,include}
82 $(CP) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
83 $(CP) $(PKG_INSTALL_DIR)/usr/lib/gtk-2.0/include/* $(1)/usr/include/
84
85 $(CP) \
86 $(PKG_INSTALL_DIR)/usr/lib/*.{so*,a,la} \
87 $(1)/usr/lib/
88
89 $(INSTALL_DATA) \
90 $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/* \
91 $(1)/usr/lib/pkgconfig/
92 endef
93
94 define Package/gtk2/install
95 $(INSTALL_DIR) $(1)/etc/gtk-2.0
96 $(INSTALL_DATA) \
97 $(PKG_INSTALL_DIR)/etc/gtk-2.0/* \
98 $(1)/etc/gtk-2.0/
99
100 $(INSTALL_DIR) $(1)/usr/lib
101 $(CP) \
102 $(PKG_INSTALL_DIR)/usr/lib/*.so* \
103 $(1)/usr/lib/
104
105 $(foreach d,engines immodules loaders, \
106 $(INSTALL_DIR) $(1)/usr/lib/gtk-2.0/2.10.0/$(d); \
107 $(INSTALL_DATA) \
108 $(PKG_INSTALL_DIR)/usr/lib/gtk-2.0/2.10.0/$(d)/*.so \
109 $(1)/usr/lib/gtk-2.0/2.10.0/$(d)/;\
110 )
111 $(INSTALL_DIR) $(1)/usr/lib/gtk-2.0/2.10.0/printbackends/
112 $(INSTALL_DATA) \
113 $(PKG_INSTALL_DIR)/usr/lib/gtk-2.0/2.10.0/printbackends/libprintbackend-{file,lpr}.so \
114 $(1)/usr/lib/gtk-2.0/2.10.0/printbackends/
115
116 $(INSTALL_DIR) $(1)/usr/bin/
117 $(INSTALL_BIN) \
118 $(PKG_INSTALL_DIR)/usr/bin/{gdk-pixbuf-query-loaders,gtk-query-immodules-2.0,gtk-update-icon-cache} \
119 $(1)/usr/bin/
120
121 $(INSTALL_DIR) $(1)/usr/share/themes/
122 $(CP) \
123 $(PKG_INSTALL_DIR)/usr/share/themes/* \
124 $(1)/usr/share/themes/
125
126 $(INSTALL_DIR) $(1)/etc/init.d/
127 $(INSTALL_BIN) ./files/gdk-pixbuf-query-loaders.init $(1)/etc/init.d/gdk-pixbuf-query-loaders
128 endef
129
130 define Package/gtk2-cups/install
131 $(INSTALL_DIR) $(1)/usr/lib/gtk-2.0/2.10.0/printbackends/
132 $(INSTALL_DATA) \
133 $(PKG_INSTALL_DIR)/usr/lib/gtk-2.0/2.10.0/printbackends/libprintbackend-cups.so \
134 $(1)/usr/lib/gtk-2.0/2.10.0/printbackends/
135 endef
136
137 $(eval $(call BuildPackage,gtk2))
138 $(eval $(call BuildPackage,gtk2-cups))