wok annotate python/receipt @ rev 16337

Add slitaz-arm-adm (Can be used on other arch)
author Christophe Lincoln <pankso@slitaz.org>
date Sat Apr 12 12:20:54 2014 +0200 (2014-04-12)
parents 705623ffc522
children cfa58aeee489
rev   line source
pankso@18 1 # SliTaz package receipt.
pankso@18 2
pankso@18 3 PACKAGE="python"
pankso@16291 4 VERSION="2.7.5"
pankso@204 5 CATEGORY="development"
pankso@18 6 SHORT_DESC="The Python programming language."
pankso@18 7 MAINTAINER="pankso@slitaz.org"
pascal@15378 8 LICENSE="PSL"
pankso@18 9 SOURCE="Python"
pankso@16307 10 TARBALL="$SOURCE-$VERSION.tar.bz2"
pankso@18 11 WEB_SITE="http://www.python.org/"
pankso@16290 12 WGET_URL="https://www.python.org/ftp/python/$VERSION/$TARBALL"
pankso@16290 13 HOST_ARCH="i486 arm"
pankso@18 14
pankso@16290 15 DEPENDS="openssl bzlib readline sqlite zlib ncursesw gdbm libffi"
pascal@12990 16 BUILD_DEPENDS="openssl-dev bzip2-dev readline-dev sqlite-dev zlib-dev \
pascal@16301 17 ncursesw-dev tcl-dev tk-dev db-dev gdbm-dev wget"
pascal@12990 18 SUGGESTED="tcl tk"
pankso@10807 19
pankso@16026 20 # Handle cross compilation
pankso@16026 21 case "$ARCH" in
pankso@16062 22 arm*) BUILD_DEPENDS="openssl-dev bzip2-dev readline-dev ncursesw-dev \
pankso@16290 23 tcl-dev db-dev wget libffi-dev gdbm-dev" ;;
pankso@16026 24 esac
pankso@16026 25
pankso@18 26 # Rules to configure and make the package.
pankso@18 27 compile_rules()
pankso@18 28 {
slaxemulator@10975 29 # Temporary workaround for FS#22322
slaxemulator@10975 30 # See http://bugs.python.org/issue10835 for upstream report
slaxemulator@10975 31 sed -i "/progname =/s/python/python${_pybasever}/" Python/pythonrun.c
pankso@16290 32
slaxemulator@10975 33 # Enable built-in SQLite3 module to load extensions (fix FS#22122)
slaxemulator@10975 34 sed -i "/SQLITE_OMIT_LOAD_EXTENSION/d" setup.py
pankso@16290 35
pankso@16026 36 case "$ARCH" in
pankso@16026 37 arm*)
pankso@16290 38 # First pass for build host tools
pankso@16290 39 unset CFLAGS CXXFLAGS
pankso@16290 40 cp -f $CONFIG_SITE .
pankso@16062 41 CONFIG_SITE="$(pwd)/cook.site"
pankso@16290 42 cat >> $CONFIG_SITE << EOT
pankso@16290 43 ac_cv_have_long_long_format=yes
pankso@16290 44 EOT
pankso@16290 45 ./configure CC=gcc \
pankso@16290 46 --disable-ipv6 \
pankso@16290 47 --build=i486-slitaz-linux \
pankso@16290 48 --host=${BUILD_SYSTEM} &&
pankso@16290 49 make python Parser/pgen &&
pankso@16290 50 mv python hostpython &&
pankso@16290 51 mv Parser/pgen Parser/hostpgen || exit 1
pankso@16290 52 make distclean
pankso@16290 53 rm -f $CONFIG_SITE
pankso@16290 54 # Second pass for host tools
pankso@16290 55 . /etc/slitaz/cook.conf
pankso@16291 56 #patch -p1 < $stuff/python-2.7.3-xcompile.patch || exit 1
pankso@16290 57 cp -f $CONFIG_SITE .
pankso@16290 58 CONFIG_SITE="$(pwd)/cook.site"
pankso@16290 59 cat >> $CONFIG_SITE << EOT
pankso@16290 60 ac_cv_have_long_long_format=yes
pankso@16290 61 ac_cv_buggy_getaddrinfo=no
pankso@16290 62 ac_cv_file__dev_ptmx=yes
pankso@16290 63 ac_cv_file__dev_ptc=no
pankso@16290 64 EOT
pankso@16290 65 ./configure CC=${HOST_SYSTEM}-gcc \
pankso@16026 66 --disable-ipv6 \
pankso@16026 67 --enable-shared \
pankso@16290 68 --with-system-ffi \
pankso@16290 69 ${CONFIGURE_ARGS} &&
pankso@16290 70 make \
pankso@16290 71 PYTHON_FOR_BUILD=${src}/hostpython \
pankso@16290 72 HOSTPYTHON=${src}/hostpython \
pankso@16290 73 HOSTPGEN=${src}/Parser/hostpgen \
pankso@16290 74 CROSS_COMPILE_TARGET=yes \
pankso@16290 75 HOSTARCH=${HOST_SYSTEM} \
pankso@16290 76 BUILDARCH=${BUILD_SYSTEM} || exit 1
pankso@16290 77 make DESTDIR=$DESTDIR install || exit 1 ;;
pankso@16026 78 i?86)
pankso@16026 79 ./configure \
pankso@16026 80 --enable-shared \
pankso@16026 81 --build=${HOST_SYSTEM} \
pankso@16290 82 --host=${HOST_SYSTEM} &&
pankso@16290 83 make && make DESTDIR=$DESTDIR install ;;
pankso@16290 84 esac
pankso@18 85 }
pankso@18 86
pankso@18 87 # Rules to gen a SliTaz package suitable for Tazpkg.
pankso@18 88 genpkg_rules()
pankso@18 89 {
pascal@7468 90 python_version=${VERSION:0:3}
pascal@7468 91 mkdir -p $fs/usr/include/${PACKAGE}$python_version
slaxemulator@14609 92 cp -a $install/usr/bin $fs/usr
slaxemulator@14609 93 cp -a $install/usr/lib $fs/usr
pankso@16062 94 # needed for mercurial to work now
slaxemulator@14609 95 cp -a $install/usr/include/${PACKAGE}$python_version/pyconfig.h \
pascal@7468 96 $fs/usr/include/${PACKAGE}$python_version
pankso@18 97 rm -f $fs/usr/bin/*-config
pankso@18 98 }
pankso@18 99