diff options
author | Steven J Newbury <steve@snewbury.org.uk> | 2009-04-07 20:13:52 +0100 |
---|---|---|
committer | Steven J Newbury <steve@snewbury.org.uk> | 2009-04-07 20:13:52 +0100 |
commit | 76349d9f1ffc1c7f71d820f9103fab7d2e0693f2 (patch) | |
tree | 83ac6233f74c73fc56f18fb341877590839a1896 /dev-lang/python/python-2.5.2-r7.ebuild | |
parent | Revert "Fix dev-lang/python" (diff) | |
download | multilib-portage-76349d9f1ffc1c7f71d820f9103fab7d2e0693f2.tar.gz multilib-portage-76349d9f1ffc1c7f71d820f9103fab7d2e0693f2.tar.bz2 multilib-portage-76349d9f1ffc1c7f71d820f9103fab7d2e0693f2.zip |
Revert "Revert "Fix dev-lang/python""
This reverts commit 924dd5a42887cdca9521a310bd31617cde189273.
Diffstat (limited to 'dev-lang/python/python-2.5.2-r7.ebuild')
-rw-r--r-- | dev-lang/python/python-2.5.2-r7.ebuild | 158 |
1 files changed, 51 insertions, 107 deletions
diff --git a/dev-lang/python/python-2.5.2-r7.ebuild b/dev-lang/python/python-2.5.2-r7.ebuild index ea976f32d..8cd0d9d77 100644 --- a/dev-lang/python/python-2.5.2-r7.ebuild +++ b/dev-lang/python/python-2.5.2-r7.ebuild @@ -1,15 +1,17 @@ # Copyright 1999-2009 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/python-2.5.2-r7.ebuild,v 1.15 2009/03/26 05:10:31 zmedico Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/python-2.6.1-r1.ebuild,v 1.2 2009/03/26 05:10:31 zmedico Exp $ # NOTE about python-portage interactions : # - Do not add a pkg_setup() check for a certain version of portage # in dev-lang/python. It _WILL_ stop people installing from # Gentoo 1.4 images. -EAPI="2" +EAPI=2 -inherit eutils autotools flag-o-matic python versionator toolchain-funcs alternatives libtool multilib-native +MULTILIB_IN_SOURCE_BUILD="yes" + +inherit eutils autotools flag-o-matic python versionator toolchain-funcs libtool multilib-native # we need this so that we don't depends on python.eclass PYVER_MAJOR=$(get_major_version) @@ -32,17 +34,17 @@ IUSE="ncurses gdbm ssl readline tk berkdb ipv6 build ucs2 sqlite doc +threads ex # NOTE: dev-python/{elementtree,celementtree,pysqlite,ctypes,cjkcodecs} # do not conflict with the ones in python proper. - liquidx -DEPEND=">=sys-libs/zlib-1.1.3[lib32?] +DEPEND=">=app-admin/eselect-python-20080925 + >=sys-libs/zlib-1.1.3[lib32?] !build? ( sqlite? ( >=dev-db/sqlite-3[lib32?] ) - tk? ( >=dev-lang/tk-8.0 ) + tk? ( >=dev-lang/tk-8.0[lib32?] ) ncurses? ( >=sys-libs/ncurses-5.2[lib32?] readline? ( >=sys-libs/readline-4.1[lib32?] ) ) - berkdb? ( || ( sys-libs/db:4.5[lib32?] sys-libs/db:4.4[lib32?] - sys-libs/db:4.3[lib32?] sys-libs/db:4.2[lib32?] ) ) + berkdb? ( >=sys-libs/db-3.1[lib32?] ) gdbm? ( sys-libs/gdbm[lib32?] ) ssl? ( dev-libs/openssl[lib32?] ) - doc? ( dev-python/python-docs:2.5 ) + doc? ( dev-python/python-docs:2.6 ) xml? ( dev-libs/expat[lib32?] ) )" @@ -53,14 +55,17 @@ PDEPEND="${DEPEND} app-admin/python-updater" PROVIDE="virtual/python" multilib-native_src_prepare_internal() { - if tc-is-cross-compiler ; then - epatch "${FILESDIR}"/python-2.4.4-test-cross.patch \ - "${FILESDIR}"/python-2.5-cross-printf.patch - else - rm -f "${WORKDIR}/${PV}"/*_all_crosscompile.patch + default + + if tc-is-cross-compiler ; then + epatch "${FILESDIR}"/python-2.4.4-test-cross.patch \ + "${FILESDIR}"/python-2.5-cross-printf.patch + else + rm "${WORKDIR}/${PV}"/*_all_crosscompile.patch fi EPATCH_SUFFIX="patch" epatch "${WORKDIR}/${PV}" + sed -i -e "s:@@GENTOO_LIBDIR@@:$(get_libdir):g" \ Lib/distutils/command/install.py \ Lib/distutils/sysconfig.py \ @@ -68,7 +73,7 @@ multilib-native_src_prepare_internal() { Makefile.pre.in \ Modules/Setup.dist \ Modules/getpath.c \ - setup.py || die + setup.py || die "sed failed to replace @@GENTOO_LIBDIR@@" # fix os.utime() on hppa. utimes it not supported but unfortunately reported as working - gmsoft (22 May 04) # PLEASE LEAVE THIS FIX FOR NEXT VERSIONS AS IT'S A CRITICAL FIX !!! @@ -82,7 +87,7 @@ multilib-native_src_prepare_internal() { eautoreconf } -src_configure_internal() { +multilib-native_src_configure_internal() { # disable extraneous modules with extra dependencies if use build; then export PYTHON_DISABLE_MODULES="readline pyexpat dbm gdbm bsddb _curses _curses_panel _tkinter _sqlite3" @@ -93,13 +98,13 @@ src_configure_internal() { local disable use berkdb || use gdbm || disable="${disable} dbm" use berkdb || disable="${disable} bsddb" + use xml || disable="${disable} pyexpat" use gdbm || disable="${disable} gdbm" use ncurses || disable="${disable} _curses _curses_panel" use readline || disable="${disable} readline" use sqlite || disable="${disable} _sqlite3" use ssl || export PYTHON_DISABLE_SSL=1 use tk || disable="${disable} _tkinter" - use xml || disable="${disable} pyexpat" export PYTHON_DISABLE_MODULES="${disable}" fi @@ -110,27 +115,6 @@ src_configure_internal() { fi einfo "Disabled modules: $PYTHON_DISABLE_MODULES" -} - -src_configure() { :; } - -multilib-native_src_compile_internal() { - filter-flags -malign-double - - # Seems to no longer be necessary - #[ "${ARCH}" = "amd64" ] && append-flags -fPIC - [ "${ARCH}" = "alpha" ] && append-flags -fPIC - - # http://bugs.gentoo.org/show_bug.cgi?id=50309 - if is-flag -O3; then - is-flag -fstack-protector-all && replace-flags -O3 -O2 - use hardened && replace-flags -O3 -O2 - fi - - # See #228905 - if [[ $(gcc-major-version) -ge 4 ]]; then - append-flags -fwrapv - fi export OPT="${CFLAGS}" @@ -143,15 +127,21 @@ multilib-native_src_compile_internal() { && myconf="${myconf} --enable-unicode=ucs2" \ || myconf="${myconf} --enable-unicode=ucs4" - use threads \ - && myconf="${myconf} --with-threads" \ - || myconf="${myconf} --without-threads" + filter-flags -malign-double - src_configure_internal + # Seems to no longer be necessary + #[ "${ARCH}" = "amd64" ] && append-flags -fPIC + [ "${ARCH}" = "alpha" ] && append-flags -fPIC + + # http://bugs.gentoo.org/show_bug.cgi?id=50309 + if is-flag -O3; then + is-flag -fstack-protector-all && replace-flags -O3 -O2 + use hardened && replace-flags -O3 -O2 + fi if tc-is-cross-compiler ; then OPT="-O1" CFLAGS="" LDFLAGS="" CC="" \ - ./configure --{build,host}=${CBUILD} || die "cross-configure failed" + ./configure || die "cross-configure failed" emake python Parser/pgen || die "cross-make failed" mv python hostpython mv Parser/pgen Parser/hostpgen @@ -159,7 +149,7 @@ multilib-native_src_compile_internal() { sed -i \ -e '/^HOSTPYTHON/s:=.*:=./hostpython:' \ -e '/^HOSTPGEN/s:=.*:=./Parser/hostpgen:' \ - Makefile.pre.in || die + Makefile.pre.in || die "sed failed" fi # export CXX so it ends up in /usr/lib/python2.x/config/Makefile @@ -173,18 +163,17 @@ multilib-native_src_compile_internal() { econf \ --with-fpectl \ --enable-shared \ - `use_enable ipv6` \ + $(use_enable ipv6) \ + $(use_with threads) \ --infodir='${prefix}'/share/info \ --mandir='${prefix}'/share/man \ --with-libc='' \ - ${myconf} || die - emake || die "Parallel make failed" + ${myconf} } multilib-native_src_install_internal() { dodir /usr - src_configure_internal - make DESTDIR="${D}" altinstall maninstall || die + emake DESTDIR="${D}" altinstall maninstall || die mv "${D}"/usr/bin/python${PYVER}-config "${D}"/usr/bin/python-config-${PYVER} if [[ $(number_abis) -gt 1 ]] && ! is_final_abi; then @@ -192,6 +181,7 @@ multilib-native_src_install_internal() { fi # Fix slotted collisions + mv "${D}"/usr/bin/2to3 "${D}"/usr/bin/2to3-${PYVER} mv "${D}"/usr/bin/pydoc "${D}"/usr/bin/pydoc${PYVER} mv "${D}"/usr/bin/idle "${D}"/usr/bin/idle${PYVER} mv "${D}"/usr/share/man/man1/python.1 \ @@ -223,75 +213,28 @@ multilib-native_src_install_internal() { doins "${S}"/Makefile.pre.in if use examples ; then - mkdir -p "${D}"/usr/share/doc/${P}/examples - cp -r "${S}"/Tools "${D}"/usr/share/doc/${P}/examples + insinto /usr/share/doc/${PF}/examples + doins -r "${S}"/Tools || die "doins failed" fi newinitd "${FILESDIR}/pydoc.init" pydoc-${SLOT} newconfd "${FILESDIR}/pydoc.conf" pydoc-${SLOT} + + # Installs empty directory. + rmdir "${D}"/usr/$(get_libdir)/${PN}${PV}/lib-old } multilib-native_pkg_postrm_internal() { - local mansuffix=$(ecompress --suffix) - python_makesym - alternatives_auto_makesym "/usr/bin/idle" "idle[0-9].[0-9]" - alternatives_auto_makesym "/usr/bin/pydoc" "pydoc[0-9].[0-9]" - alternatives_auto_makesym "/usr/bin/python-config" \ - "python-config-[0-9].[0-9]" - - alternatives_auto_makesym "/usr/share/man/man1/python.1${mansuffix}" \ - "python[0-9].[0-9].1${mansuffix}" - - python_mod_cleanup /usr/lib/python${PYVER} - [[ "$(get_libdir)" == "lib" ]] || \ - python_mod_cleanup /usr/$(get_libdir)/python${PYVER} + eselect python update --ignore 3.0 + python_mod_cleanup /usr/$(get_libdir)/python${PYVER} } multilib-native_pkg_postinst_internal() { - local myroot - myroot=$(echo $ROOT | sed 's:/$::') - local mansuffix=$(ecompress --suffix) + eselect python update --ignore 3.0 + python_version - python_makesym - alternatives_auto_makesym "/usr/bin/idle" "idle[0-9].[0-9]" - alternatives_auto_makesym "/usr/bin/pydoc" "pydoc[0-9].[0-9]" - alternatives_auto_makesym "/usr/bin/python-config" \ - "python-config-[0-9].[0-9]" - - alternatives_auto_makesym "/usr/share/man/man1/python.1${mansuffix}" \ - "python[0-9].[0-9].1${mansuffix}" - - python_mod_optimize python_mod_optimize -x "(site-packages|test)" \ - /usr/lib/python${PYVER} - [[ "$(get_libdir)" == "lib" ]] || \ - python_mod_optimize -x "(site-packages|test)" \ - /usr/$(get_libdir)/python${PYVER} - - # workaround possible python-upgrade-breaks-portage situation - if [ ! -f ${myroot}/usr/lib/portage/pym/portage.py ]; then - if [ -f ${myroot}/usr/lib/python2.3/site-packages/portage.py ]; then - einfo "Working around possible python-portage upgrade breakage" - mkdir -p ${myroot}/usr/lib/portage/pym - cp ${myroot}/usr/lib/python2.4/site-packages/{portage,xpak,output,cvstree,getbinpkg,emergehelp,dispatch_conf}.py ${myroot}/usr/lib/portage/pym - python_mod_optimize /usr/lib/portage/pym - fi - fi - - echo - ewarn - ewarn "If you have just upgraded from an older version of python you will" - ewarn "need to run:" - ewarn - ewarn "/usr/sbin/python-updater" - ewarn - ewarn "This will automatically rebuild all the python dependent modules" - ewarn "to run with python-${PYVER}." - ewarn - ewarn "Your original Python is still installed and can be accessed via" - ewarn "/usr/bin/python2.x." - ewarn - ebeep 5 + /usr/$(get_libdir)/python${PYVER} } src_test() { @@ -301,12 +244,13 @@ src_test() { return fi - # Disabling byte compiling breaks test_import + # Byte compiling should be enabled here. + # Otherwise test_import fails. python_enable_pyc #skip all tests that fail during emerge but pass without emerge: #(See bug# 67970) - local skip_tests="distutils global mimetools minidom mmap posix pyexpat sax strptime subprocess syntax tcl time urllib urllib2 webbrowser xml_etree" + local skip_tests="distutils global httpservers mimetools minidom mmap posix pyexpat sax strptime subprocess syntax tcl time urllib urllib2 webbrowser xml_etree" # test_pow fails on alpha. # http://bugs.python.org/issue756093 |