xcbproto: make python support conditional (auto-detected), and un-hardcode path names...
[openwrt/svn-archive/archive.git] / Xorg / lib / xcbproto / 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
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=xcb-proto
11 PKG_VERSION:=1.3
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
15 PKG_SOURCE_URL:=http://xcb.freedesktop.org/dist/
16 PKG_MD5SUM:=d9275a714e83ab9c1f9b260c6eff1609
17 PKG_INSTALL:=1
18
19 PKG_BUILD_DEPENDS:=PACKAGE_python:python PACKAGE_python-mini:python
20
21 include $(INCLUDE_DIR)/package.mk
22 include $(STAGING_DIR)/mk/python-package.mk
23
24 STAMP_CONFIGURED:=$(STAMP_CONFIGURED)_$(call confvar,PACKAGE_python PACKAGE_python-mini)
25
26 define Package/xcbproto
27 SECTION:=xorg-libs
28 CATEGORY:=Xorg
29 SUBMENU:=libraries
30 BUILDONLY:=1
31 TITLE:=xcbproto
32 endef
33
34 ifneq ($(CONFIG_PACKAGE_python)$(CONFIG_PACKAGE_python-mini),)
35 define InstallPy
36 $(INSTALL_DIR) $(1)/host/lib/$(PYTHON)/site-packages/xcbgen
37 $(INSTALL_DATA) \
38 $(PKG_INSTALL_DIR)/usr/lib/$(PYTHON)/site-packages/xcbgen/*.py \
39 $(1)/host/lib/$(PYTHON)/site-packages/xcbgen/
40 endef
41 endif
42
43 define Build/InstallDev
44 $(call InstallPy,$(1),$(2))
45 $(INSTALL_DIR) \
46 $(1)/usr/lib/pkgconfig \
47 $(1)/host/share/xcb
48
49 $(INSTALL_DATA) \
50 $(PKG_INSTALL_DIR)/usr/share/xcb/* \
51 $(1)/host/share/xcb/
52
53 $(INSTALL_DATA) \
54 $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/* \
55 $(1)/usr/lib/pkgconfig/
56
57 $(SED) 's,datadir=/usr,datadir=$(STAGING_DIR)/host,g' $(1)/usr/lib/pkgconfig/xcb-proto.pc
58 endef
59
60 $(eval $(call BuildPackage,xcbproto))