diff options
author | Alastair Tse <liquidx@gentoo.org> | 2006-08-16 14:59:26 +0000 |
---|---|---|
committer | Alastair Tse <liquidx@gentoo.org> | 2006-08-16 14:59:26 +0000 |
commit | 31a66d96fbe73aa52d85fac5d6bc7dcb44723f4a (patch) | |
tree | 3e0b908f2b993a38b93a612d42bbe6490671b3a2 | |
parent | update manifest (diff) | |
download | liquidx-31a66d96fbe73aa52d85fac5d6bc7dcb44723f4a.tar.gz liquidx-31a66d96fbe73aa52d85fac5d6bc7dcb44723f4a.tar.bz2 liquidx-31a66d96fbe73aa52d85fac5d6bc7dcb44723f4a.zip |
experimental python 2.4.3 ebuild to completely support multilib rather than a half supported version.
svn path=/; revision=59
-rw-r--r-- | dev-lang/python/files/patches/2.4-mimetypes_apache.patch | 11 | ||||
-rw-r--r-- | dev-lang/python/files/patches/2.4.1-libdir.patch | 176 | ||||
-rw-r--r-- | dev-lang/python/files/patches/2.4.1-st_flags.patch | 185 | ||||
-rw-r--r-- | dev-lang/python/files/patches/2.4.2-readline.patch | 287 | ||||
-rw-r--r-- | dev-lang/python/files/patches/2.4.3-libdir.patch | 156 | ||||
-rw-r--r-- | dev-lang/python/python-2.4.3-r2.ebuild | 301 |
6 files changed, 1116 insertions, 0 deletions
diff --git a/dev-lang/python/files/patches/2.4-mimetypes_apache.patch b/dev-lang/python/files/patches/2.4-mimetypes_apache.patch new file mode 100644 index 0000000..7254aa0 --- /dev/null +++ b/dev-lang/python/files/patches/2.4-mimetypes_apache.patch @@ -0,0 +1,11 @@ +--- Lib/mimetypes.py.old 2004-01-24 21:48:39.957577048 +0000 ++++ Lib/mimetypes.py 2004-01-24 21:49:27.023421952 +0000 +@@ -33,6 +33,8 @@ + + knownfiles = [ + "/etc/mime.types", ++ "/etc/apache/conf/mime.types", # Apache 1.x for Gentoo ++ "/etc/apache2/conf/mime.types", # Apache 2.x for Gentoo + "/usr/local/etc/httpd/conf/mime.types", + "/usr/local/lib/netscape/mime.types", + "/usr/local/etc/httpd/conf/mime.types", # Apache 1.2 diff --git a/dev-lang/python/files/patches/2.4.1-libdir.patch b/dev-lang/python/files/patches/2.4.1-libdir.patch new file mode 100644 index 0000000..9312ddd --- /dev/null +++ b/dev-lang/python/files/patches/2.4.1-libdir.patch @@ -0,0 +1,176 @@ +--- Python-2.4.1/Lib/distutils/command/install.py ++++ Python-2.4.1/Lib/distutils/command/install.py +@@ -39,15 +39,15 @@ else: + INSTALL_SCHEMES = { + 'unix_prefix': { +- 'purelib': '$base/lib/python$py_version_short/site-packages', ++ 'purelib': '$base/@@GENTOO_LIBDIR@/python$py_version_short/site-packages', +- 'platlib': '$platbase/lib/python$py_version_short/site-packages', ++ 'platlib': '$platbase/@@GENTOO_LIBDIR@@/python$py_version_short/site-packages', + 'headers': '$base/include/python$py_version_short/$dist_name', + 'scripts': '$base/bin', + 'data' : '$base', + }, + 'unix_home': { +- 'purelib': '$base/lib/python', ++ 'purelib': '$base/@@GENTOO_LIBDIR/python', +- 'platlib': '$base/lib/python', ++ 'platlib': '$base/@@GENTOO_LIBDIR@@/python', + 'headers': '$base/include/python/$dist_name', + 'scripts': '$base/bin', + 'data' : '$base', +--- Python-2.4.1/Lib/distutils/sysconfig.py ++++ Python-2.4.1/Lib/distutils/sysconfig.py +@@ -99,9 +99,9 @@ def get_python_lib(plat_specific=0, stan + prefix = plat_specific and EXEC_PREFIX or PREFIX + + if os.name == "posix": + libpython = os.path.join(prefix, +- "lib", "python" + get_python_version()) ++ "@@GENTOO_LIBDIR@@", "python" + get_python_version()) + if standard_lib: + return libpython + else: +--- Python-2.4.1/Lib/site.py ++++ Python-2.4.1/Lib/site.py +@@ -179,10 +179,20 @@ def addsitepackages(known_paths): + sitedirs = [os.path.join(prefix, "Lib", "site-packages")] + elif os.sep == '/': + sitedirs = [os.path.join(prefix, ++ "@@GENTOO_LIBDIR@@", ++ "python" + sys.version[:3], ++ "site-packages"), ++ os.path.join(prefix, + "lib", + "python" + sys.version[:3], + "site-packages"), ++ os.path.join(prefix, "lib64", "site-python"), + os.path.join(prefix, "lib", "site-python")] ++ tmp_sitedirs = [] ++ for sdir in sitedirs: ++ if sdir not in tmp_sitedirs: ++ tmp_sitedirs.append(sdir) ++ sitedirs = tmp_sitedirs + sitedirs = [os.path.join(prefix,"lib","portage","pym")] + sitedirs + else: + sitedirs = [prefix, os.path.join(prefix, "lib", "site-packages")] +--- Python-2.4.1/Makefile.pre.in ++++ Python-2.4.1/Makefile.pre.in +@@ -79,9 +79,9 @@ exec_prefix= @exec_prefix@ + + # Expanded directories + BINDIR= $(exec_prefix)/bin +-LIBDIR= $(exec_prefix)/lib ++LIBDIR= $(exec_prefix)/@@GENTOO_LIBDIR@@ + MANDIR= @mandir@ + INCLUDEDIR= @includedir@ + CONFINCLUDEDIR= $(exec_prefix)/include +--- Python-2.4.1/Modules/Setup.dist ++++ Python-2.4.1/Modules/Setup.dist +@@ -400,7 +400,7 @@ GLHACK=-Dclear=__GLclear + #DB=/usr/local/BerkeleyDB.4.0 + #DBLIBVER=4.0 + #DBINC=$(DB)/include +-#DBLIB=$(DB)/lib ++DBLIB=$(DB)/@@GENTOO_LIBDIR@@ + #_bsddb _bsddb.c -I$(DBINC) -L$(DBLIB) -ldb-$(DBLIBVER) + + # Historical Berkeley DB 1.85 +@@ -446,7 +446,7 @@ GLHACK=-Dclear=__GLclear + # Andrew Kuchling's zlib module. + # This require zlib 1.1.3 (or later). + # See http://www.gzip.org/zlib/ +-#zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib -lz ++#zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/@@GENTOO_LIBDIR@@ -lz + + # Interface to the Expat XML parser + # +--- Python-2.4.1/Modules/getpath.c ++++ Python-2.4.1/Modules/getpath.c +@@ -113,7 +113,7 @@ + + #ifndef PYTHONPATH + #define PYTHONPATH PREFIX "/lib/python" VERSION ":" \ +- EXEC_PREFIX "/lib/python" VERSION "/lib-dynload" ++ EXEC_PREFIX "/@@GENTOO_LIBDIR@@/python" VERSION "/lib-dynload" + #endif + + #ifndef LANDMARK +@@ -125,6 +125,7 @@ static char exec_prefix[MAXPATHLEN+1]; + static char progpath[MAXPATHLEN+1]; + static char *module_search_path = NULL; + static char lib_python[] = "lib/python" VERSION; ++static char lib_exec_python[] = "@@GENTOO_LIBDIR@@/python" VERSION; + + static void + reduce(char *dir) +@@ -321,7 +322,7 @@ search_for_exec_prefix(char *argv0_path, + strncpy(exec_prefix, delim+1, MAXPATHLEN); + else + strncpy(exec_prefix, home, MAXPATHLEN); +- joinpath(exec_prefix, lib_python); ++ joinpath(exec_prefix, lib_exec_python); + joinpath(exec_prefix, "lib-dynload"); + return 1; + } +@@ -338,7 +339,7 @@ search_for_exec_prefix(char *argv0_path, + copy_absolute(exec_prefix, argv0_path); + do { + n = strlen(exec_prefix); +- joinpath(exec_prefix, lib_python); ++ joinpath(exec_prefix, lib_exec_python); + joinpath(exec_prefix, "lib-dynload"); + if (isdir(exec_prefix)) + return 1; +@@ -348,7 +349,7 @@ search_for_exec_prefix(char *argv0_path, + + /* Look at configure's EXEC_PREFIX */ + strncpy(exec_prefix, EXEC_PREFIX, MAXPATHLEN); +- joinpath(exec_prefix, lib_python); ++ joinpath(exec_prefix, lib_exec_python); + joinpath(exec_prefix, "lib-dynload"); + if (isdir(exec_prefix)) + return 1; +@@ -525,7 +526,7 @@ calculate_path(void) + fprintf(stderr, + "Could not find platform dependent libraries <exec_prefix>\n"); + strncpy(exec_prefix, EXEC_PREFIX, MAXPATHLEN); +- joinpath(exec_prefix, "lib/lib-dynload"); ++ joinpath(exec_prefix, "@@GENTOO_LIBDIR@@/lib-dynload"); + } + /* If we found EXEC_PREFIX do *not* reduce it! (Yet.) */ + +--- Python-2.4.1/setup.py ++++ Python-2.4.1/setup.py +@@ -274,7 +275,7 @@ class PyBuildExt(build_ext): + # if a file is found in one of those directories, it can + # be assumed that no additional -I,-L directives are needed. + lib_dirs = self.compiler.library_dirs + [ +- '/lib64', '/usr/lib64', ++ '/@@GENTOO_LIBDIR@@', '/usr/@@GENTOO_LIBDIR@@', + '/lib', '/usr/lib', + ] + inc_dirs = self.compiler.include_dirs + ['/usr/include'] +@@ -437,11 +438,11 @@ class PyBuildExt(build_ext): + elif self.compiler.find_library_file(lib_dirs, 'curses'): + readline_libs.append('curses') + elif self.compiler.find_library_file(lib_dirs + +- ['/usr/lib/termcap'], ++ ['/usr/@@GENTOO_LIBDIR@@/termcap'], + 'termcap'): + readline_libs.append('termcap') + exts.append( Extension('readline', ['readline.c'], +- library_dirs=['/usr/lib/termcap'], ++ library_dirs=['/usr/@@GENTOO_LIBDIR@@/termcap'], + libraries=readline_libs) ) + if platform not in ['mac']: + # crypt module. +@@ -1015,7 +1016,7 @@ class PyBuildExt(build_ext): + added_lib_dirs.append('/usr/openwin/lib') + elif os.path.exists('/usr/X11R6/include'): + include_dirs.append('/usr/X11R6/include') +- added_lib_dirs.append('/usr/X11R6/lib64') ++ added_lib_dirs.append('/usr/X11R6/lib') + added_lib_dirs.append('/usr/X11R6/lib') + elif os.path.exists('/usr/X11R5/include'): + include_dirs.append('/usr/X11R5/include') diff --git a/dev-lang/python/files/patches/2.4.1-st_flags.patch b/dev-lang/python/files/patches/2.4.1-st_flags.patch new file mode 100644 index 0000000..a042bd2 --- /dev/null +++ b/dev-lang/python/files/patches/2.4.1-st_flags.patch @@ -0,0 +1,185 @@ +Only in Python-2.4.1-st_flags/: autom4te.cache +diff -ur Python-2.4.1/configure Python-2.4.1-st_flags/configure +--- Python-2.4.1/configure 2005-03-29 01:23:02.000000000 +0200 ++++ Python-2.4.1-st_flags/configure 2005-06-19 01:26:10.485461096 +0200 +@@ -16411,6 +16411,116 @@ + + fi + ++echo "$as_me:$LINENO: checking for struct stat.st_flags" >&5 ++echo $ECHO_N "checking for struct stat.st_flags... $ECHO_C" >&6 ++if test "${ac_cv_member_struct_stat_st_flags+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++else ++ cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ ++$ac_includes_default ++int ++main () ++{ ++static struct stat ac_aggr; ++if (ac_aggr.st_flags) ++return 0; ++ ; ++ return 0; ++} ++_ACEOF ++rm -f conftest.$ac_objext ++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ++ (eval $ac_compile) 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); } && ++ { ac_try='test -z "$ac_c_werror_flag" ++ || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; } && ++ { ac_try='test -s conftest.$ac_objext' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; }; then ++ ac_cv_member_struct_stat_st_flags=yes ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ ++$ac_includes_default ++int ++main () ++{ ++static struct stat ac_aggr; ++if (sizeof ac_aggr.st_flags) ++return 0; ++ ; ++ return 0; ++} ++_ACEOF ++rm -f conftest.$ac_objext ++if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ++ (eval $ac_compile) 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); } && ++ { ac_try='test -z "$ac_c_werror_flag" ++ || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; } && ++ { ac_try='test -s conftest.$ac_objext' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; }; then ++ ac_cv_member_struct_stat_st_flags=yes ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ac_cv_member_struct_stat_st_flags=no ++fi ++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ++fi ++rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ++fi ++echo "$as_me:$LINENO: result: $ac_cv_member_struct_stat_st_flags" >&5 ++echo "${ECHO_T}$ac_cv_member_struct_stat_st_flags" >&6 ++if test $ac_cv_member_struct_stat_st_flags = yes; then ++ ++cat >>confdefs.h <<_ACEOF ++#define HAVE_STRUCT_STAT_ST_FLAGS 1 ++_ACEOF ++ ++ ++fi ++ + echo "$as_me:$LINENO: checking for struct stat.st_blocks" >&5 + echo $ECHO_N "checking for struct stat.st_blocks... $ECHO_C" >&6 + if test "${ac_cv_member_struct_stat_st_blocks+set}" = set; then +diff -ur Python-2.4.1/configure.in Python-2.4.1-st_flags/configure.in +--- Python-2.4.1/configure.in 2005-03-29 01:23:34.000000000 +0200 ++++ Python-2.4.1-st_flags/configure.in 2005-06-19 01:25:34.050000128 +0200 +@@ -2421,6 +2421,7 @@ + AC_STRUCT_TIMEZONE + AC_CHECK_MEMBERS([struct stat.st_rdev]) + AC_CHECK_MEMBERS([struct stat.st_blksize]) ++AC_CHECK_MEMBERS([struct stat.st_flags]) + AC_STRUCT_ST_BLOCKS + + AC_MSG_CHECKING(for time.h that defines altzone) +Only in Python-2.4.1-st_flags/: configure.in.orig +diff -ur Python-2.4.1/Modules/posixmodule.c Python-2.4.1-st_flags/Modules/posixmodule.c +--- Python-2.4.1/Modules/posixmodule.c 2005-03-13 23:18:26.000000000 +0100 ++++ Python-2.4.1-st_flags/Modules/posixmodule.c 2005-06-19 01:25:34.048000432 +0200 +@@ -703,6 +703,9 @@ + #ifdef HAVE_STRUCT_STAT_ST_RDEV + {"st_rdev", "device type (if inode device)"}, + #endif ++#ifdef HAVE_STRUCT_STAT_ST_FLAGS ++ {"st_flags", "flags set onf ile"}, ++#endif + {0} + }; + +@@ -724,6 +727,12 @@ + #define ST_RDEV_IDX ST_BLOCKS_IDX + #endif + ++#ifdef HAVE_STRUCT_STAT_ST_FLAGS ++#define ST_FLAGS_IDX (ST_RDEV_IDX+1) ++#else ++#define ST_FLAGS_IDX ST_RDEV_IDX ++#endif ++ + static PyStructSequence_Desc stat_result_desc = { + "stat_result", /* name */ + stat_result__doc__, /* doc */ +@@ -887,6 +896,10 @@ + PyStructSequence_SET_ITEM(v, ST_RDEV_IDX, + PyInt_FromLong((long)st.st_rdev)); + #endif ++#ifdef HAVE_STRUCT_STAT_ST_FLAGS ++ PyStructSequence_SET_ITEM(v, ST_FLAGS_IDX, ++ PyInt_FromLong((long)st.st_flags)); ++#endif + + if (PyErr_Occurred()) { + Py_DECREF(v); +Only in Python-2.4.1-st_flags/Modules: posixmodule.c.orig +diff -ur Python-2.4.1/pyconfig.h.in Python-2.4.1-st_flags/pyconfig.h.in +--- Python-2.4.1/pyconfig.h.in 2004-10-13 17:30:55.000000000 +0200 ++++ Python-2.4.1-st_flags/pyconfig.h.in 2005-06-19 01:26:10.971387224 +0200 +@@ -480,6 +480,9 @@ + /* Define to 1 if `st_blocks' is member of `struct stat'. */ + #undef HAVE_STRUCT_STAT_ST_BLOCKS + ++/* Define to 1 if `st_flags' is member of `struct stat'. */ ++#undef HAVE_STRUCT_STAT_ST_FLAGS ++ + /* Define to 1 if `st_rdev' is member of `struct stat'. */ + #undef HAVE_STRUCT_STAT_ST_RDEV + +Only in Python-2.4.1-st_flags/: pyconfig.h.in~ diff --git a/dev-lang/python/files/patches/2.4.2-readline.patch b/dev-lang/python/files/patches/2.4.2-readline.patch new file mode 100644 index 0000000..7c5ab7d --- /dev/null +++ b/dev-lang/python/files/patches/2.4.2-readline.patch @@ -0,0 +1,287 @@ +diff -u configure configure +--- configure 2005-03-29 00:23:02.000000000 +0100 ++++ configure 2005-04-26 14:14:49.373258580 +0100 +@@ -19306,6 +19306,217 @@ + + fi + ++# what library does readline need to be linked with ++READLINE_SHARED_LIBADD="" ++echo "$as_me:$LINENO: checking for tgetent in -lncurses" >&5 ++echo $ECHO_N "checking for tgetent in -lncurses... $ECHO_C" >&6 ++if test "${ac_cv_lib_ncurses_tgetent+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++else ++ ac_check_lib_save_LIBS=$LIBS ++LIBS="-lncurses $LIBS" ++cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ ++ ++/* Override any gcc2 internal prototype to avoid an error. */ ++#ifdef __cplusplus ++extern "C" ++#endif ++/* We use char because int might match the return type of a gcc2 ++ builtin and then its argument prototype would still apply. */ ++char tgetent (); ++int ++main () ++{ ++tgetent (); ++ ; ++ return 0; ++} ++_ACEOF ++rm -f conftest.$ac_objext conftest$ac_exeext ++if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 ++ (eval $ac_link) 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); } && ++ { ac_try='test -z "$ac_c_werror_flag" ++ || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; } && ++ { ac_try='test -s conftest$ac_exeext' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; }; then ++ ac_cv_lib_ncurses_tgetent=yes ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ac_cv_lib_ncurses_tgetent=no ++fi ++rm -f conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext ++LIBS=$ac_check_lib_save_LIBS ++fi ++echo "$as_me:$LINENO: result: $ac_cv_lib_ncurses_tgetent" >&5 ++echo "${ECHO_T}$ac_cv_lib_ncurses_tgetent" >&6 ++if test $ac_cv_lib_ncurses_tgetent = yes; then ++ READLINE_SHARED_LIBADD="-lncurses" ++else ++ echo "$as_me:$LINENO: checking for tgetent in -lcurses" >&5 ++echo $ECHO_N "checking for tgetent in -lcurses... $ECHO_C" >&6 ++if test "${ac_cv_lib_curses_tgetent+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++else ++ ac_check_lib_save_LIBS=$LIBS ++LIBS="-lcurses $LIBS" ++cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ ++ ++/* Override any gcc2 internal prototype to avoid an error. */ ++#ifdef __cplusplus ++extern "C" ++#endif ++/* We use char because int might match the return type of a gcc2 ++ builtin and then its argument prototype would still apply. */ ++char tgetent (); ++int ++main () ++{ ++tgetent (); ++ ; ++ return 0; ++} ++_ACEOF ++rm -f conftest.$ac_objext conftest$ac_exeext ++if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 ++ (eval $ac_link) 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); } && ++ { ac_try='test -z "$ac_c_werror_flag" ++ || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; } && ++ { ac_try='test -s conftest$ac_exeext' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; }; then ++ ac_cv_lib_curses_tgetent=yes ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ac_cv_lib_curses_tgetent=no ++fi ++rm -f conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext ++LIBS=$ac_check_lib_save_LIBS ++fi ++echo "$as_me:$LINENO: result: $ac_cv_lib_curses_tgetent" >&5 ++echo "${ECHO_T}$ac_cv_lib_curses_tgetent" >&6 ++if test $ac_cv_lib_curses_tgetent = yes; then ++ READLINE_SHARED_LIBADD="-lcurses" ++else ++ echo "$as_me:$LINENO: checking for tgetent in -ltermcap" >&5 ++echo $ECHO_N "checking for tgetent in -ltermcap... $ECHO_C" >&6 ++if test "${ac_cv_lib_termcap_tgetent+set}" = set; then ++ echo $ECHO_N "(cached) $ECHO_C" >&6 ++else ++ ac_check_lib_save_LIBS=$LIBS ++LIBS="-ltermcap $LIBS" ++cat >conftest.$ac_ext <<_ACEOF ++/* confdefs.h. */ ++_ACEOF ++cat confdefs.h >>conftest.$ac_ext ++cat >>conftest.$ac_ext <<_ACEOF ++/* end confdefs.h. */ ++ ++/* Override any gcc2 internal prototype to avoid an error. */ ++#ifdef __cplusplus ++extern "C" ++#endif ++/* We use char because int might match the return type of a gcc2 ++ builtin and then its argument prototype would still apply. */ ++char tgetent (); ++int ++main () ++{ ++tgetent (); ++ ; ++ return 0; ++} ++_ACEOF ++rm -f conftest.$ac_objext conftest$ac_exeext ++if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 ++ (eval $ac_link) 2>conftest.er1 ++ ac_status=$? ++ grep -v '^ *+' conftest.er1 >conftest.err ++ rm -f conftest.er1 ++ cat conftest.err >&5 ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); } && ++ { ac_try='test -z "$ac_c_werror_flag" ++ || test ! -s conftest.err' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; } && ++ { ac_try='test -s conftest$ac_exeext' ++ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 ++ (eval $ac_try) 2>&5 ++ ac_status=$? ++ echo "$as_me:$LINENO: \$? = $ac_status" >&5 ++ (exit $ac_status); }; }; then ++ ac_cv_lib_termcap_tgetent=yes ++else ++ echo "$as_me: failed program was:" >&5 ++sed 's/^/| /' conftest.$ac_ext >&5 ++ ++ac_cv_lib_termcap_tgetent=no ++fi ++rm -f conftest.err conftest.$ac_objext \ ++ conftest$ac_exeext conftest.$ac_ext ++LIBS=$ac_check_lib_save_LIBS ++fi ++echo "$as_me:$LINENO: result: $ac_cv_lib_termcap_tgetent" >&5 ++echo "${ECHO_T}$ac_cv_lib_termcap_tgetent" >&6 ++if test $ac_cv_lib_termcap_tgetent = yes; then ++ READLINE_SHARED_LIBADD="-ltermcap" ++fi ++ ++ ++fi ++ ++ ++fi ++ ++ + # check for readline 2.1 + echo "$as_me:$LINENO: checking for rl_callback_handler_install in -lreadline" >&5 + echo $ECHO_N "checking for rl_callback_handler_install in -lreadline... $ECHO_C" >&6 +@@ -19313,7 +19524,7 @@ + echo $ECHO_N "(cached) $ECHO_C" >&6 + else + ac_check_lib_save_LIBS=$LIBS +-LIBS="-lreadline -ltermcap $LIBS" ++LIBS="-lreadline $READLINE_SHARED_LIBADD $LIBS" + cat >conftest.$ac_ext <<_ACEOF + /* confdefs.h. */ + _ACEOF +@@ -19445,7 +19656,7 @@ + echo $ECHO_N "(cached) $ECHO_C" >&6 + else + ac_check_lib_save_LIBS=$LIBS +-LIBS="-lreadline -ltermcap $LIBS" ++LIBS="-lreadline $READLINE_SHARED_LIBADD $LIBS" + cat >conftest.$ac_ext <<_ACEOF + /* confdefs.h. */ + _ACEOF +@@ -19519,7 +19730,7 @@ + echo $ECHO_N "(cached) $ECHO_C" >&6 + else + ac_check_lib_save_LIBS=$LIBS +-LIBS="-lreadline -ltermcap $LIBS" ++LIBS="-lreadline $READLINE_SHARED_LIBADD $LIBS" + cat >conftest.$ac_ext <<_ACEOF + /* confdefs.h. */ + _ACEOF +diff -u configure.in configure.in +--- configure.in 2005-03-29 00:23:34.000000000 +0100 ++++ configure.in 2005-04-26 14:01:03.721206572 +0100 +@@ -2846,10 +2846,18 @@ + [Define this if you have flockfile(), getc_unlocked(), and funlockfile()]) + fi + ++# what library does readline need to be linked with ++READLINE_SHARED_LIBADD="" ++AC_CHECK_LIB(ncurses, tgetent, [READLINE_SHARED_LIBADD="-lncurses"], ++ AC_CHECK_LIB(curses, tgetent, [READLINE_SHARED_LIBADD="-lcurses"], ++ AC_CHECK_LIB(termcap, tgetent, [READLINE_SHARED_LIBADD="-ltermcap"]) ++ ) ++ ) ++ + # check for readline 2.1 + AC_CHECK_LIB(readline, rl_callback_handler_install, + AC_DEFINE(HAVE_RL_CALLBACK, 1, +- [Define if you have readline 2.1]), , -ltermcap) ++ [Define if you have readline 2.1]), , $READLINE_SHARED_LIBADD) + + # check for readline 2.2 + AC_TRY_CPP([#include <readline/readline.h>], +@@ -2865,12 +2873,12 @@ + # check for readline 4.0 + AC_CHECK_LIB(readline, rl_pre_input_hook, + AC_DEFINE(HAVE_RL_PRE_INPUT_HOOK, 1, +- [Define if you have readline 4.0]), , -ltermcap) ++ [Define if you have readline 4.0]), , $READLINE_SHARED_LIBADD) + + # check for readline 4.2 + AC_CHECK_LIB(readline, rl_completion_matches, + AC_DEFINE(HAVE_RL_COMPLETION_MATCHES, 1, +- [Define if you have readline 4.2]), , -ltermcap) ++ [Define if you have readline 4.2]), , $READLINE_SHARED_LIBADD) + + # also in readline 4.2 + AC_TRY_CPP([#include <readline/readline.h>], + diff --git a/dev-lang/python/files/patches/2.4.3-libdir.patch b/dev-lang/python/files/patches/2.4.3-libdir.patch new file mode 100644 index 0000000..f75c756 --- /dev/null +++ b/dev-lang/python/files/patches/2.4.3-libdir.patch @@ -0,0 +1,156 @@ +diff -ur Python-2.4.3.orig/Lib/distutils/command/install.py Python-2.4.3/Lib/distutils/command/install.py +--- Python-2.4.3.orig/Lib/distutils/command/install.py 2005-01-20 19:15:39.000000000 +0000 ++++ Python-2.4.3/Lib/distutils/command/install.py 2006-08-16 15:15:27.000000000 +0100 +@@ -38,8 +38,8 @@ + + INSTALL_SCHEMES = { + 'unix_prefix': { +- 'purelib': '$base/lib/python$py_version_short/site-packages', +- 'platlib': '$platbase/lib/python$py_version_short/site-packages', ++ 'purelib': '$base/@@GENTOO_LIBDIR@@/python$py_version_short/site-packages', ++ 'platlib': '$platbase/@@GENTOO_LIBDIR@@/python$py_version_short/site-packages', + 'headers': '$base/include/python$py_version_short/$dist_name', + 'scripts': '$base/bin', + 'data' : '$base', +Only in Python-2.4.3/Lib/distutils/command: install.py~ +diff -ur Python-2.4.3.orig/Lib/distutils/sysconfig.py Python-2.4.3/Lib/distutils/sysconfig.py +--- Python-2.4.3.orig/Lib/distutils/sysconfig.py 2005-01-06 23:16:03.000000000 +0000 ++++ Python-2.4.3/Lib/distutils/sysconfig.py 2006-08-16 15:16:47.000000000 +0100 +@@ -100,7 +100,7 @@ + + if os.name == "posix": + libpython = os.path.join(prefix, +- "lib", "python" + get_python_version()) ++ "@@GENTOO_LIBDIR@@", "python" + get_python_version()) + if standard_lib: + return libpython + else: +Only in Python-2.4.3/Lib/distutils: sysconfig.py~ +diff -ur Python-2.4.3.orig/Lib/site.py Python-2.4.3/Lib/site.py +--- Python-2.4.3.orig/Lib/site.py 2006-08-16 15:06:40.000000000 +0100 ++++ Python-2.4.3/Lib/site.py 2006-08-16 15:19:21.000000000 +0100 +@@ -179,10 +179,10 @@ + sitedirs = [os.path.join(prefix, "Lib", "site-packages")] + elif os.sep == '/': + sitedirs = [os.path.join(prefix, +- "lib", ++ "@@GENTOO_LIBDIR@@", + "python" + sys.version[:3], + "site-packages"), +- os.path.join(prefix, "lib", "site-python")] ++ os.path.join(prefix, "@@GENTOO_LIBDIR@@", "site-python")] + sitedirs = [os.path.join(prefix,"lib","portage","pym")] + sitedirs + else: + sitedirs = [prefix, os.path.join(prefix, "lib", "site-packages")] +Only in Python-2.4.3/Lib: site.py~ +diff -ur Python-2.4.3.orig/Makefile.pre.in Python-2.4.3/Makefile.pre.in +--- Python-2.4.3.orig/Makefile.pre.in 2006-03-13 13:08:41.000000000 +0000 ++++ Python-2.4.3/Makefile.pre.in 2006-08-16 15:11:25.000000000 +0100 +@@ -79,11 +79,11 @@ + + # Expanded directories + BINDIR= $(exec_prefix)/bin +-LIBDIR= $(exec_prefix)/lib ++LIBDIR= $(exec_prefix)/@@GENTOO_LIBDIR@@ + MANDIR= @mandir@ + INCLUDEDIR= @includedir@ + CONFINCLUDEDIR= $(exec_prefix)/include +-SCRIPTDIR= $(prefix)/lib ++SCRIPTDIR= $(prefix)/@@GENTOO_LIBDIR@@ + + # Detailed destination directories + BINLIBDEST= $(LIBDIR)/python$(VERSION) +Only in Python-2.4.3: Makefile.pre.in~ +diff -ur Python-2.4.3.orig/Modules/Setup.dist Python-2.4.3/Modules/Setup.dist +--- Python-2.4.3.orig/Modules/Setup.dist 2005-12-27 17:37:16.000000000 +0000 ++++ Python-2.4.3/Modules/Setup.dist 2006-08-16 15:19:14.000000000 +0100 +@@ -401,7 +401,7 @@ + #DB=/usr/local/BerkeleyDB.4.0 + #DBLIBVER=4.0 + #DBINC=$(DB)/include +-#DBLIB=$(DB)/lib ++DBLIB=$(DB)/@@GENTOO_LIBDIR@@ + #_bsddb _bsddb.c -I$(DBINC) -L$(DBLIB) -ldb-$(DBLIBVER) + + # Historical Berkeley DB 1.85 +@@ -447,7 +447,7 @@ + # Andrew Kuchling's zlib module. + # This require zlib 1.1.3 (or later). + # See http://www.gzip.org/zlib/ +-#zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib -lz ++zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/@@GENTOO_LIBDIR@@ -lz + + # Interface to the Expat XML parser + # +Only in Python-2.4.3/Modules: Setup.dist~ +diff -ur Python-2.4.3.orig/Modules/getpath.c Python-2.4.3/Modules/getpath.c +--- Python-2.4.3.orig/Modules/getpath.c 2006-02-20 17:37:39.000000000 +0000 ++++ Python-2.4.3/Modules/getpath.c 2006-08-16 15:21:21.000000000 +0100 +@@ -112,8 +112,8 @@ + #endif + + #ifndef PYTHONPATH +-#define PYTHONPATH PREFIX "/lib/python" VERSION ":" \ +- EXEC_PREFIX "/lib/python" VERSION "/lib-dynload" ++#define PYTHONPATH PREFIX "/@@GENTOO_LIBDIR@@/python" VERSION ":" \ ++ EXEC_PREFIX "/@@GENTOO_LIBDIR@@/python" VERSION "/lib-dynload" + #endif + + #ifndef LANDMARK +@@ -124,7 +124,7 @@ + static char exec_prefix[MAXPATHLEN+1]; + static char progpath[MAXPATHLEN+1]; + static char *module_search_path = NULL; +-static char lib_python[] = "lib/python" VERSION; ++static char lib_python[] = "@@GENTOO_LIBDIR@@/python" VERSION; + + static void + reduce(char *dir) +@@ -529,7 +529,7 @@ + fprintf(stderr, + "Could not find platform dependent libraries <exec_prefix>\n"); + strncpy(exec_prefix, EXEC_PREFIX, MAXPATHLEN); +- joinpath(exec_prefix, "lib/lib-dynload"); ++ joinpath(exec_prefix, "@@GENTOO_LIBDIR@@/lib-dynload"); + } + /* If we found EXEC_PREFIX do *not* reduce it! (Yet.) */ + +Only in Python-2.4.3/Modules: getpath.c~ +diff -ur Python-2.4.3.orig/setup.py Python-2.4.3/setup.py +--- Python-2.4.3.orig/setup.py 2006-08-16 15:06:37.000000000 +0100 ++++ Python-2.4.3/setup.py 2006-08-16 15:13:53.000000000 +0100 +@@ -275,8 +275,7 @@ + # if a file is found in one of those directories, it can + # be assumed that no additional -I,-L directives are needed. + lib_dirs = self.compiler.library_dirs + [ +- '/lib64', '/usr/lib64', +- '/lib', '/usr/lib', ++ '@@GENTOO_LIBDIR@@', '/usr/@@GENTOO_LIBDIR@@', + ] + inc_dirs = self.compiler.include_dirs + ['/usr/include'] + exts = [] +@@ -441,11 +440,11 @@ + elif self.compiler.find_library_file(lib_dirs, 'curses'): + readline_libs.append('curses') + elif self.compiler.find_library_file(lib_dirs + +- ['/usr/lib/termcap'], ++ ['/usr/@@GENTOO_LIBDIR@@/termcap'], + 'termcap'): + readline_libs.append('termcap') + exts.append( Extension('readline', ['readline.c'], +- library_dirs=['/usr/lib/termcap'], ++ library_dirs=['/usr/@@GENTOO_LIBDIR@@/termcap'], + libraries=readline_libs) ) + if platform not in ['mac']: + # crypt module. +@@ -1023,8 +1022,7 @@ + added_lib_dirs.append('/usr/openwin/lib') + elif os.path.exists('/usr/X11R6/include'): + include_dirs.append('/usr/X11R6/include') +- added_lib_dirs.append('/usr/X11R6/lib64') +- added_lib_dirs.append('/usr/X11R6/lib') ++ added_lib_dirs.append('/usr/X11R6/@@GENTOO_LIBDIR@@') + elif os.path.exists('/usr/X11R5/include'): + include_dirs.append('/usr/X11R5/include') + added_lib_dirs.append('/usr/X11R5/lib') +Only in Python-2.4.3: setup.py~ diff --git a/dev-lang/python/python-2.4.3-r2.ebuild b/dev-lang/python/python-2.4.3-r2.ebuild new file mode 100644 index 0000000..5e20056 --- /dev/null +++ b/dev-lang/python/python-2.4.3-r2.ebuild @@ -0,0 +1,301 @@ +# Copyright 1999-2006 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-lang/python/python-2.4.3-r1.ebuild,v 1.12 2006/07/20 17:25:17 blubb 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. + +inherit eutils flag-o-matic python multilib versionator toolchain-funcs + +# we need this so that we don't depends on python.eclass +PYVER_MAJOR=$(get_major_version) +PYVER_MINOR=$(get_version_component_range 2) +PYVER="${PYVER_MAJOR}.${PYVER_MINOR}" + +PATCHTAR="${PN}-${PYVER}-patches-2" + +MY_P="Python-${PV}" +S="${WORKDIR}/${MY_P}" +DESCRIPTION="Python is an interpreted, interactive, object-oriented programming language." +HOMEPAGE="http://www.python.org/" +SRC_URI="http://www.python.org/ftp/python/${PV}/${MY_P}.tar.bz2 + mirror://gentoo/${PATCHTAR}.tar.bz2" + +LICENSE="PSF-2.2" +SLOT="2.4" +#KEYWORDS="alpha amd64 arm hppa ia64 m68k mips ppc ppc64 s390 sh sparc x86 ~x86-fbsd" +KEYWORDS="-x86 -amd64" +IUSE="ncurses gdbm ssl readline tk berkdb bootstrap ipv6 build ucs2 doc nocxx" + +DEPEND=">=sys-libs/zlib-1.1.3 + !dev-python/cjkcodecs + !build? ( + tk? ( >=dev-lang/tk-8.0 ) + ncurses? ( >=sys-libs/ncurses-5.2 readline? ( >=sys-libs/readline-4.1 ) ) + berkdb? ( >=sys-libs/db-3.1 ) + gdbm? ( sys-libs/gdbm ) + ssl? ( dev-libs/openssl ) + doc? ( =dev-python/python-docs-${PV}* ) + dev-libs/expat + )" + +# NOTE: The dev-python/python-fchksum RDEPEND is needed so that this python +# provides the functionality expected from previous pythons. + +# NOTE: python-fchksum is only a RDEPEND and not a DEPEND since we don't need +# it to compile python. We just need to ensure that when we install +# python, we definitely have fchksum support. - liquidx + +# NOTE: changed RDEPEND to PDEPEND to resolve bug 88777. - kloeri + +PDEPEND="${DEPEND} dev-python/python-fchksum" + +PROVIDE="virtual/python" + +# confcache breaks a dlopen check, causing python to not support +# loading .so files - marienz +RESTRICT="confcache" + +src_unpack() { + unpack ${A} + cd ${S} + + # unnecessary termcap dep in readline (#79013) + epatch ${FILESDIR}/patches/2.4.2-readline.patch + # db4.2 support + epatch ${FILESDIR}/patches/${P}-db4.patch + + # adds support for PYTHON_DONTCOMPILE shell environment to + # supress automatic generation of .pyc and .pyo files - liquidx (08 Oct 03) + epatch ${FILESDIR}/patches/python-2.4-gentoo_py_dontcompile.patch + epatch ${FILESDIR}/patches/python-2.4-disable_modules_and_ssl.patch + epatch ${FILESDIR}/patches/2.4-mimetypes_apache.patch + + # prepends /usr/lib/portage/pym to sys.path + epatch ${FILESDIR}/patches/python-2.4-add_portage_search_path.patch + + epatch ${FILESDIR}/patches/2.4.3-libdir.patch + sed -i -e "s:@@GENTOO_LIBDIR@@:$(get_libdir):g" \ + Lib/distutils/command/install.py \ + Lib/distutils/sysconfig.py \ + Lib/site.py \ + Makefile.pre.in \ + Modules/Setup.dist \ + Modules/getpath.c \ + setup.py || die + + # add support for struct stat st_flags attribute (bug 94637) + epatch ${FILESDIR}/patches/2.4.1-st_flags.patch + + # 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 !!! + [ "${ARCH}" = "hppa" ] && sed -e 's/utimes //' -i ${S}/configure + + if tc-is-cross-compiler ; then + epatch ${FILESDIR}/patches/python-2.4.1-crosscompile.patch + fi + + # fix gentoo/obsd problems (bug 117261) + epatch ${FILESDIR}/patches/python-2.4.3-gentoo_obsd-r1.patch +} + +src_configure() { + # disable extraneous modules with extra dependencies + if use build; then + export PYTHON_DISABLE_MODULES="readline pyexpat dbm gdbm bsddb _curses _curses_panel _tkinter" + export PYTHON_DISABLE_SSL=1 + else + use gdbm \ + || PYTHON_DISABLE_MODULES="${PYTHON_DISABLE_MODULES} gdbm" + use berkdb \ + || PYTHON_DISABLE_MODULES="${PYTHON_DISABLE_MODULES} dbm bsddb" + use readline \ + || PYTHON_DISABLE_MODULES="${PYTHON_DISABLE_MODULES} readline" + use tk \ + || PYTHON_DISABLE_MODULES="${PYTHON_DISABLE_MODULES} _tkinter" + use ncurses \ + || PYTHON_DISABLE_MODULES="${PYTHON_DISABLE_MODULES} _curses _curses_panel" + use ssl \ + || export PYTHON_DISABLE_SSL=1 + export PYTHON_DISABLE_MODULES + echo $PYTHON_DISABLE_MODULES + fi +} + +src_compile() { + 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 + + export OPT="${CFLAGS}" + + local myconf + #if we are creating a new build image, we remove the dependency on g++ + if use build && ! use bootstrap || use nocxx ; then + myconf="--with-cxx=no" + fi + + # super-secret switch. don't use this unless you know what you're + # doing. enabling UCS2 support will break your existing python + # modules + use ucs2 \ + && myconf="${myconf} --enable-unicode=ucs2" \ + || myconf="${myconf} --enable-unicode=ucs4" + + src_configure + + if tc-is-cross-compiler ; then + OPT="-O1" CFLAGS="" LDFLAGS="" CC="" \ + ./configure --with-cxx=no || die "cross-configure failed" + emake python Parser/pgen || die "cross-make failed" + mv python hostpython + mv Parser/pgen Parser/hostpgen + make distclean + sed -i \ + -e '/^HOSTPYTHON/s:=.*:=./hostpython:' \ + -e '/^HOSTPGEN/s:=.*:=./Parser/hostpgen:' \ + Makefile.pre.in || die + fi + + # export CXX so it ends up in /usr/lib/python2.x/config/Makefile + tc-export CXX + # set LINKCC to prevent python from being linked to libstdc++.so + export LINKCC="\$(PURIFY) \$(CC)" + econf \ + --with-fpectl \ + --enable-shared \ + `use_enable ipv6` \ + --infodir='${prefix}'/share/info \ + --mandir='${prefix}'/share/man \ + --with-threads \ + --with-libc='' \ + ${myconf} || die + emake || die "Parallel make failed" +} + +src_install() { + dodir /usr + src_configure + make DESTDIR="${D}" altinstall maninstall || die + + # install our own custom python-config + exeinto /usr/bin + newexe ${FILESDIR}/python-config-${PYVER} python-config + + # Use correct libdir in python-config + dosed "s:/usr/lib/:/usr/$(get_libdir)/:" /usr/bin/python-config + + # The stuff below this line 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/$(get_libdir)/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/$(get_libdir)/python${PYVER}/config/Makefile + + # install python-updater in /usr/sbin + #dosbin ${FILESDIR}/python-updater + newsbin ${FILESDIR}/python-updater-r1 python-updater + + if use build ; then + rm -rf ${D}/usr/$(get_libdir)/python${PYVER}/{test,encodings,email,lib-tk,bsddb/test} + else + use elibc_uclibc && rm -rf ${D}/usr/$(get_libdir)/python${PYVER}/{test,bsddb/test} + use berkdb || rm -rf ${D}/usr/$(get_libdir)/python${PYVER}/bsddb + use tk || rm -rf ${D}/usr/$(get_libdir)/python${PYVER}/lib-tk + fi + + prep_ml_includes usr/include/python${PYVER} +} + +pkg_postrm() { + python_makesym + python_mod_cleanup /usr/lib/python${PYVER} + [[ "$(get_libdir)" == "lib" ]] || python_mod_cleanup /usr/$(get_libdir)/python${PYVER} +} + +pkg_postinst() { + local myroot + myroot=$(echo $ROOT | sed 's:/$::') + + python_makesym + python_mod_optimize + python_mod_optimize -x site-packages -x test ${myroot}/usr/lib/python${PYVER} + [[ "$(get_libdir)" == "lib" ]] || python_mod_optimize -x site-packages -x test ${myroot}/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 ${myroot}/usr/lib/portage/pym + fi + fi + + # try to upgrade to new python automatically - something to think about + #if [ "${ROOT}" = "/" ]; then + # /usr/sbin/python-updater + #fi + + echo + ewarn + ewarn "If you have just upgraded from an older version of python you will 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 +} + +src_test() { + # PYTHON_DONTCOMPILE=1 breaks test_import + unset PYTHON_DONTCOMPILE + + #skip all tests that fail during emerge but pass without emerge: + #(See bug# 67970) + local skip_tests="distutils global mimetools minidom mmap strptime subprocess syntax tcl time urllib urllib2" + + for test in ${skip_tests} ; do + mv ${S}/Lib/test/test_${test}.py ${T} + done + + # rerun failed tests in verbose mode (regrtest -w) + EXTRATESTOPTS="-w" make test || die "make test failed" + + for test in ${skip_tests} ; do + mv ${T}/test_${test}.py ${S}/Lib/test/test_${test}.py + done + + einfo "Portage skipped the following tests which aren't able to run from emerge:" + for test in ${skip_tests} ; do + einfo "test_${test}.py" + done + + einfo "If you'd like to run them, you may:" + einfo "cd /usr/lib/python${PYVER}/test" + einfo "and run the tests separately." +} |