Fix the whole python building process to do proper crosscompiling for all python
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) git-svn-id: svn://svn.openwrt.org/openwrt/packages@12821 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
parent
40daf3db15
commit
1a7ebdeb62
@ -25,7 +25,6 @@ PKG_INSTALL:=1
|
||||
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)
|
||||
|
||||
|
17
XOrg/lib/hippo-canvas/patches/010-use-python-config
Normal file
17
XOrg/lib/hippo-canvas/patches/010-use-python-config
Normal file
@ -0,0 +1,17 @@
|
||||
--- 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"
|
@ -4,6 +4,7 @@
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
# $Id$
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
@ -16,30 +17,32 @@ PKG_FIXUP:=libtool
|
||||
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
|
||||
|
@ -21,7 +21,7 @@ define Package/ipython
|
||||
SUBMENU:=Python
|
||||
SECTION:=lang
|
||||
CATEGORY:=Languages
|
||||
TITLE:=python bindings for dbus
|
||||
TITLE:=ipython
|
||||
URL:=http://ipython.scipy.org/dist/
|
||||
endef
|
||||
|
||||
|
@ -15,6 +15,7 @@ PKG_SOURCE_URL:=http://downloads.sourceforge.net/numpy/
|
||||
PKG_MD5SUM:=8f011e9d7697da570efaac61c51725e0
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
-include $(if $(DUMP),,$(STAGING_DIR)/mk/python-package.mk)
|
||||
|
||||
define Package/numpy
|
||||
SUBMENU:=Python
|
||||
@ -22,7 +23,7 @@ define Package/numpy
|
||||
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
|
||||
@ -31,7 +32,6 @@ endef
|
||||
|
||||
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
|
||||
|
@ -44,7 +44,7 @@ diff -urN numpy-1.0.4/numpy/core/setup.py numpy-1.0.4.patched/numpy/core/setup.p
|
||||
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
|
||||
@ -62,6 +62,7 @@ diff -urN numpy-1.0.4/numpy/distutils/unixccompiler.py numpy-1.0.4.patched/numpy
|
||||
+ 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,
|
||||
|
@ -40,6 +40,8 @@ CONFIGURE_ARGS += \
|
||||
--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)
|
||||
|
@ -4,6 +4,7 @@
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
# $Id$
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
@ -17,6 +18,7 @@ PKG_MD5SUM:=2c3aa21e6e610321498f9f81f7b625df
|
||||
PKG_FIXUP:=libtool
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
-include $(if $(DUMP),,$(STAGING_DIR)/mk/python-package.mk)
|
||||
|
||||
PKG_INSTALL=1
|
||||
|
||||
@ -35,17 +37,20 @@ endef
|
||||
|
||||
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))
|
||||
|
13
lang/pycairo/patches/010-fix-pycairo-pc-includedir.patch
Normal file
13
lang/pycairo/patches/010-fix-pycairo-pc-includedir.patch
Normal file
@ -0,0 +1,13 @@
|
||||
--- 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:
|
@ -4,58 +4,100 @@
|
||||
# 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))
|
||||
|
@ -4,59 +4,90 @@
|
||||
# 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 \
|
||||
))
|
||||
|
@ -0,0 +1,24 @@
|
||||
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>],
|
@ -1,48 +0,0 @@
|
||||
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 \
|
@ -40,6 +40,14 @@ define PyPackage/python-sqlite/filespec
|
||||
-|$(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,., \
|
||||
@ -49,7 +57,3 @@ endef
|
||||
|
||||
$(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. \
|
||||
))
|
||||
|
5
lang/pysqlite/files/setup.cfg.in
Normal file
5
lang/pysqlite/files/setup.cfg.in
Normal file
@ -0,0 +1,5 @@
|
||||
[build_ext]
|
||||
define=
|
||||
include_dirs=@INCLUDE_DIRS@
|
||||
library_dirs=@LIBRARY_DIRS@
|
||||
libraries=sqlite3
|
@ -4,6 +4,7 @@
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
# $Id$
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
@ -16,6 +17,7 @@ PKG_MD5SUM:=562c78876219bf458d79a041af18293d
|
||||
PKG_FIXUP:=libtool
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
-include $(if $(DUMP),,$(STAGING_DIR)/mk/python-package.mk)
|
||||
|
||||
PKG_INSTALL=1
|
||||
|
||||
@ -24,6 +26,7 @@ EXTRA_CFLAGS += \
|
||||
-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
|
||||
|
||||
@ -41,23 +44,33 @@ define Package/dbus-python/description
|
||||
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))
|
||||
|
@ -4,6 +4,7 @@
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
# $Id$
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
@ -23,11 +24,6 @@ PKG_INSTALL=1
|
||||
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 \
|
||||
|
@ -14,14 +14,12 @@ PKG_RELEASE:=2
|
||||
|
||||
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
|
||||
@ -43,7 +41,7 @@ endef
|
||||
define Package/python
|
||||
$(call Package/python/Default)
|
||||
TITLE+= (full)
|
||||
DEPENDS:= +libpthread +zlib
|
||||
DEPENDS:=+libpthread +zlib
|
||||
PROVIDES:=python-core
|
||||
endef
|
||||
|
||||
@ -56,7 +54,7 @@ endef
|
||||
define Package/python-mini
|
||||
$(call Package/python/Default)
|
||||
TITLE+= (minimal)
|
||||
DEPENDS:= +libpthread +zlib
|
||||
DEPENDS:=+libpthread +zlib
|
||||
PROVIDES:=python-core
|
||||
endef
|
||||
|
||||
@ -97,8 +95,8 @@ MAKE_OPTS:=\
|
||||
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
|
||||
@ -109,15 +107,16 @@ define Build/Compile
|
||||
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 \
|
||||
@ -125,8 +124,6 @@ define Build/Compile
|
||||
--without-cxx-main \
|
||||
--with-threads \
|
||||
ac_cv_lib_readline_readline=no \
|
||||
HOSTPYTHON=./hostpython \
|
||||
HOSTPGEN=./hostpgen \
|
||||
OPT="$(TARGET_CFLAGS)" \
|
||||
)
|
||||
$(MAKE) -C $(PKG_BUILD_DIR) \
|
||||
@ -137,18 +134,33 @@ endef
|
||||
|
||||
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
|
||||
|
@ -13,7 +13,7 @@ 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:=python$(PYTHON_VERSION)
|
||||
|
||||
PYTHON_PKG_DIR:=/usr/lib/python$(PYTHON_VERSION)/site-packages
|
||||
|
110
lang/python/patches/050-add_signal_set_wakeup_fd.patch
Normal file
110
lang/python/patches/050-add_signal_set_wakeup_fd.patch
Normal file
@ -0,0 +1,110 @@
|
||||
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},
|
@ -4,6 +4,7 @@
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
# $Id$
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
@ -15,6 +16,7 @@ PKG_SOURCE_URL:=http://telepathy.freedesktop.org/releases/telepathy-python/
|
||||
PKG_MD5SUM:=678a28e3b7d06f75940beec28130d9a5
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
-include $(if $(DUMP),,$(STAGING_DIR)/mk/python-package.mk)
|
||||
|
||||
define Package/telepathy-python
|
||||
SUBMENU:=Python
|
||||
@ -26,14 +28,15 @@ define Package/telepathy-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
|
||||
|
@ -4,7 +4,7 @@
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
# $Id:
|
||||
# $Id$
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
@ -17,6 +17,7 @@ PKG_SOURCE_URL:=http://oligarchy.co.uk/xapian/$(PKG_VERSION)
|
||||
PKG_FIXUP:=libtool
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
-include $(if $(DUMP),,$(STAGING_DIR)/mk/python-package.mk)
|
||||
|
||||
PKG_INSTALL=1
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user