Skip to content

Commit

Permalink
Python: update to Python-2.7.8
Browse files Browse the repository at this point in the history
  • Loading branch information
stefansaraev authored and sraue committed Jan 3, 2015
1 parent 26231ed commit 81c08d1
Show file tree
Hide file tree
Showing 18 changed files with 230 additions and 379 deletions.
49 changes: 19 additions & 30 deletions packages/lang/Python/package.mk
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@
################################################################################

PKG_NAME="Python"
PKG_VERSION="2.7.3"
PKG_VERSION="2.7.8"
PKG_REV="1"
PKG_ARCH="any"
PKG_LICENSE="OSS"
PKG_SITE="http://www.python.org/"
PKG_URL="http://www.python.org/ftp/python/$PKG_VERSION/$PKG_NAME-$PKG_VERSION.tar.xz"
PKG_DEPENDS_HOST="zlib:host"
PKG_DEPENDS_TARGET="toolchain Python:host sqlite expat zlib bzip2 libressl libffi"
PKG_DEPENDS_TARGET="toolchain Python:host sqlite expat zlib bzip2 libressl libffi Python:host"
PKG_PRIORITY="optional"
PKG_SECTION="lang"
PKG_SHORTDESC="python: The Python programming language"
Expand All @@ -48,6 +48,9 @@ PKG_CONFIGURE_OPTS_TARGET="ac_cv_file_dev_ptc=no \
ac_cv_buggy_getaddrinfo=no \
ac_cv_header_bluetooth_bluetooth_h=no \
ac_cv_header_bluetooth_h=no \
ac_cv_file__dev_ptmx=no \
ac_cv_file__dev_ptc=no \
ac_cv_have_long_long_format=yes \
--with-threads \
--enable-unicode=ucs4 \
--enable-ipv6 \
Expand All @@ -72,64 +75,49 @@ make_host() {
PYTHON_DISABLE_MODULES="$PY_DISABLED_MODULES"
}

make_target() {
make -j1 CC="$TARGET_CC" \
HOSTPYTHON=$ROOT/$TOOLCHAIN/bin/python \
HOSTPGEN=$ROOT/$TOOLCHAIN/bin/pgen \
BLDSHARED="$CC -shared" \
RUNSHARED="LD_LIBRARY_PATH=$ROOT/$TOOLCHAIN/lib:$LD_LIBRARY_PATH" \
PYTHON_DISABLE_MODULES="$PY_DISABLED_MODULES" \
CROSS_COMPILE="$TARGET_NAME" \
CROSS_COMPILE_TARGET="yes" \
PYTHON_MODULES_INCLUDE="$TARGET_INCDIR" \
PYTHON_MODULES_LIB="$TARGET_LIBDIR"
}

makeinstall_host() {
make PYTHON_MODULES_INCLUDE="$HOST_INCDIR" \
PYTHON_MODULES_LIB="$HOST_LIBDIR" \
PYTHON_DISABLE_MODULES="$PY_DISABLED_MODULES" \
install

cp Parser/pgen $ROOT/$TOOLCHAIN/bin
}

# replace python-config to make sure python uses $SYSROOT_PREFIX
mkdir -p $ROOT/$TOOLCHAIN/bin
rm -rf $ROOT/$TOOLCHAIN/bin/python*-config

sed -e "s:%PREFIX%:$SYSROOT_PREFIX/usr:g" -e "s:%CFLAGS%:$TARGET_CFLAGS:g" \
$PKG_DIR/scripts/python-config > $ROOT/$TOOLCHAIN/bin/python2.7-config
chmod +x $ROOT/$TOOLCHAIN/bin/python2.7-config
ln -s python2.7-config $ROOT/$TOOLCHAIN/bin/python-config
make_target() {
make -j1 CC="$TARGET_CC" \
PYTHON_FOR_BUILD=$ROOT/$TOOLCHAIN/bin/python \
HOSTPGEN=$ROOT/$TOOLCHAIN/bin/pgen \
BLDSHARED="$CC -shared" \
RUNSHARED="LD_LIBRARY_PATH=$ROOT/$TOOLCHAIN/lib:$LD_LIBRARY_PATH" \
PYTHON_DISABLE_MODULES="$PY_DISABLED_MODULES" \
PYTHON_MODULES_INCLUDE="$TARGET_INCDIR" \
PYTHON_MODULES_LIB="$TARGET_LIBDIR"
}

