diff options
author | Alastair Tse <liquidx@gentoo.org> | 2003-10-07 21:29:16 +0000 |
---|---|---|
committer | Alastair Tse <liquidx@gentoo.org> | 2003-10-07 21:29:16 +0000 |
commit | 4662e7e1f864934c4f5b8f0ba2c05a08d5a34e20 (patch) | |
tree | 0c63de17114ea3392edfebab4cb032859b696e33 /dev-lang | |
parent | add patch to fix malfunctioning epiphany server (diff) | |
download | gentoo-2-4662e7e1f864934c4f5b8f0ba2c05a08d5a34e20.tar.gz gentoo-2-4662e7e1f864934c4f5b8f0ba2c05a08d5a34e20.tar.bz2 gentoo-2-4662e7e1f864934c4f5b8f0ba2c05a08d5a34e20.zip |
whee .. new python
Diffstat (limited to 'dev-lang')
-rw-r--r-- | dev-lang/python/ChangeLog | 13 | ||||
-rw-r--r-- | dev-lang/python/Manifest | 11 | ||||
-rw-r--r-- | dev-lang/python/files/digest-python-2.2.3-r2 | 1 | ||||
-rw-r--r-- | dev-lang/python/files/digest-python-2.3.2 | 1 | ||||
-rw-r--r-- | dev-lang/python/files/python-2.2.3-db4.patch | 4 | ||||
-rw-r--r-- | dev-lang/python/files/python-2.3-add_portage_search_path.patch | 11 | ||||
-rw-r--r-- | dev-lang/python/files/python-config-2.3 | 3 | ||||
-rw-r--r-- | dev-lang/python/files/python-updater | 246 | ||||
-rw-r--r-- | dev-lang/python/python-2.2.3-r2.ebuild | 118 | ||||
-rw-r--r-- | dev-lang/python/python-2.3.2.ebuild | 124 |
10 files changed, 527 insertions, 5 deletions
diff --git a/dev-lang/python/ChangeLog b/dev-lang/python/ChangeLog index adb342e27205..e0df62bea916 100644 --- a/dev-lang/python/ChangeLog +++ b/dev-lang/python/ChangeLog @@ -1,6 +1,17 @@ # ChangeLog for dev-lang/python # Copyright 2002-2003 Gentoo Technologies, Inc.; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/ChangeLog,v 1.36 2003/10/03 15:51:33 pappy Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/ChangeLog,v 1.37 2003/10/07 21:29:09 liquidx Exp $ + +*python-2.3.2 (07 Oct 2003) + + 07 Oct 2003; Alastair Tse <liquidx@gentoo.org> python-2.2.3-r2.ebuild, + python-2.3.2.ebuild, files/python-2.2.3-db4.patch, + files/python-2.3-add_portage_search_path.patch, files/python-config-2.3, + files/python-updater: + it has been a long time coming, but finally there's a 2.3.x release in portage + along with a python-2.2.3 update that should fix some niggling issues and also + uses the new alternative class. 2.3.2 is still masked and should stay that way + until we can confirm the rebuilding script works. 03 Oct 2003; Alexander Gabert <pappy@gentoo.org> python-2.2.3-r1.ebuild: filter-flags because of segfaulting with fstackprotector in CFLAGS diff --git a/dev-lang/python/Manifest b/dev-lang/python/Manifest index cb781b3a5f78..259397ebfae3 100644 --- a/dev-lang/python/Manifest +++ b/dev-lang/python/Manifest @@ -1,20 +1,27 @@ -MD5 289cc80711b3a11ceb82824733ab7f31 ChangeLog 6138 +MD5 a6c22eececd7e5dcc619b08c96a45066 ChangeLog 6690 MD5 8145ce0144332d6caca98fa5fb648741 metadata.xml 221 MD5 58b06d58bccd371fcbf1b781164c75a9 python-2.1.3-r1.ebuild 2345 MD5 f7959cf61958991a7e25f83a4e8b2ff8 python-2.2.1-r5.ebuild 2912 MD5 b5ce70d94f27185e138e67267ff416fe python-2.2.2-r1.ebuild 3123 MD5 c70d578ef0b3e6358108691e8b88d458 python-2.2.2.ebuild 3027 MD5 ecfb635781f27f8a8f54c552dcd40684 python-2.2.3-r1.ebuild 3298 +MD5 0a274212a2a49a52600b617a38bafa09 python-2.2.3-r2.ebuild 3441 MD5 789d8555967a31cc0de2126fa6468fc2 python-2.2.3.ebuild 2999 +MD5 7c0dcd5a1aa1ec0db97cd0847faab0d7 python-2.3.2.ebuild 3675 MD5 f3f370c8d1382c1a7571cfc1cbb196d9 files/digest-python-2.1.3-r1 62 MD5 aa73c4258e3be099345a929ad6e01665 files/digest-python-2.2.1-r5 62 MD5 b7a6b00d8dede1534e7a5180a14542b1 files/digest-python-2.2.2 62 MD5 b7a6b00d8dede1534e7a5180a14542b1 files/digest-python-2.2.2-r1 62 MD5 f11f5d528c570ef739ea10806cebfa9f files/digest-python-2.2.3 62 MD5 f11f5d528c570ef739ea10806cebfa9f files/digest-python-2.2.3-r1 62 +MD5 f11f5d528c570ef739ea10806cebfa9f files/digest-python-2.2.3-r2 62 +MD5 aafa57d90e8894592bdf346eedc77faa files/digest-python-2.3.2 62 MD5 5f2361b3e770981b737a9ad3d2863931 files/python-2.2.1-r5-gentoo.diff 4152 MD5 11aa066154fe2e0a4c306124c7e5dd4a files/python-2.2.2-tk-8.4.x.patch 2997 -MD5 2e09618aa68d0184ea63d68c799986dd files/python-2.2.3-db4.patch 1096 +MD5 aa781491d5e1590c4bfe6a85eecf5477 files/python-2.2.3-db4.patch 1100 +MD5 46588eb4b2cfdd8277153e8e6f728eca files/python-2.3-add_portage_search_path.patch 607 MD5 b530d6f9dbcf30239061be3de80932cc files/python-config-2.2 178 MD5 b530d6f9dbcf30239061be3de80932cc files/python-config-2.2.1 178 MD5 b530d6f9dbcf30239061be3de80932cc files/python-config-2.2.2 178 +MD5 201acd1cfd5124f25c58a8db3f78a502 files/python-config-2.3 178 +MD5 b2f51a738667622eff9c4964878d9d95 files/python-updater 7076 diff --git a/dev-lang/python/files/digest-python-2.2.3-r2 b/dev-lang/python/files/digest-python-2.2.3-r2 new file mode 100644 index 000000000000..283c3d783859 --- /dev/null +++ b/dev-lang/python/files/digest-python-2.2.3-r2 @@ -0,0 +1 @@ +MD5 169f89f318e252dac0c54dd1b165d229 Python-2.2.3.tgz 6709556 diff --git a/dev-lang/python/files/digest-python-2.3.2 b/dev-lang/python/files/digest-python-2.3.2 new file mode 100644 index 000000000000..416c04df6929 --- /dev/null +++ b/dev-lang/python/files/digest-python-2.3.2 @@ -0,0 +1 @@ +MD5 f54d7a529d444994b4b33429bbb45479 Python-2.3.2.tgz 8459427 diff --git a/dev-lang/python/files/python-2.2.3-db4.patch b/dev-lang/python/files/python-2.2.3-db4.patch index 76180c95a745..de687f3ebb44 100644 --- a/dev-lang/python/files/python-2.2.3-db4.patch +++ b/dev-lang/python/files/python-2.2.3-db4.patch @@ -6,8 +6,8 @@ dblib = [] - if self.compiler.find_library_file(lib_dirs, 'db-3.2'): - dblib = ['db-3.2'] -+ if self.compiler.find_library_file(lib_dirs, 'db-4'): -+ dblib = ['db-4'] ++ if self.compiler.find_library_file(lib_dirs, 'db-4.0'): ++ dblib = ['db-4.0'] + elif self.compiler.find_library_file(lib_dirs, 'db-3.2'): + dblib = ['db-3.2'] elif self.compiler.find_library_file(lib_dirs, 'db-3.1'): diff --git a/dev-lang/python/files/python-2.3-add_portage_search_path.patch b/dev-lang/python/files/python-2.3-add_portage_search_path.patch new file mode 100644 index 000000000000..fc8f0f62380f --- /dev/null +++ b/dev-lang/python/files/python-2.3-add_portage_search_path.patch @@ -0,0 +1,11 @@ +--- Lib/site.py 2003-07-18 18:45:33.000000000 +0100 ++++ Lib/site.py 2003-09-30 00:03:54.000000000 +0100 +@@ -171,6 +171,8 @@ + "python" + sys.version[:3], + "site-packages"), + os.path.join(prefix, "lib", "site-python")] ++ # add Gentoo Linux specific search path - liquidx@gentoo.org (30/09/2003) ++ sitedirs.append(os.path.join(prefix,"lib","portage","pym")) + else: + sitedirs = [prefix, os.path.join(prefix, "lib", "site-packages")] + if sys.platform == 'darwin': diff --git a/dev-lang/python/files/python-config-2.3 b/dev-lang/python/files/python-config-2.3 new file mode 100644 index 000000000000..abd5a360b797 --- /dev/null +++ b/dev-lang/python/files/python-config-2.3 @@ -0,0 +1,3 @@ +#!/usr/bin/python +import distutils.sysconfig, string +print "-lpython2.3 -lm -L/usr/lib/python2.3/config",string.join(string.split(distutils.sysconfig.get_config_var("MODLIBS"))) diff --git a/dev-lang/python/files/python-updater b/dev-lang/python/files/python-updater new file mode 100644 index 000000000000..95662876e54f --- /dev/null +++ b/dev-lang/python/files/python-updater @@ -0,0 +1,246 @@ +#!/bin/sh +# +# A bit of hackery to update everything that is humanly possible +# that maybe related to an older version of python. This script can +# be run as many times as you like. It will log the results in +# /tmp/python-updater.log +# +# OLD_PY_VER = old python version we are upgrading from +# NEW_PY_VER = new python version we are upgrading to +# PKGS_EXCEPTIONS = packages that should NOT be re-emerged for any reason +# PKGS_MANUAL = packages that should be re-emerged even if they don't +# fit the criteria (eg. ones that have python compiled +# statically) - FIXME +# +# Runtime Variables: +# +# PKGS_TO_REMERGE = list of packages we deem to need re-emerging +# PKGS_OK = list of packages that should be merged without any problems +# PKGS_MISSING = list of packages that are installed, but cannot be merged +# because they have been pruned from portage +# PKGS_MASKED = list of packages that are installed, but masked. +# + +OLD_PY_VER=2.2 +NEW_PY_VER=$(python -V 2>&1 | sed 's:Python ::' | cut -d. -f1-2) +OLD_MODULES_DIR=/usr/lib/python${OLD_PY_VER} + +PKGS_EXCEPTIONS="dev-lang/python" +PKGS_MANUAL="app-office/gnumeric app-office/dia x11-libs/vte" +LOGFILE="/tmp/python-updater.log" + +# portage variables +PKG_DBDIR=/var/db/pkg +PORTDIR=`portageq portdir` +PORTDIR_OVERLAYS=`portageq portdir_overlay` + +PRETEND=0 +PKGS_TO_REMERGE="" +PKGS_COUNT_REMERGE=0 + +# load the gentoo-style info macros, but hack to get around +# it thinking this is an rc script +EBUILD="1" +source /sbin/functions.sh + +# misc helper functions +eloginfo() { + einfo $* + DATESTRING=`date +"%Y/%m/%d %H:%M:%S"` + echo "${DATESTRING} - ${*}" >> ${LOGFILE} +} + +elogecho() { + echo -n " " + echo $* + DATESTRING=`date +"%Y/%m/%d %H:%M:%S"` + echo "${DATESTRING} - ${*}" >> ${LOGFILE} +} + +elogerr() { + eerror $* + DATESTRING=`date +"%Y/%m/%d %H:%M:%S"` + echo "${DATESTRING} ! ${*}" >> ${LOGFILE} +} + +elog() { + DATESTRING=`date +"%Y/%m/%d %H:%M:%S"` + echo "${DATESTRING} - ${*}" >> ${LOGFILE} +} + +# +# +# Command Line Parsing +# +# + +if [ -n "$1" ]; then + case "$1" in + -h) + echo "usage: python-updater [-h|-p]" + echo " -h help" + echo " -p pretend (don't do anything)" + ;; + -p) + PRETEND=1 + ;; + *) + ;; + esac +fi + +# +# +# Find all packages that have installed something in +# /usr/lib/python${OLD_PY_VER} +# +# + +eloginfo "Starting Python Updater from ${OLD_PY_VER} to ${NEW_PY_VER} :" +eloginfo "Searching for packages with files in ${OLD_MODULES_DIR} .." + +# iterate thru all the installed package's contents +for content in `find ${PKG_DBDIR} -name CONTENTS`; do + # extract the category, package name and package version + CATPKGVER=$(echo ${content} | sed "s:${PKG_DBDIR}/\(.*\)/CONTENTS:\1:") + + # exclude packages that are an exception, like portage and python itself. + exception=0 + for exp in ${PKGS_EXCEPTIONS}; do + if [ -n "$(echo ${CATPKGVER} | grep ${exp})" ]; then + exception=1 + break; + fi + done + + if [ ${exception} = 1 ]; then + continue; + fi + + if fgrep "${OLD_MODULES_DIR}" ${content} > /dev/null; then + PKGS_TO_REMERGE="${PKGS_TO_REMERGE} ${CATPKGVER}" + elogecho "Adding to list: ${CATPKGVER}" + fi +done + +# now we have to do each emerge seperately because if an installed version +# does not have the corresponding ebuild in portage, then it will bail. + +eloginfo "Calculating Upgrade Package List .." + +PKGS_OK="" +PKGS_MASKED="" +PKGS_MISSING="" + +MASKED_STRING="been masked" +MISSING_STRING="there are no masked or unmasked ebuilds to satisfy" + +for pkg in ${PKGS_TO_REMERGE}; do + emerge_output="$(emerge -p \=$pkg 2>&1)" + if $(echo "${emerge_output}" | grep "${MASKED_STRING}" > /dev/null); then + PKGS_MASKED="${PKGS_MASKED} $pkg" + elogecho "$pkg is masked" + elif $(echo "${emerge_output}" | grep "${MISSING_STRING}" > /dev/null); then + PKGS_MISSING="${PKGS_MISSING} $pkg" + elogecho "$pkg is missing from portage" + else + PKGS_OK="${PKGS_OK} $pkg" + PKGS_COUNT_REMERGE=$((PKGS_COUNT_REMERGE + 1)) + fi +done + +# +# Check the actual order which these should be merged (probably doesn't work) +# + +eloginfo "Re-ordering packages to merge .." + +PKGS_OK_SORTED_CMD="emerge -p " +for pkg in $PKGS_OK; do + PKGS_OK_SORTED_CMD="${PKGS_OK_SORTED_CMD} =$pkg" +done +PKGS_OK_SORTED_CMD="${PKGS_OK_SORTED_CMD}" + +eloginfo "Preparing to merge these packages in this order:" +PKGS_OK_SORTED="`${PKGS_OK_SORTED_CMD} | grep ebuild | sed 's:\[ebuild.*\] ::'`" +for pkg in $PKGS_OK_SORTED; do + elogecho "$pkg" +done + +# we emerge each package seperately to ensure we know exactly which ones might +# cause an error, and then report it at the end + +COUNT=1 +PKGS_FAILED="" +if [ "${PRETEND}" != "1" ]; then + for pkg in ${PKGS_OK}; do + eloginfo "Starting to merge ($COUNT/$PKGS_COUNT_REMERGE) $pkg .." + if ! emerge --oneshot --nodeps =$pkg; then + PKGS_FAILED="${PKGS_FAILED} $pkg" + elogerr "Failed merging $pkg ($COUNT/$PKGS_COUNT_REMERGE)!" + fi + COUNT=$((COUNT+1)) + done +fi + +# final output stuff +OUTPUT_PKGS_MASKED="" +for pkg in ${PKGS_MASKED}; do OUTPUT_PKGS_MASKED="${OUTPUT_PKGS_MASKED} \=$pkg"; done +OUTPUT_PKGS_MISSING="" +for pkg in ${PKGS_MISSING}; do OUTPUT_PKGS_MISSING="${OUTPUT_PKGS_MISSING} $pkg"; done +OUTPUT_PKGS_FAILED="" +for pkg in ${PKGS_FAILED}; do OUTPUT_PKGS_FAILED="${OUTPUT_PKGS_FAILED} \=$pkg"; done + +if [ -n "${PKGS_FAILED}" -o -n "${PKGS_MISSING}" -o -n "${PKGS_MASKED}" ]; then + ewarn "************************************************************" + ewarn "* Packages that still need to be manually emerged : *" + ewarn "************************************************************" + if [ -n "${OUTPUT_PKGS_MASKED}" ]; then + ewarn " Masked Packages:" + ewarn " ----------------" + ewarn " Unmask the following packages (at your own risk) and " + ewarn " emerge them using this command after removing the '-p'" + ewarn " parameter." + ewarn "" + ewarn " emerge -p ${OUTPUT_PKGS_MASKED}" + ewarn "" + fi + if [ -n "${OUTPUT_PKGS_MISSING}" ]; then + ewarn " Missing Packages:" + ewarn " -----------------" + ewarn " These packages need to be updated because their versions do" + ewarn " not exist in portage anymore." + ewarn "" + for x in ${OUTPUT_PKGS_MISSING}; do + echo " ${x}" + done + ewarn "" + fi + if [ -n "${OUTPUT_PKGS_FAILED}" ]; then + ewarn " Failed Packaged:" + ewarn " ----------------" + ewarn " These packages have failed and need to be re-emerged again." + ewarn " Alternatively, try re-running this script again to see if it" + ewarn " can be fixed." + ewarn "" + ewarn " emerge -p ${OUTPUT_PKGS_FAILED}" + ewarn "" + fi + + elog "Python update completed with errors." + elog "Masked Packages:" + for x in ${PKGS_MASKED}; do + elog $x + done + elog "Missing Packages:" + for x in ${PKGS_MISSING}; do + elog $x + done + elog "Failed Packages:" + for x in ${PKGS_FAILED}; do + elog $x + done + elog "Update script completed." +else + eloginfo "Python update completed successfully." +fi diff --git a/dev-lang/python/python-2.2.3-r2.ebuild b/dev-lang/python/python-2.2.3-r2.ebuild new file mode 100644 index 000000000000..8fdc6a0da838 --- /dev/null +++ b/dev-lang/python/python-2.2.3-r2.ebuild @@ -0,0 +1,118 @@ +# Copyright 1999-2003 Gentoo Technologies, Inc. +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/python-2.2.3-r2.ebuild,v 1.1 2003/10/07 21:29:09 liquidx Exp $ + +inherit flag-o-matic eutils alternatives + +IUSE="readline tcltk berkdb bootstrap build doc" + +PYVER_MAJOR="`echo ${PV%_*} | cut -d '.' -f 1`" +PYVER_MINOR="`echo ${PV%_*} | cut -d '.' -f 2`" +PYVER="${PYVER_MAJOR}.${PYVER_MINOR}" + +S="${WORKDIR}/Python-${PV}" +DESCRIPTION="A really great language" +SRC_URI="http://www.python.org/ftp/python/${PV%_*}/Python-${PV}.tgz" + +HOMEPAGE="http://www.python.org" +LICENSE="PSF-2.2" +KEYWORDS="~amd64 ~x86 ~ppc ~sparc ~alpha ~mips ~hppa ~arm ~ia64" + +DEPEND="virtual/glibc >=sys-libs/zlib-1.1.3 + doc? ( =dev-python/python-docs-${PV}* ) + readline? ( >=sys-libs/readline-4.1 >=sys-libs/ncurses-5.2 ) + berkdb? ( >=sys-libs/db-3 ) + tcltk? ( >=dev-lang/tk-8.0 ) + || ( dev-libs/expat + ( !build? ( dev-libs/expat ) ) + ( !bootstrap? ( dev-libs/expat ) ) + )" +# This is a hairy one. Basically depend on dev-libs/expat +# if "build" or "bootstrap" not in USE. + +RDEPEND="${DEPEND} dev-python/python-fchksum" + +# The dev-python/python-fchksum RDEPEND is needed to that this python provides +# the functionality expected from previous pythons. + +PROVIDE="virtual/python" + +SLOT="2.2" + +src_unpack() { + unpack ${A} + epatch ${FILESDIR}/${P}-db4.patch + EPATCH_OPTS="-d ${S}" epatch ${FILESDIR}/${PN}-2.3-add_portage_search_path.patch +} + +src_compile() { + filter-flags -malign-double + + [ "${ARCH}" = "hppa" ] && append-flags -fPIC + [ "${ARCH}" = "alpha" ] && append-flags -fPIC + export OPT="${CFLAGS}" + + # adjust makefile to install pydoc into ${D} correctly + t="${S}/Makefile.pre.in" + cp ${t} ${t}.orig || die + sed 's:install-platlib.*:& --install-scripts=$(BINDIR):' ${t}.orig > ${t} + + local myopts + #if we are creating a new build image, we remove the dependency on g++ + if [ "`use build`" -a ! "`use bootstrap`" ] + then + myopts="--with-cxx=no" + fi + + # build python with threads support + myopts="${myopts} --with-threads" + + econf --with-fpectl \ + --infodir='${prefix}'/share/info \ + --mandir='${prefix}'/share/man \ + ${myopts} || die + emake || die "Parallel make failed" +} + +src_install() { + dodir /usr + make install prefix=${D}/usr || die + + rm -f ${D}/usr/bin/python + dodoc README + + # install our own custom python-config + exeinto /usr/bin + newexe ${FILESDIR}/python-config-${PYVER} python-config + + # seems like the build do not install Makefile.pre.in anymore + # it probably shouldn't - use DistUtils, people! + insinto /usr/lib/python${PYVER}/config + doins ${S}/Makefile.pre.in + + # While we're working on the config stuff... Let's fix the OPT var + # so that it doesn't have any opts listed in it. Prevents the problem + # with compiling things with conflicting opts later. + dosed -e 's:^OPT=.*:OPT=-DNDEBUG:' /usr/lib/python${PYVER}/config/Makefile + + # If USE tcltk lets install idle + # Need to script the python version in the path + if [ -n "`use tcltk`" ]; then + dodir /usr/lib/python${PYVER}/tools + cp -r "${S}/Tools/idle" "${D}/usr/lib/python${PYVER}/tools/" + dosym /usr/bin/idle.py /usr/lib/python${PYVER}/tools/idle/idle.py + fi +} + +python_makesym() { + alternatives_auto_makesym "/usr/bin/python" "/usr/bin/python[0-9].[0-9]" + alternatives_auto_makesym "/usr/bin/python2" "/usr/bin/python[0-9].[0-9]" +} + +pkg_postinst() { + python_makesym +} + +pkg_postrm() { + python_makesym +} diff --git a/dev-lang/python/python-2.3.2.ebuild b/dev-lang/python/python-2.3.2.ebuild new file mode 100644 index 000000000000..c5fbf8008d34 --- /dev/null +++ b/dev-lang/python/python-2.3.2.ebuild @@ -0,0 +1,124 @@ +# Copyright 1999-2003 Gentoo Technologies, Inc. +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/python-2.3.2.ebuild,v 1.1 2003/10/07 21:29:09 liquidx Exp $ + +inherit flag-o-matic alternatives + +MY_PV=${PV/_rc/c} +PYVER_MAJOR="`echo ${PV%_*} | cut -d '.' -f 1`" +PYVER_MINOR="`echo ${PV%_*} | cut -d '.' -f 2`" +PYVER="${PYVER_MAJOR}.${PYVER_MINOR}" + +S="${WORKDIR}/Python-${MY_PV}" +DESCRIPTION="A really great language" +SRC_URI="http://www.python.org/ftp/python/${PV%_*}/Python-${MY_PV}.tgz" +HOMEPAGE="http://www.python.org" + +IUSE="readline tcltk berkdb bootstrap ipv6 cjk" +LICENSE="PSF-2.2" +SLOT="2.3" + +KEYWORDS="~x86" +# "~ppc ~sparc ~alpha ~mips ~hppa ~arm" + +DEPEND="virtual/glibc + >=sys-libs/zlib-1.1.3 + readline? ( >=sys-libs/readline-4.1 >=sys-libs/ncurses-5.2 ) + berkdb? ( >=sys-libs/db-3 ) + tcltk? ( >=dev-lang/tk-8.0 ) + || ( dev-libs/expat + ( !build? ( dev-libs/expat ) ) + ( !bootstrap? ( dev-libs/expat ) ) + )" +# This is a hairy one. Basically depend on dev-libs/expat +# if "build" or "bootstrap" not in USE. + +RDEPEND="${DEPEND} dev-python/python-fchksum" + +# The dev-python/python-fchksum RDEPEND is needed to that this python provides +# the functionality expected from previous pythons. + +PROVIDE="virtual/python" + + +src_unpack() { + unpack ${A} + EPATCH_OPTS="-d ${S}" epatch ${FILESDIR}/${PN}-2.3-add_portage_search_path.patch +} + +src_compile() { + filter-flags -malign-double + + [ "${ARCH}" = "hppa" ] && append-flags -fPIC + [ "${ARCH}" = "alpha" ] && append-flags -fPIC + export OPT="${CFLAGS}" + + local myconf + #if we are creating a new build image, we remove the dependency on g++ + if [ "`use build`" -a ! "`use bootstrap`" ] + then + myconf="--with-cxx=no" + fi + + # FIXME: (need to verify the consequences of this, probably breaks tkinter?) + # use unicode ucs4 if cjk, otherwise use ucs2. + use cjk \ + && myconf="${myconf} --enable-unicode=ucs4" \ + || myconf="${myconf} --enable-unicode=ucs2" + + econf --with-fpectl \ + --enable-shared \ + `use_enable ipv6` \ + --infodir='${prefix}'/share/info \ + --mandir='${prefix}'/share/man \ + --with-threads \ + ${myconf} || die + emake || die "Parallel make failed" +} + +src_install() { + dodir /usr + make DESTDIR="${D}" altinstall || die + + # install our own custom python-config + exeinto /usr/bin + newexe ${FILESDIR}/python-config-${PV} python-config + + # This stuff below extends from 2.1, and should be deprecated in 2.3, + # or possibly can wait till 2.4 + + # seems like the build do not install Makefile.pre.in anymore + # it probably shouldn't - use DistUtils, people! + insinto /usr/lib/python${PYVER}/config + doins ${S}/Makefile.pre.in + + # While we're working on the config stuff... Let's fix the OPT var + # so that it doesn't have any opts listed in it. Prevents the problem + # with compiling things with conflicting opts later. + dosed -e 's:^OPT=.*:OPT=-DNDEBUG:' /usr/lib/python${PYVER}/config/Makefile + +} + +python_makesym() { + alternatives_auto_makesym "/usr/bin/python" "/usr/bin/python[0-9].[0-9]" + alternatives_auto_makesym "/usr/bin/python2" "/usr/bin/python[0-9].[0-9]" +} + +pkg_postrm() { + python_makesym +} + +pkg_postinst() { + python_makesym + + ewarn "If you have just upgraded from python-2.2.x you will need to run:" + ewarn + ewarn "${PORTDIR}/dev-lang/python/files/python-updater" + ewarn + ewarn "This will automatically rebuild all the python dependent modules" + ewarn "to run with python-2.3." + ewarn + ewarn "Python 2.2 is still installed and can be accessed via /usr/bin/python2.2." + ewarn "Portage-2.0.49-r8 and below will continue to use python-2.2.x, so" + ewarn "think twice about uninstalling it otherwise your system will break." +} |