Replace generate-constants which runs on the host and will generate wrong
[openwrt/svn-archive/archive.git] / lang / pygobject / 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:=pygobject
12 PKG_VERSION:=2.15.1
13 PKG_RELEASE:=2
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
15 PKG_SOURCE_URL:=@GNOME/$(PKG_NAME)/2.15
16 PKG_MD5SUM:=05bf0487c885a1ef6df615e02cac5ea6
17
18 include $(INCLUDE_DIR)/package.mk
19 -include $(if $(DUMP),,$(STAGING_DIR)/mk/python-package.mk)
20
21 EXTRA_LDFLAGS+= \
22 -L$(STAGING_DIR)/usr/lib/libintl/lib/ \
23 -L$(STAGING_DIR)/usr/lib/libiconv/lib/
24
25 define Package/python-gobject
26 SUBMENU:=Python
27 SECTION:=lang
28 CATEGORY:=Languages
29 TITLE:=GLib bindings for python
30 URL:=http://www.pygtk.org/
31 DEPENDS:=python-core +glib2
32 endef
33
34 define Package/python-gobject/description
35 GLib bindings for python
36 endef
37
38 define Build/Compile
39 # (cd $(PKG_BUILD_DIR)/gobject; \
40 # $(HOSTCC) -I$(STAGING_DIR)/usr/lib/glib-2.0/include/ \
41 # -I$(STAGING_DIR)/usr/include/glib-2.0/ \
42 # generate-constants.c -o generate-constants);
43 $(call Build/Compile/Default)
44 $(call Build/Install/Default)
45 endef
46
47 define Build/InstallDev
48 $(INSTALL_DIR) $(1)/usr/include/pygtk-2.0/
49 $(INSTALL_DATA) \
50 $(PKG_INSTALL_DIR)/usr/include/pygtk-2.0/* \
51 $(1)/usr/include/pygtk-2.0/
52
53 $(INSTALL_DIR) $(1)/usr/lib/pkgconfig/
54 $(INSTALL_DATA) \
55 $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/* \
56 $(1)/usr/lib/pkgconfig/
57
58 $(SED) \
59 "s,^\(prefix\|exec_prefix\|datadir\)=,\1=$(STAGING_DIR),g" \
60 $(1)/usr/lib/pkgconfig/pygobject-2.0.pc
61
62 $(INSTALL_DIR) $(1)/usr/share/pygobject/2.0/codegen
63 $(INSTALL_DATA) \
64 $(PKG_INSTALL_DIR)/usr/share/pygobject/2.0/codegen/*.py \
65 $(1)/usr/share/pygobject/2.0/codegen
66
67 $(INSTALL_DIR) $(1)/usr/share/pygobject/2.0/defs
68 $(INSTALL_DATA) \
69 $(PKG_INSTALL_DIR)/usr/share/pygobject/2.0/defs/* \
70 $(1)/usr/share/pygobject/2.0/defs
71
72 $(INSTALL_DIR) $(2)/bin
73 $(INSTALL_BIN) \
74 $(PKG_INSTALL_DIR)/usr/bin/* \
75 $(2)/bin
76
77 $(SED) \
78 "s,^\(prefix\|datadir\)=,\1=$(STAGING_DIR),g" \
79 $(2)/bin/pygobject-codegen-2.0
80 endef
81
82 define Package/python-gobject/install
83 $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
84 $(INSTALL_DATA) \
85 $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/*.{pth,py} \
86 $(1)$(PYTHON_PKG_DIR)/
87
88 $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)/gtk-2.0
89 $(INSTALL_DATA) \
90 $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/gtk-2.0/*.py \
91 $(1)$(PYTHON_PKG_DIR)/gtk-2.0/
92
93 $(foreach d,gobject gio, \
94 $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)/gtk-2.0/$(d); \
95 $(INSTALL_DATA) \
96 $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/gtk-2.0/$(d)/*.{py,so} \
97 $(1)$(PYTHON_PKG_DIR)/gtk-2.0/$(d); \
98 )
99 endef
100
101 $(eval $(call BuildPackage,python-gobject))