makeinstall_target() {
make -j1 CC="$TARGET_CC" \
DESTDIR=$SYSROOT_PREFIX \
HOSTPYTHON=$ROOT/$TOOLCHAIN/bin/python \
PYTHON_FOR_BUILD=$ROOT/$TOOLCHAIN/bin/python \
HOSTPGEN=$ROOT/$TOOLCHAIN/bin/pgen \
BLDSHARED="$CC -shared" \
RUNSHARED="LD_LIBRARY_PATH=$ROOT/$TOOLCHAIN/lib:$LD_LIBRARY_PATH" \
PYTHON_DISABLE_MODULES="$PY_DISABLED_MODULES" \
CROSS_COMPILE="$TARGET_NAME" \
CROSS_COMPILE_TARGET="yes" \
PYTHON_MODULES_INCLUDE="$TARGET_INCDIR" \
PYTHON_MODULES_LIB="$TARGET_LIBDIR" \
install

# python distutils per default adds -L$LIBDIR when linking binary extensions
# python distutils per default adds -L$LIBDIR when linking binary extensions
sed -e "s|^LIBDIR=.*|LIBDIR= $SYSROOT_PREFIX/usr/lib|" \
-i $SYSROOT_PREFIX/usr/lib/python*/config/Makefile

make -j1 CC="$TARGET_CC" \
DESTDIR=$INSTALL \
HOSTPYTHON=$ROOT/$TOOLCHAIN/bin/python \
PYTHON_FOR_BUILD=$ROOT/$TOOLCHAIN/bin/python \
HOSTPGEN=$ROOT/$TOOLCHAIN/bin/pgen \
BLDSHARED="$CC -shared" \
RUNSHARED="LD_LIBRARY_PATH=$ROOT/$TOOLCHAIN/lib:$LD_LIBRARY_PATH" \
PYTHON_DISABLE_MODULES="$PY_DISABLED_MODULES" \
CROSS_COMPILE="$TARGET_NAME" \
CROSS_COMPILE_TARGET="yes" \
PYTHON_MODULES_INCLUDE="$TARGET_INCDIR" \
PYTHON_MODULES_LIB="$TARGET_LIBDIR" \
install
Expand All @@ -150,6 +138,7 @@ post_makeinstall_target() {
rm -rf $INSTALL/usr/lib/python*/config/makesetup
rm -rf $INSTALL/usr/lib/python*/config/python.o

# TODO remove ?
if [ ! -f $INSTALL/usr/lib/python*/lib-dynload/_socket.so ]; then
echo "sometimes Python dont build '_socket.so' for some reasons and continues without failing,"
echo "let it fail here, to be sure '_socket.so' will be installed. A rebuild of Python fixes"
Expand Down
135 changes: 0 additions & 135 deletions packages/lang/Python/patches/Python-2.7.3-001_xcompile.patch

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

3 comments on commit 81c08d1

@willat8
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This upgrade to Python 2.7.8 has broken the sqlite py module (breaking the YouTube add-on).
When importing sqlite3 at runtime on an OE box, I get an error cannot load /path/on/build/server/_sqlite3.so. On the box itself, _sqlite3.so is not present in /usr/lib/python2.7/lib-dynload.

During comple there is the warning CROSS COMPILE Badness: /usr/include in INCLUDEPATH: /usr/include immediately after compiling _sqlite3, which leads me to think this is a cross-compiling error.

@stefansaraev
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

known. @sraue is working on it.

@willat8
Copy link

@willat8 willat8 commented on 81c08d1 Jan 11, 2015 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.