Add mesa packages.
[openwrt/svn-archive/archive.git] / Xorg / lib / mesa / Makefile
1 #
2 # Copyright (C) 2008 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7 # $Id$
8
9 include $(TOPDIR)/rules.mk
10
11 PKG_NAME:=Mesa
12 PKG_RELEASE:=1
13 PKG_VERSION:=7.2
14
15 PKG_SOURCE_URL:=@SF/mesa3d
16 PKG_SOURCE:=$(PKG_NAME)Lib-$(PKG_VERSION).tar.bz2
17 PKG_MD5SUM:=04d379292e023df0b0266825cb0dbde5
18 PKG_FIXUP:=libtool
19 PKG_BUILD_DEPENDS:=glproto
20
21 include $(INCLUDE_DIR)/package.mk
22
23 PKG_INSTALL:=1
24
25 define Package/libgl-mesa
26 SECTION:=xorg-lib
27 CATEGORY:=Xorg
28 SUBMENU:=lib
29 DEPENDS:=+libX11 +libXext +libXfixes +libXdamage +libXxf86vm +libdrm
30 TITLE:=Mesa OpenGL library
31 URL:=http://mesa3d.org
32 endef
33
34 define Package/libglu-mesa
35 SECTION:=xorg-lib
36 CATEGORY:=Xorg
37 SUBMENU:=lib
38 DEPENDS:=+libgl-mesa
39 TITLE:=Mesa OpenGL utility library
40 URL:=http://mesa3d.org
41 endef
42
43 define Package/libgl-mesa-dri/Default
44 define Package/libgl-mesa-dri-$(1)
45 SECTION:=xorg-lib
46 CATEGORY:=Xorg
47 SUBMENU:=lib
48 DEPENDS:=libgl-mesa
49 TITLE:=mesa dri $(1)
50 URL:=http://mesa3d.org
51 endef
52 endef
53
54 DRIDRIVERS:=i810 i915 i965 mach64 mga r128 r200 r300 radeon s3v \
55 savage sis tdfx trident unichrome ffb swrast
56
57 $(foreach dri,$(DRIDRIVERS),$(eval $(call Package/libgl-mesa-dri/Default,$(dri))))
58
59 STAMP_CONFIGURED:=$(STAMP_CONFIGURED)_$(call confvar,CONFIG_PACKAGE_libgl-mesa \
60 CONFIG_PACKAGE_libglu-mesa \
61 $(foreach dri,$(DRIDRIVERS),CONFIG_PACKAGE_libgl-mesa-dri-$(dri)))
62
63 define Build/Configure
64 $(call Build/Configure/Default, \
65 --disable-glw \
66 --with-driver=dri \
67 --with-dri-drivers="$(foreach dri,$(DRIDRIVERS),$(if $(CONFIG_PACKAGE_libgl-mesa-dri-$(dri)),$(dri)))" \
68 )
69 endef
70
71 define Build/InstallDev
72 $(INSTALL_DIR) $(1)/usr/{include/GL,lib/pkgconfig}
73 $(CP) \
74 $(PKG_INSTALL_DIR)/usr/include/GL/* \
75 $(1)/usr/include/GL
76
77 $(INSTALL_DATA) \
78 $(PKG_INSTALL_DIR)/usr/lib/*.so* \
79 $(1)/usr/lib
80
81 $(INSTALL_DATA) \
82 $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/* \
83 $(1)/usr/lib/pkgconfig
84 endef
85
86 define Package/libgl-mesa/install
87 $(INSTALL_DIR) $(1)/usr/lib
88 $(INSTALL_DATA) \
89 $(PKG_INSTALL_DIR)/usr/lib/libGL.so* \
90 $(1)/usr/lib/
91 endef
92
93 define Package/libglu-mesa/install
94 $(INSTALL_DIR) $(1)/usr/lib
95 $(INSTALL_DATA) \
96 $(PKG_INSTALL_DIR)/usr/lib/libGLU.so* \
97 $(1)/usr/lib/
98 endef
99
100 define Package/libgl-mesa-dri/install/Default
101 define Package/libgl-mesa-dri-$(1)/install
102 $(INSTALL_DIR) $$(1)/usr/lib/dri/
103 $(INSTALL_DATA) \
104 $(PKG_INSTALL_DIR)/usr/lib/dri/$(1)_dri.so* \
105 $$(1)/usr/lib/dri
106 endef
107 endef
108
109 $(foreach dri,$(DRIDRIVERS),$(eval $(call Package/libgl-mesa-dri/install/Default,$(dri))))
110
111 $(eval $(call BuildPackage,libgl-mesa))
112 $(eval $(call BuildPackage,libglu-mesa))
113 $(foreach dri,$(DRIDRIVERS),$(eval $(call BuildPackage,libgl-mesa-dri-$(dri))))