modules in openwrt. Thanks to ryd for helping to make this possible.
(Only numpy is completly broken now because it has dependencies which
where pervioulsy taken from the build system)
SVN-Revision: 12821
EXTRA_CFLAGS += \
-I$(STAGING_DIR)/usr/lib/libintl/include \
-I$(STAGING_DIR)/usr/include/libcroco-0.6 \
- $(if $(CONFIG_PACKAGE_python-hippo-canvas),-I$(STAGING_DIR)/usr/include/pycairo,)
STAMP_CONFIGURED:=$(STAMP_CONFIGURED)_$(call confvar,CONFIG_PACKAGE_hippo-canvas CONFIG_PACKAGE_python-hippo-canvas)
--- /dev/null
+--- hippo-canvas-0.3.0.orig/configure 2008-09-30 22:18:23.000000000 +0200
++++ hippo-canvas-0.3.0/configure 2008-09-30 22:41:16.000000000 +0200
+@@ -20486,10 +20486,14 @@
+ echo $ECHO_N "checking for headers required to compile python extensions... $ECHO_C" >&6; }
+ py_prefix=`$PYTHON -c "import sys; print sys.prefix"`
+ py_exec_prefix=`$PYTHON -c "import sys; print sys.exec_prefix"`
++if test -x "$PYTHON-config"; then
++PYTHON_INCLUDES=`$PYTHON-config --includes 2>/dev/null`
++else
+ PYTHON_INCLUDES="-I${py_prefix}/include/python${PYTHON_VERSION}"
+ if test "$py_prefix" != "$py_exec_prefix"; then
+ PYTHON_INCLUDES="$PYTHON_INCLUDES -I${py_exec_prefix}/include/python${PYTHON_VERSION}"
+ fi
++fi
+
+ save_CPPFLAGS="$CPPFLAGS"
+ CPPFLAGS="$CPPFLAGS $PYTHON_INCLUDES"
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
+# $Id$
include $(TOPDIR)/rules.mk
PKG_MD5SUM:=2c633a06c140024dd0d59db1e87e6945
include $(INCLUDE_DIR)/package.mk
+-include $(if $(DUMP),,$(STAGING_DIR)/mk/python-package.mk)
PKG_INSTALL=1
TARGET_CFLAGS += $(FPIC) \
-I$(STAGING_DIR)/usr/lib/libintl/include \
- -I$(STAGING_DIR)/usr/lib/libiconv/include
+ -I$(STAGING_DIR)/usr/lib/libiconv/include \
+ -I$(STAGING_DIR)/usr/include/gstreamer-0.10
TARGET_LDFLAGS += \
-L$(STAGING_DIR)/usr/lib/libintl/lib \
-L$(STAGING_DIR)/usr/lib/libiconv/lib
-CONFIGURE_VARS += PYTHON=/usr/bin/python
+CONFIGURE_VARS += PYTHON=$(HOST_PYTHON)
define Package/gst-python
SUBMENU:=Python
SECTION:=lang
CATEGORY:=Languages
- TITLE:=python bindings for dbus
+ TITLE:=python bindings for gstreamer
URL:=http://gstreamer.freedesktop.org/
DEPENDS:=+gstreamer +gst-plugins-base +python-gtk
endef
define Package/gst-python/description
- python bindings for dbus
+ python bindings for gstreamer
endef
define Build/InstallDev
SUBMENU:=Python
SECTION:=lang
CATEGORY:=Languages
- TITLE:=python bindings for dbus
+ TITLE:=ipython
URL:=http://ipython.scipy.org/dist/
endef
PKG_MD5SUM:=8f011e9d7697da570efaac61c51725e0
include $(INCLUDE_DIR)/package.mk
+-include $(if $(DUMP),,$(STAGING_DIR)/mk/python-package.mk)
define Package/numpy
SUBMENU:=Python
CATEGORY:=Languages
TITLE:=numpy
URL:=http://numpy.sf.net
- DEPENDS:=python-core @TARGET_x86||TARGET_olpc||TARGET_uml
+ DEPENDS:=python-core @TARGET_x86||TARGET_olpc||TARGET_uml @BROKEN
endef
define Package/numpy/description
define Build/Compile
cd $(PKG_BUILD_DIR) ; $(CONFIGURE_VARS) $(MAKE_VARS) python2.5 ./setup.py install --prefix="$(PKG_INSTALL_DIR)/usr"
- sed -i "s/UCS4/UCS2/g" $(PKG_INSTALL_DIR)/usr/lib/python2.5/site-packages/numpy/core/multiarray.so
endef
define Package/numpy/install
diff -urN numpy-1.0.4/numpy/distutils/unixccompiler.py numpy-1.0.4.patched/numpy/distutils/unixccompiler.py
--- numpy-1.0.4/numpy/distutils/unixccompiler.py 2007-11-07 22:05:15.000000000 +0000
+++ numpy-1.0.4.patched/numpy/distutils/unixccompiler.py 2008-05-25 11:07:14.000000000 +0100
-@@ -9,11 +9,35 @@
+@@ -9,11 +9,36 @@
from numpy.distutils.ccompiler import replace_method
import log
+ if output_progname == "_configtest":
+ self.spawn(['gcc', '-lm', '-o',output_progname]+objects, display = "")
+ else:
++ print "#### Running " + str(CCompiler.EXECUTABLE)
+ self.link(CCompiler.EXECUTABLE, objects,
+ self.executable_filename(output_progname), output_dir,
+ libraries, library_dirs, runtime_library_dirs, None,
--with-postgres-libraries="$(STAGING_DIR)/usr/lib" \
--with-postgres-includes="$(STAGING_DIR)/usr/include" \
--with-mxdatetime-includes="$(STAGING_DIR)$(PYTHON_PKG_DIR)/mx/DateTime/mxDateTime" \
+ --with-python-prefix=$(STAGING_DIR)/usr
+ --with-python-exec-prefix=$(STAGING_DIR)/usr
define Build/Compile
$(if $(Build/Compile/PyMod),,@echo Python packaging code not found.; false)
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
+# $Id$
include $(TOPDIR)/rules.mk
PKG_FIXUP:=libtool
include $(INCLUDE_DIR)/package.mk
+-include $(if $(DUMP),,$(STAGING_DIR)/mk/python-package.mk)
PKG_INSTALL=1
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include/pycairo
- $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/pycairo/* \
+ $(INSTALL_DATA) \
+ $(PKG_INSTALL_DIR)/usr/include/pycairo/* \
$(1)/usr/include/pycairo
$(INSTALL_DIR) $(1)/usr/lib/pkgconfig/
- $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/* \
+ $(INSTALL_DATA) \
+ $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/* \
$(1)/usr/lib/pkgconfig/
endef
define Package/pycairo/install
- $(INSTALL_DIR) $(1)/usr/lib/python2.5/site-packages/cairo/
- $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/python2.5/site-packages/cairo/*.{py,so,a} \
- $(1)/usr/lib/python2.5/site-packages/cairo/
+ $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)/cairo/
+ $(INSTALL_DATA) \
+ $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/cairo/*.{py,so,a} \
+ $(1)$(PYTHON_PKG_DIR)/cairo/
endef
$(eval $(call BuildPackage,pycairo))
--- /dev/null
+--- pycairo-1.6.4/pycairo.pc.in.orig 2008-09-30 16:55:10.000000000 +0200
++++ pycairo-1.6.4/pycairo.pc.in 2008-09-30 16:55:44.000000000 +0200
+@@ -1,8 +1,9 @@
+ prefix=@prefix@
++includedir=@includedir@
+
+ Name: Pycairo
+ Description: Python bindings for cairo
+ Version: @VERSION@
+ Requires: cairo
+-Cflags: -I@includedir@/pycairo
++Cflags: -I${includedir}/pycairo
+ Libs:
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
+# $Id$
include $(TOPDIR)/rules.mk
PKG_NAME:=pygobject
-PKG_VERSION:=2.14.0
-PKG_RELEASE:=1
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=http://ftp.gnome.org/pub/GNOME/sources/pygobject/2.14
-PKG_MD5SUM:=ed4d9e653ea4ed2b68ceb28341894779
-PKG_BUILD_DEP:=python
-
-EXTRA_LDFLAGS=-L$(STAGING_DIR)/usr/lib/libintl/lib/ -L$(STAGING_DIR)/usr/lib/libiconv/lib/
+PKG_VERSION:=2.15.1
+PKG_RELEASE:=2
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_SOURCE_URL:=@GNOME/$(PKG_NAME)/2.15
+PKG_MD5SUM:=05bf0487c885a1ef6df615e02cac5ea6
include $(INCLUDE_DIR)/package.mk
+-include $(if $(DUMP),,$(STAGING_DIR)/mk/python-package.mk)
+
+TARGET_LDFLAGS+=-I/home/lars/Projects/openwrt-olpc/staging_dir/i386/usr/include/python2.5
+
+EXTRA_LDFLAGS+= \
+ -L$(STAGING_DIR)/usr/lib/libintl/lib/ \
+ -L$(STAGING_DIR)/usr/lib/libiconv/lib/
define Package/python-gobject
SUBMENU:=Python
SECTION:=lang
CATEGORY:=Languages
- TITLE:=python gobjects
+ TITLE:=GLib bindings for python
URL:=http://www.pygtk.org/
DEPENDS:=python-core +glib2
endef
define Package/python-gobject/description
- API to GTK and glade library from python
-endef
-
-define Build/Configure
- (cd $(PKG_BUILD_DIR); \
- if [ -x $(CONFIGURE_CMD) ]; then \
- $(CP) $(SCRIPT_DIR)/config.{guess,sub} $(PKG_BUILD_DIR)/ && \
- $(CONFIGURE_VARS) \
- $(CONFIGURE_CMD) \
- $(CONFIGURE_ARGS) ;\
- fi \
- )
+ GLib bindings for python
endef
define Build/Compile
- cd $(PKG_BUILD_DIR)/gobject ; gcc -I$(STAGING_DIR)/usr/lib/glib-2.0/include/ -I$(STAGING_DIR)/usr/include/glib-2.0/ generate-constants.c -o generate-constants
- cd $(PKG_BUILD_DIR) ; DESTDIR=$(PKG_INSTALL_DIR) $(MAKE) all install
+ (cd $(PKG_BUILD_DIR)/gobject; \
+ $(HOSTCC) -I$(STAGING_DIR)/usr/lib/glib-2.0/include/ \
+ -I$(STAGING_DIR)/usr/include/glib-2.0/ \
+ generate-constants.c -o generate-constants);
+ $(call Build/Compile/Default)
+ $(call Build/Install/Default)
endef
define Build/InstallDev
- mkdir -p $(1)
- cp -r $(PKG_INSTALL_DIR)/* $(1)
+ $(INSTALL_DIR) $(1)/usr/include/pygtk-2.0/
+ $(INSTALL_DATA) \
+ $(PKG_INSTALL_DIR)/usr/include/pygtk-2.0/* \
+ $(1)/usr/include/pygtk-2.0/
+
+ $(INSTALL_DIR) $(1)/usr/lib/pkgconfig/
+ $(INSTALL_DATA) \
+ $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/* \
+ $(1)/usr/lib/pkgconfig/
+
+ $(SED) \
+ "s,^\(prefix\|exec_prefix\|datadir\)=,\1=$(STAGING_DIR),g" \
+ $(1)/usr/lib/pkgconfig/pygobject-2.0.pc
+
+ $(INSTALL_DIR) $(1)/usr/share/pygobject/2.0/codegen
+ $(INSTALL_DATA) \
+ $(PKG_INSTALL_DIR)/usr/share/pygobject/2.0/codegen/*.py \
+ $(1)/usr/share/pygobject/2.0/codegen
+
+ $(INSTALL_DIR) $(1)/usr/share/pygobject/2.0/defs
+ $(INSTALL_DATA) \
+ $(PKG_INSTALL_DIR)/usr/share/pygobject/2.0/defs/* \
+ $(1)/usr/share/pygobject/2.0/defs
+
+ $(INSTALL_DIR) $(2)/bin
+ $(INSTALL_BIN) \
+ $(PKG_INSTALL_DIR)/usr/bin/* \
+ $(2)/bin
+
+ $(SED) \
+ "s,^\(prefix\|datadir\)=,\1=$(STAGING_DIR),g" \
+ $(2)/bin/pygobject-codegen-2.0
endef
define Package/python-gobject/install
- mkdir -p $(1)
- cp -r $(PKG_INSTALL_DIR)/* $(1)
+ $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
+ $(INSTALL_DATA) \
+ $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/*.{pth,py} \
+ $(1)$(PYTHON_PKG_DIR)/
+
+ $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)/gtk-2.0
+ $(INSTALL_DATA) \
+ $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/gtk-2.0/*.py \
+ $(1)$(PYTHON_PKG_DIR)/gtk-2.0/
+
+ $(foreach d,gobject gio, \
+ $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)/gtk-2.0/$(d); \
+ $(INSTALL_DATA) \
+ $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/gtk-2.0/$(d)/*.{py,so} \
+ $(1)$(PYTHON_PKG_DIR)/gtk-2.0/$(d); \
+ )
endef
$(eval $(call BuildPackage,python-gobject))
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
+# $Id$
include $(TOPDIR)/rules.mk
PKG_NAME:=pygtk
-PKG_VERSION:=2.10.6
-PKG_RELEASE:=1
+PKG_VERSION:=2.12.1
+PKG_RELEASE:=2
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=http://ftp.gnome.org/pub/GNOME/sources/pygtk/2.10/
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_SOURCE_URL:=@GNOME/$(PKG_NAME)/2.12/
+PKG_MD5SUM:=a816346d750d61e3fa67a200e4292694
PKG_FIXUP:=libtool
-PKG_MD5SUM:=d033b7617b9074357f687326b52b6296
include $(INCLUDE_DIR)/package.mk
+-include $(if $(DUMP),,$(STAGING_DIR)/mk/python-package.mk)
-EXTRA_CFLAGS:=-I$(STAGING_DIR)/usr/include/pycairo/ -I$(STAGING_DIR)/usr/lib/libintl/include/ -I$(STAGING_DIR)/usr/lib/libiconv/include/
-EXTRA_LDFLAGS:=-L$(STAGING_DIR)/usr/lib/libintl/lib -L$(STAGING_DIR)/usr/lib/libiconv/lib
+EXTRA_CFLAGS+= \
+ -I$(STAGING_DIR)/usr/lib/libintl/include/ \
+ -I$(STAGING_DIR)/usr/lib/libiconv/include/
+
+EXTRA_LDFLAGS+= \
+ -L$(STAGING_DIR)/usr/lib/libintl/lib \
+ -L$(STAGING_DIR)/usr/lib/libiconv/lib
define Package/python-gtk
SUBMENU:=Python
SECTION:=lang
CATEGORY:=Languages
- TITLE:=GTK bindings to python
+ TITLE:=GTK bindings for python
URL:=http://www.pygtk.org/
DEPENDS:=python-core +python-gobject +gtk2 +pycairo
endef
define Package/python-gtk/description
- API to GTK and glade library from python
+ API to GTK and glade library from python.
endef
define Build/Compile
- PYTHON_HOST="python2.5" \
- DESTDIR="$(PKG_INSTALL_DIR)" \
$(MAKE) -C $(PKG_BUILD_DIR) \
SUBDIRS="codegen . gtk" \
- all install
- sed -i "s/UCS4/UCS2/g" $(PKG_INSTALL_DIR)/usr/lib/python2.5/site-packages/gtk-2.0/gtk/_gtk.so
+ all install DESTDIR="$(PKG_INSTALL_DIR)"
endef
define Build/InstallDev
- $(INSTALL_DIR) $(1)
- $(CP) $(PKG_INSTALL_DIR)/* $(1)
+ $(INSTALL_DIR) $(1)/usr/include/pygtk-2.0/pygtk
+ $(INSTALL_DATA) \
+ $(PKG_INSTALL_DIR)/usr/include/pygtk-2.0/pygtk/* \
+ $(1)/usr/include/pygtk-2.0/pygtk
+
+ $(INSTALL_DIR) $(1)/usr/share/pygtk/2.0/codegen
+ $(INSTALL_DATA) \
+ $(PKG_INSTALL_DIR)/usr/share/pygtk/2.0/codegen/*.py \
+ $(1)/usr/share/pygtk/2.0/codegen/
+
+ $(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) $(2)/bin
+ $(INSTALL_BIN) \
+ $(PKG_INSTALL_DIR)/usr/bin/* \
+ $(2)/bin
+
+ $(SED) 's,^\(datadir\|prefix\)=,\1=$(STAGING_DIR),g' $(2)/bin/pygtk-codegen-2.0
+
+ $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+ $(INSTALL_DATA) \
+ $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/* \
+ $(1)/usr/lib/pkgconfig
+
+ $(SED) 's,^datadir=,datadir=$(STAGING_DIR),g' $(1)/usr/lib/pkgconfig/pygtk-2.0.pc
endef
define Package/python-gtk/install
- $(INSTALL_DIR) $(1)
- $(CP) $(PKG_INSTALL_DIR)/* $(1)
+ $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)/gtk-2.0
+ $(INSTALL_DATA) \
+ $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/gtk-2.0/*.so \
+ $(1)$(PYTHON_PKG_DIR)/gtk-2.0
+
+ $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)/gtk-2.0/gtk
+ $(INSTALL_DATA) \
+ $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/gtk-2.0/gtk/*.{py,so} \
+ $(1)$(PYTHON_PKG_DIR)/gtk-2.0/gtk
endef
$(eval $(call BuildPackage,python-gtk))
-$(eval $(call RequireCommand,pygtk-codegen-2.0, \
- Please install the pygtk 2.0 development package \
-))
-$(eval $(call RequireCommand,python2.5, \
- Please install Python 2.5 \
-))
--- /dev/null
+diff -urN pygtk-2.12.1.orig/configure pygtk-2.12.1/configure
+--- pygtk-2.12.1.orig/configure 2008-09-30 17:05:56.000000000 +0200
++++ pygtk-2.12.1/configure 2008-09-30 17:06:38.000000000 +0200
+@@ -10399,8 +10399,6 @@
+
+ { echo "$as_me:$LINENO: checking for PySignal_SetWakeupFd in Python.h" >&5
+ echo $ECHO_N "checking for PySignal_SetWakeupFd in Python.h... $ECHO_C" >&6; }
+-py_prefix=`$PYTHON -c "import sys; print sys.prefix"`
+-PYTHON_INCLUDES="-I${py_prefix}/include/python${PYTHON_VERSION}"
+ old_CPPFLAGS=$CPPFLAGS
+ CPPFLAGS="-Wall -Werror $PYTHON_INCLUDES"
+ cat >conftest.$ac_ext <<_ACEOF
+diff -urN pygtk-2.12.1.orig/configure.in pygtk-2.12.1/configure.in
+--- pygtk-2.12.1.orig/configure.in 2008-09-30 17:05:56.000000000 +0200
++++ pygtk-2.12.1/configure.in 2008-09-30 17:06:24.000000000 +0200
+@@ -78,8 +78,6 @@
+ AM_CHECK_PYTHON_HEADERS(,[AC_MSG_ERROR(could not find Python headers)])
+
+ AC_MSG_CHECKING([for PySignal_SetWakeupFd in Python.h])
+-py_prefix=`$PYTHON -c "import sys; print sys.prefix"`
+-PYTHON_INCLUDES="-I${py_prefix}/include/python${PYTHON_VERSION}"
+ old_CPPFLAGS=$CPPFLAGS
+ CPPFLAGS="-Wall -Werror $PYTHON_INCLUDES"
+ AC_TRY_COMPILE([#include <Python.h>],
+++ /dev/null
-diff -urN pygtk-2.10.6.orig/Makefile.am pygtk-2.10.6/Makefile.am
---- pygtk-2.10.6.orig/Makefile.am 2008-05-24 15:18:49.000000000 +0100
-+++ pygtk-2.10.6/Makefile.am 2008-05-24 15:20:50.000000000 +0100
-@@ -105,7 +105,7 @@
- # code generator
- .defs.c:
- (cd $(srcdir)\
-- && $(PYTHON) codegen/codegen.py \
-+ && $(PYTHON_HOST) codegen/codegen.py \
- --py_ssize_t-clean \
- --register pango-types.defs \
- --register atk-types.defs \
-diff -urN pygtk-2.10.6.orig/Makefile.in pygtk-2.10.6/Makefile.in
---- pygtk-2.10.6.orig/Makefile.in 2008-05-24 15:18:49.000000000 +0100
-+++ pygtk-2.10.6/Makefile.in 2008-05-24 15:20:39.000000000 +0100
-@@ -1085,7 +1085,7 @@
- # code generator
- .defs.c:
- (cd $(srcdir)\
-- && $(PYTHON) codegen/codegen.py \
-+ && $(PYTHON_HOST) codegen/codegen.py \
- --py_ssize_t-clean \
- --register pango-types.defs \
- --register atk-types.defs \
-diff -urN pygtk-2.10.6.orig/gtk/Makefile.am pygtk-2.10.6/gtk/Makefile.am
---- pygtk-2.10.6.orig/gtk/Makefile.am 2008-05-24 15:18:49.000000000 +0100
-+++ pygtk-2.10.6/gtk/Makefile.am 2008-05-24 15:21:10.000000000 +0100
-@@ -170,7 +170,7 @@
-
-
- .defs.c:
-- ($(PYTHON) $(top_srcdir)/codegen/codegen.py \
-+ ($(PYTHON_HOST) $(top_srcdir)/codegen/codegen.py \
- $(PYGTK_CODEGEN_DEFINES) \
- -I $(srcdir) \
- --py_ssize_t-clean \
-diff -urN pygtk-2.10.6.orig/gtk/Makefile.in pygtk-2.10.6/gtk/Makefile.in
---- pygtk-2.10.6.orig/gtk/Makefile.in 2008-05-24 15:18:49.000000000 +0100
-+++ pygtk-2.10.6/gtk/Makefile.in 2008-05-24 15:21:20.000000000 +0100
-@@ -1056,7 +1056,7 @@
- gtk-types.defs
-
- .defs.c:
-- ($(PYTHON) $(top_srcdir)/codegen/codegen.py \
-+ ($(PYTHON_HOST) $(top_srcdir)/codegen/codegen.py \
- $(PYGTK_CODEGEN_DEFINES) \
- -I $(srcdir) \
- --py_ssize_t-clean \
-|$(PYTHON_PKG_DIR)/pysqlite2/test
endef
+define Build/Configure
+ cp ./files/setup.cfg.in $(PKG_BUILD_DIR)/setup.cfg
+ $(SED) \
+ 's,@INCLUDE_DIRS@,$(STAGING_DIR)/usr/include,g' \
+ -e 's,@INCLUDE_DIRS@,$(STAGING_DIR)/usr/include,g' \
+ $(PKG_BUILD_DIR)/setup.cfg
+endef
+
define Build/Compile
$(if $(Build/Compile/PyMod),,@echo Python packaging code not found.; false)
$(call Build/Compile/PyMod,., \
$(eval $(call PyPackage,python-sqlite))
$(eval $(call BuildPackage,python-sqlite))
-
-$(eval $(call RequireHeader,/usr/include/gnu/stubs-32.h, \
- $(PKG_NAME) requires a 32-bits toolchain. \
-))
--- /dev/null
+[build_ext]
+define=
+include_dirs=@INCLUDE_DIRS@
+library_dirs=@LIBRARY_DIRS@
+libraries=sqlite3
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
+# $Id$
include $(TOPDIR)/rules.mk
PKG_FIXUP:=libtool
include $(INCLUDE_DIR)/package.mk
+-include $(if $(DUMP),,$(STAGING_DIR)/mk/python-package.mk)
PKG_INSTALL=1
-I$(STAGING_DIR)/usr/lib/libiconv/include
EXTRA_LDFLAGS += \
+ -Wl,-rpath=$(STAGING_DIR)/usr/lib \
-L$(STAGING_DIR)/usr/lib/libintl/lib \
-L$(STAGING_DIR)/usr/lib/libiconv/lib
endef
define Build/InstallDev
- $(INSTALL_DIR) $(1)/usr/include/dbus-1.0/dbus/
- $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/dbus-1.0/dbus/* \
+ $(INSTALL_DIR) $(1)/usr/include/dbus-1.0/dbus
+ $(INSTALL_DATA) \
+ $(PKG_INSTALL_DIR)/usr/include/dbus-1.0/dbus/* \
$(1)/usr/include/dbus-1.0/dbus/
- $(INSTALL_DIR) $(1)/usr/lib/pkgconfig/
- $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/* $(1)/usr/lib/pkgconfig
+
+ $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
+ $(INSTALL_DATA) \
+ $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/* \
+ $(1)/usr/lib/pkgconfig
endef
define Package/dbus-python/install
- $(INSTALL_DIR) $(1)/usr/lib/python2.5/site-packages/
- $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/python2.5/site-packages/*.{py,so,a} \
- $(1)/usr/lib/python2.5/site-packages/
- $(INSTALL_DIR) $(1)/usr/lib/python2.5/site-packages/dbus/
- $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/python2.5/site-packages/dbus/*.py \
- $(1)/usr/lib/python2.5/site-packages/dbus/
- $(INSTALL_DIR) $(1)/usr/lib/python2.5/site-packages/dbus/mainloop/
- $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/python2.5/site-packages/dbus/mainloop/*.py \
- $(1)/usr/lib/python2.5/site-packages/dbus/mainloop/
+ $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
+ $(INSTALL_DATA) \
+ $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/*.{py,so,a} \
+ $(1)$(PYTHON_PKG_DIR)
+
+ $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)/dbus
+ $(INSTALL_DATA) \
+ $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/dbus/*.py \
+ $(1)$(PYTHON_PKG_DIR)/dbus
+
+ $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)/dbus/mainloop
+ $(INSTALL_DATA) \
+ $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/dbus/mainloop/*.py \
+ $(1)$(PYTHON_PKG_DIR)/dbus/mainloop
+
endef
$(eval $(call BuildPackage,dbus-python))
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
+# $Id$
include $(TOPDIR)/rules.mk
EXTRA_CFLAGS += \
-I$(STAGING_DIR)/usr/lib/libintl/include \
-I$(STAGING_DIR)/usr/lib/libiconv/include \
- $(if CONFIG_PACKAGE_python-rsvg, \
- -I$(STAGING_DIR)/usr/include/librsvg-2 \
- -I$(STAGING_DIR)/usr/include/pycairo \
- ,) \
- $(if CONFIG_PACKAGE_python-wnck,-I$(STAGING_DIR)/usr/include/libwnck-1.0,)
EXTRA_LDFLAGS += \
-L$(STAGING_DIR)/usr/lib/libintl/lib \
PKG_SOURCE:=Python-$(PKG_VERSION).tar.bz2
PKG_SOURCE_URL:=http://www.python.org/ftp/python/$(PKG_VERSION)/
-PKG_MD5SUM:=70084ffa561660f07de466c2c8c4842d
+#PKG_MD5SUM:=afb5451049eda91fbde10bd5a4b7fadc
PKG_BUILD_DIR:=$(BUILD_DIR)/Python-$(PKG_VERSION)
-PKG_BUILD_DEPENDS:=python libexpat libopenssl zlib
-
include $(INCLUDE_DIR)/package.mk
--include $(if $(DUMP),,./python-package.mk)
+-include $(if $(DUMP),,./files/python-package.mk)
define Package/python/Default
SUBMENU:=Python
endef
define Package/python/Default/description
- Python is a dynamic object-oriented programming language that can be used
- for many kinds of software development. It offers strong support for
- integration with other languages and tools, comes with extensive standard
- libraries, and can be learned in a few days. Many Python programmers
- report substantial productivity gains and feel the language encourages
+ Python is a dynamic object-oriented programming language that can be used
+ for many kinds of software development. It offers strong support for
+ integration with other languages and tools, comes with extensive standard
+ libraries, and can be learned in a few days. Many Python programmers
+ report substantial productivity gains and feel the language encourages
the development of higher quality, more maintainable code.
endef
define Package/python
$(call Package/python/Default)
- TITLE+= (full)
- DEPENDS:= +libpthread +zlib
- PROVIDES:=python-core
+ TITLE+= (full)
+ DEPENDS:=+libpthread +zlib
+ PROVIDES:=python-core
endef
define Package/python/description
define Package/python-mini
$(call Package/python/Default)
- TITLE+= (minimal)
- DEPENDS:= +libpthread +zlib
- PROVIDES:=python-core
+ TITLE+= (minimal)
+ DEPENDS:=+libpthread +zlib
+ PROVIDES:=python-core
endef
define Package/python-mini/description
$(call Package/python/Default/description)
- .
- This package contains only a minimal Python install.
+ .
+ This package contains only a minimal Python install.
endef
define Package/python-doc
$(call Package/python/Default)
- TITLE:=Python interactive documentation
- DEPENDS+= python-core
+ TITLE:=Python interactive documentation
+ DEPENDS+= python-core
endef
define Package/python-expat
$(call Package/python/Default)
- TITLE:=Python support for expat
- DEPENDS+= python-core +libexpat
+ TITLE:=Python support for expat
+ DEPENDS+= python-core +libexpat
endef
define Package/python-openssl
CFLAGS="$(TARGET_CFLAGS) -fno-inline" \
LDFLAGS="$(TARGET_LDFLAGS)" \
LD="$(TARGET_CC)" \
- HOSTPYTHON=./hostpython \
- HOSTPGEN=./hostpgen
+ HOSTPYTHON=$(PKG_INSTALL_DIR)/host/bin/python \
+ HOSTPGEN=./hostpgen \
define Build/Configure
endef
rm -rf config.cache; \
CONFIG_SITE= \
OPT="$(HOST_CFLAGS)" \
- ./configure --without-cxx-main --without-threads; \
- );
- $(MAKE) -C $(PKG_BUILD_DIR) python Parser/pgen
- (cd $(PKG_BUILD_DIR); \
- mv python ./hostpython; \
- mv Parser/pgen ./hostpgen; \
+ ./configure --without-cxx-main --without-threads --prefix=$(PKG_INSTALL_DIR)/host; \
);
+ $(MAKE) -C $(PKG_BUILD_DIR) \
+ python Parser/pgen
+ $(MAKE) -C $(PKG_BUILD_DIR) \
+ HOSTPYTHON=$(PKG_BUILD_DIR)/python \
+ sharedmods install
+ (cd $(PKG_BUILD_DIR);mv Parser/pgen hostpgen)
$(MAKE) -C $(PKG_BUILD_DIR) distclean
- #echo "readline readline.c -lreadline -lncurses" >> $(PKG_BUILD_DIR)/Modules/Setup.local
+
$(call Build/Configure/Default, \
--sysconfdir=/etc \
--disable-shared \
--without-cxx-main \
--with-threads \
ac_cv_lib_readline_readline=no \
- HOSTPYTHON=./hostpython \
- HOSTPGEN=./hostpgen \
OPT="$(TARGET_CFLAGS)" \
)
$(MAKE) -C $(PKG_BUILD_DIR) \
define Build/InstallDev
$(INSTALL_DIR) $(1)/mk $(2)/bin $(1)/usr/bin $(1)/usr/include $(1)/usr/lib
- $(INSTALL_DATA) ./python-package.mk $(1)/mk/
- $(CP) $(PKG_BUILD_DIR)/hostpython $(1)/usr/bin/
- ln -sf hostpython $(1)/usr/bin/python
- ln -sf $(STAGING_DIR)/usr/bin/hostpython $(2)/bin/
- ln -sf $(STAGING_DIR)/usr/bin/python $(2)/bin/
+ $(INSTALL_DATA) ./files/python-package.mk $(1)/mk/
$(CP) \
$(PKG_INSTALL_DIR)/usr/include/python$(PYTHON_VERSION) \
$(1)/usr/include/
$(CP) \
- $(PKG_INSTALL_DIR)/usr/lib/python$(PYTHON_VERSION) \
+ $(PKG_INSTALL_DIR)/host/lib/python$(PYTHON_VERSION) \
$(PKG_BUILD_DIR)/libpython$(PYTHON_VERSION).a \
$(1)/usr/lib/
+
+ $(CP) \
+ $(PKG_INSTALL_DIR)/usr/lib/python$(PYTHON_VERSION)/config \
+ $(1)/usr/lib/python$(PYTHON_VERSION)/
+
+ $(CP) \
+ $(PKG_INSTALL_DIR)/host/bin/python \
+ $(1)/usr/bin/hostpython
+ (cd $(2)/bin; \
+ ln -sf ../../usr/bin/hostpython python$(PYTHON_VERSION); \
+ ln -sf python$(PYTHON_VERSION) python)
+
+ $(CP) \
+ $(PKG_INSTALL_DIR)/host/bin/python$(PYTHON_VERSION)-config \
+ $(2)/bin/
+ $(SED) 's,^#!.*,#!/usr/bin/env python2.5,g' $(2)/bin/python$(PYTHON_VERSION)-config
+
+ (cd $(2)/bin; \
+ ln -sf python$(PYTHON_VERSION)-config python-config;)
endef
define PyPackage/python/filespec
--- /dev/null
+#
+# Copyright (C) 2007 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+# $Id$
+
+PYTHON_VERSION=2.5
+
+PYTHON_DIR:=$(STAGING_DIR)/usr
+PYTHON_BIN_DIR:=$(PYTHON_DIR)/bin
+PYTHON_INC_DIR:=$(PYTHON_DIR)/include/python$(PYTHON_VERSION)
+PYTHON_LIB_DIR:=$(PYTHON_DIR)/lib/python$(PYTHON_VERSION)
+
+PYTHON:=python$(PYTHON_VERSION)
+
+PYTHON_PKG_DIR:=/usr/lib/python$(PYTHON_VERSION)/site-packages
+
+define PyPackage
+ $(call shexport,PyPackage/$(1)/filespec)
+
+ define Package/$(1)/install
+ @getvar $$(call shvar,PyPackage/$(1)/filespec) | ( \
+ IFS='|'; \
+ while read fop fspec fperm; do \
+ if [ "$$$$$$$$fop" = "+" ]; then \
+ dpath=`dirname "$$$$$$$$fspec"`; \
+ if [ -n "$$$$$$$$fperm" ]; then \
+ dperm="-m$$$$$$$$fperm"; \
+ else \
+ dperm=`stat -c "%a" $(PKG_INSTALL_DIR)$$$$$$$$dpath`; \
+ fi; \
+ mkdir -p $$$$$$$$$dperm $$(1)$$$$$$$$dpath; \
+ echo "copying: '$$$$$$$$fspec'"; \
+ cp -fpR $(PKG_INSTALL_DIR)$$$$$$$$fspec $$(1)$$$$$$$$dpath/; \
+ if [ -n "$$$$$$$$fperm" ]; then \
+ chmod -R $$$$$$$$fperm $$(1)$$$$$$$$fspec; \
+ fi; \
+ elif [ "$$$$$$$$fop" = "-" ]; then \
+ echo "removing: '$$$$$$$$fspec'"; \
+ rm -fR $$(1)$$$$$$$$fspec; \
+ elif [ "$$$$$$$$fop" = "=" ]; then \
+ echo "setting permissions: '$$$$$$$$fperm' on '$$$$$$$$fspec'"; \
+ chmod -R $$$$$$$$fperm $$(1)$$$$$$$$fspec; \
+ fi; \
+ done; \
+ )
+ $(call PyPackage/$(1)/install,$$(1))
+ endef
+endef
+
+define Build/Compile/PyMod
+ ( cd $(PKG_BUILD_DIR)/$(1); \
+ CFLAGS="$(TARGET_CFLAGS)" \
+ CPPFLAGS="$(TARGET_CPPFLAGS)" \
+ LDFLAGS="$(TARGET_LDFLAGS)" \
+ $(3) \
+ $(PYTHON) ./setup.py $(2) \
+ );
+endef
--- /dev/null
+diff -urN Python-2.5.1.orig/Include/pyerrors.h Python-2.5.1/Include/pyerrors.h
+--- Python-2.5.1.orig/Include/pyerrors.h 2008-08-10 13:46:48.000000000 +0200
++++ Python-2.5.1/Include/pyerrors.h 2008-08-10 13:51:05.000000000 +0200
+@@ -239,6 +239,9 @@
+ PyAPI_FUNC(int) PyErr_CheckSignals(void);
+ PyAPI_FUNC(void) PyErr_SetInterrupt(void);
+
++/* In signalmodule.c */
++int PySignal_SetWakeupFd(int fd);
++
+ /* Support for adding program text to SyntaxErrors */
+ PyAPI_FUNC(void) PyErr_SyntaxLocation(const char *, int);
+ PyAPI_FUNC(PyObject *) PyErr_ProgramText(const char *, int);
+diff -urN Python-2.5.1.orig/Modules/signalmodule.c Python-2.5.1/Modules/signalmodule.c
+--- Python-2.5.1.orig/Modules/signalmodule.c 2008-08-10 13:46:48.000000000 +0200
++++ Python-2.5.1/Modules/signalmodule.c 2008-08-10 13:50:02.000000000 +0200
+@@ -12,6 +12,8 @@
+
+ #include <signal.h>
+
++#include <sys/stat.h>
++
+ #ifndef SIG_ERR
+ #define SIG_ERR ((PyOS_sighandler_t)(-1))
+ #endif
+@@ -75,6 +77,8 @@
+ PyObject *func;
+ } Handlers[NSIG];
+
++static int wakeup_fd = -1;
++
+ static int is_tripped = 0; /* Speed up sigcheck() when none tripped */
+
+ static PyObject *DefaultHandler;
+@@ -112,6 +116,7 @@
+ static void
+ signal_handler(int sig_num)
+ {
++ const char dummy_byte = '\0';
+ #ifdef WITH_THREAD
+ #ifdef WITH_PTH
+ if (PyThread_get_thread_ident() != main_thread) {
+@@ -125,6 +130,8 @@
+ is_tripped++;
+ Handlers[sig_num].tripped = 1;
+ Py_AddPendingCall(checksignals_witharg, NULL);
++ if (wakeup_fd != -1)
++ write(wakeup_fd, &dummy_byte, 1);
+ #ifdef WITH_THREAD
+ }
+ #endif
+@@ -264,6 +271,50 @@
+ anything else -- the callable Python object used as a handler");
+
+
++static PyObject *
++signal_set_wakeup_fd(PyObject *self, PyObject *args)
++{
++ struct stat buf;
++ int fd, old_fd;
++ if (!PyArg_ParseTuple(args, "i:set_wakeup_fd", &fd))
++ return NULL;
++#ifdef WITH_THREAD
++ if (PyThread_get_thread_ident() != main_thread) {
++ PyErr_SetString(PyExc_ValueError,
++ "set_wakeup_fd only works in main thread");
++ return NULL;
++ }
++#endif
++ if (fd != -1 && fstat(fd, &buf) != 0) {
++ PyErr_SetString(PyExc_ValueError, "invalid fd");
++ return NULL;
++ }
++ old_fd = wakeup_fd;
++ wakeup_fd = fd;
++ return PyLong_FromLong(old_fd);
++}
++
++PyDoc_STRVAR(set_wakeup_fd_doc,
++"set_wakeup_fd(fd) -> fd\n\
++\n\
++Sets the fd to be written to (with '\\0') when a signal\n\
++comes in. A library can use this to wakeup select or poll.\n\
++The previous fd is returned.\n\
++\n\
++The fd must be non-blocking.");
++
++/* C API for the same, without all the error checking */
++int
++PySignal_SetWakeupFd(int fd)
++{
++ int old_fd = wakeup_fd;
++ if (fd < 0)
++ fd = -1;
++ wakeup_fd = fd;
++ return old_fd;
++}
++
++
+ /* List of functions defined in the module */
+ static PyMethodDef signal_methods[] = {
+ #ifdef HAVE_ALARM
+@@ -271,6 +322,7 @@
+ #endif
+ {"signal", signal_signal, METH_VARARGS, signal_doc},
+ {"getsignal", signal_getsignal, METH_VARARGS, getsignal_doc},
++ {"set_wakeup_fd", signal_set_wakeup_fd, METH_VARARGS, set_wakeup_fd_doc},
+ #ifdef HAVE_PAUSE
+ {"pause", (PyCFunction)signal_pause,
+ METH_NOARGS,pause_doc},
+++ /dev/null
-#
-# Copyright (C) 2007 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-# $Id$
-
-PYTHON_VERSION=2.5
-
-PYTHON_DIR:=$(STAGING_DIR)/usr
-PYTHON_BIN_DIR:=$(PYTHON_DIR)/bin
-PYTHON_INC_DIR:=$(PYTHON_DIR)/include/python$(PYTHON_VERSION)
-PYTHON_LIB_DIR:=$(PYTHON_DIR)/lib/python$(PYTHON_VERSION)
-
-PYTHON:=$(PYTHON_BIN_DIR)/python
-
-PYTHON_PKG_DIR:=/usr/lib/python$(PYTHON_VERSION)/site-packages
-
-define PyPackage
- $(call shexport,PyPackage/$(1)/filespec)
-
- define Package/$(1)/install
- @getvar $$(call shvar,PyPackage/$(1)/filespec) | ( \
- IFS='|'; \
- while read fop fspec fperm; do \
- if [ "$$$$$$$$fop" = "+" ]; then \
- dpath=`dirname "$$$$$$$$fspec"`; \
- if [ -n "$$$$$$$$fperm" ]; then \
- dperm="-m$$$$$$$$fperm"; \
- else \
- dperm=`stat -c "%a" $(PKG_INSTALL_DIR)$$$$$$$$dpath`; \
- fi; \
- mkdir -p $$$$$$$$$dperm $$(1)$$$$$$$$dpath; \
- echo "copying: '$$$$$$$$fspec'"; \
- cp -fpR $(PKG_INSTALL_DIR)$$$$$$$$fspec $$(1)$$$$$$$$dpath/; \
- if [ -n "$$$$$$$$fperm" ]; then \
- chmod -R $$$$$$$$fperm $$(1)$$$$$$$$fspec; \
- fi; \
- elif [ "$$$$$$$$fop" = "-" ]; then \
- echo "removing: '$$$$$$$$fspec'"; \
- rm -fR $$(1)$$$$$$$$fspec; \
- elif [ "$$$$$$$$fop" = "=" ]; then \
- echo "setting permissions: '$$$$$$$$fperm' on '$$$$$$$$fspec'"; \
- chmod -R $$$$$$$$fperm $$(1)$$$$$$$$fspec; \
- fi; \
- done; \
- )
- $(call PyPackage/$(1)/install,$$(1))
- endef
-endef
-
-define Build/Compile/PyMod
- ( cd $(PKG_BUILD_DIR)/$(1); \
- CFLAGS="$(TARGET_CFLAGS)" \
- CPPFLAGS="$(TARGET_CPPFLAGS)" \
- LDFLAGS="$(TARGET_LDFLAGS)" \
- $(3) \
- $(PYTHON) ./setup.py $(2) \
- );
-endef
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
+# $Id$
include $(TOPDIR)/rules.mk
PKG_MD5SUM:=678a28e3b7d06f75940beec28130d9a5
include $(INCLUDE_DIR)/package.mk
+-include $(if $(DUMP),,$(STAGING_DIR)/mk/python-package.mk)
define Package/telepathy-python
SUBMENU:=Python
endef
define Package/telepathy-python/description
- telepathy- python bingings
+ telepathy python bingings
endef
define Build/Compile
- cd $(PKG_BUILD_DIR) ; $(CONFIGURE_VARS) $(MAKE_VARS) /usr/bin/python ./setup.py install --prefix="$(PKG_INSTALL_DIR)/usr"
+ $(call Build/Compile/PyMod,,install --prefix="$(PKG_INSTALL_DIR)/usr")
endef
define Package/telepathy-python/install
+ #FIXME: Only copy required files
mkdir -p $(1)
cp -r $(PKG_INSTALL_DIR)/* $(1)
endef
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
-# $Id:
+# $Id$
include $(TOPDIR)/rules.mk
PKG_FIXUP:=libtool
include $(INCLUDE_DIR)/package.mk
+-include $(if $(DUMP),,$(STAGING_DIR)/mk/python-package.mk)
PKG_INSTALL=1