Split python-gnome-desktop into python-rsvg and python-wnck.
[openwrt/svn-archive/archive.git] / lang / python-gnome-desktop2 / Makefile
index 3b7c73c..8012543 100644 (file)
@@ -8,45 +8,86 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=gnome-python-desktop
-PKG_VERSION:=2.16.0
+PKG_VERSION:=2.22.0
 PKG_RELEASE:=1
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
-PKG_SOURCE_URL:=http://ftp.gnome.org/pub/GNOME/sources/gnome-python-desktop/2.16/
+PKG_SOURCE_URL:=@GNOME/$(PKG_NAME)/2.22
+PKG_MD5SUM:=504877a973f6abc0788283232cd703c
 PKG_FIXUP:=libtool
 
 include $(INCLUDE_DIR)/package.mk
+include $(if $(DUMP),,$(STAGING_DIR)/mk/python-package.mk)
+
+PKG_INSTALL=1
 
 EXTRA_CFLAGS += \
        -I$(STAGING_DIR)/usr/lib/libintl/include \
-       -I$(STAGING_DIR)/usr/lib/libiconv/include
+       -I$(STAGING_DIR)/usr/lib/libiconv/include \
+       $(if CONFIG_PACKAGE_python-rsvg,-I$(STAGING_DIR)/usr/include/librsvg-2,) \
+       $(if CONFIG_PACKAGE_python-wnck,-I$(STAGING_DIR)/usr/include/libwnck-1.0,)
 
 EXTRA_LDFLAGS += \
        -L$(STAGING_DIR)/usr/lib/libintl/lib \
        -L$(STAGING_DIR)/usr/lib/libiconv/lib
 
-define Package/gnome-python-desktop
-  SUBMENU:=Python
+STAMP_CONFIGURED:=$(STAMP_CONFIGURED)_$(call confvar,CONFIG_PACKAGE_python-rsvg CONFIG_PACKAGE_python-wnck)
+
+define Package/python-gnome-desktop/Default
   SECTION:=lang
+  SUBMENU:=Python
   CATEGORY:=Languages
-  TITLE:=Gnome Python Bindings
+  TITLE:=$(1) python bindings
   URL:=http://ftp.gnome.org/
-  DEPENDS:=+libwnck +python-gtk
+  DEPENDS:=python-core $(2)
 endef
 
-define Package/gnome-python-desktop/description
-  python bindings for gnome
+define Package/python-rsvg
+       $(call Package/python-gnome-desktop/Default,librsvg,+librsvg)
 endef
 
-MAKE_FLAGS += DESTDIR=$(PKG_INSTALL_DIR) all install
+define Package/python-wnck
+       $(call Package/python-gnome-desktop/Default,libwnck,+libwnck)
+endef
+
+define Build/Configure
+       $(call Build/Configure/Default, \
+               $(if, $(CONFIG_PACKGE_python-rsvg), --enable-rsvg, --disable-rsvg), \
+               $(if, $(CONFIG_PACKGE_python-wnck), --enable-wnck, --disable-wnck), \
+       )
+endef
 
 define Build/InstallDev
-       $(INSTALL_DIR) $(1)
-       $(CP) $(PKG_INSTALL_DIR)/* $(1)
+       $(INSTALL_DIR) $(1)/usr/share/pygtk/2.0/defs
+       $(INSTALL_DATA) \
+               $(PKG_INSTALL_DIR)/usr/share/pygtk/2.0/defs/* \
+               $(1)/usr/share/pygtk/2.0/defs
+
+       $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+       $(INSTALL_DATA) \
+               $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/* \
+               $(1)/usr/lib/pkgconfig
+
+       $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)/gtk-2.0
+       $(INSTALL_DATA) \
+               $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/gtk-2.0/*.{so,la} \
+               $(1)$(PYTHON_PKG_DIR)/gtk-2.0
+endef
+
+define Package/python-gnome-desktop/install/Default
+       $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)/gtk-2.0
+       $(INSTALL_DATA) \
+               $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/gtk-2.0/$(2).{so,a} \
+               $(1)$(PYTHON_PKG_DIR)/gtk-2.0
 endef
 
-define Package/gnome-python-desktop/install
-       $(INSTALL_DIR) $(1)
-       $(CP) $(PKG_INSTALL_DIR)/* $(1)
+define Package/python-rsvg/install
+       $(call Package/python-gnome-desktop/install/Default,$(1),rsvg)
 endef
 
-$(eval $(call BuildPackage,gnome-python-desktop))
+define Package/python-wnck/install
+       $(call Package/python-gnome-desktop/install/Default,$(1),wnck)
+endef
+
+$(eval $(call BuildPackage,python-rsvg))
+$(eval $(call BuildPackage,python-wnck))
+