Python: Difference between revisions

From CBLFS
Jump to navigationJump to search
Kalessin (talk | contribs)
I added the package description from BLFS.
No edit summary
Line 2: Line 2:
|-
|-
!Download Source:
!Download Source:
| http://www.python.org/ftp/python/2.5/Python-2.5.tar.bz2
| http://www.python.org/ftp/python/{{Python-Version}}/Python-{{Python-Version}}.tar.bz2
|-
|-
!Required Patch:
!Required Patch:
| http://svn.cross-lfs.org/svn/repos/patches/Python/Python-2.5-gdbm-1.patch
| http://svn.cross-lfs.org/svn/repos/patches/Python/Python-{{Python-Version}}-gdbm-1.patch
|-
|-
!Required Patch (For Multilib):
!Required Patch (For Multilib):
| http://svn.cross-lfs.org/svn/repos/patches/Python/Python-2.5-multilib-1.patch
| http://svn.cross-lfs.org/svn/repos/patches/Python/Python-{{Python-Version}}-multilib-1.patch
|}
|}


Line 29: Line 29:
Compile the package:
Compile the package:


  patch -Np1 -i ../Python-2.5-gdbm-1.patch &&
  patch -Np1 -i ../Python-{{Python-Version}}-gdbm-1.patch &&
  ./configure --prefix=/usr --enable-shared &&
  ./configure --prefix=/usr --enable-shared &&
  make
  make
Line 43: Line 43:
Compile the package:
Compile the package:


  patch -Np1 -i ../Python-2.5-gdbm-1.patch &&
  patch -Np1 -i ../Python-{{Python-Version}}-gdbm-1.patch &&
  CC="gcc ${BUILD32}" CXX="g++ ${BUILD32}" ./configure --prefix=/usr \
  CC="gcc ${BUILD32}" CXX="g++ ${BUILD32}" ./configure --prefix=/usr \
     --enable-shared &&
     --enable-shared &&
Line 52: Line 52:
  make install &&
  make install &&
  mv -v /usr/bin/python{,-32} &&
  mv -v /usr/bin/python{,-32} &&
  mv -v /usr/bin/python2.5{,-32} &&
  mv -v /usr/bin/python{{Python-Version}}{,-32} &&
  mv -v /usr/include/python2.5/pyconfig{,-32}.h
  mv -v /usr/include/python{{Python-Version}}/pyconfig{,-32}.h


=== N32 ===
=== N32 ===
Line 59: Line 59:
Change the libdir that Python is going to use to lib32:
Change the libdir that Python is going to use to lib32:


  patch -Np1 -i ../Python-2.5-multilib-1.patch
  patch -Np1 -i ../Python-{{Python-Version}}-multilib-1.patch
  sed -i -e "s:@@MULTILIB_DIR@@:lib32:g" \
  sed -i -e "s:@@MULTILIB_DIR@@:lib32:g" \
         Lib/distutils/command/install.py \
         Lib/distutils/command/install.py \
Line 71: Line 71:
Compile the package:
Compile the package:


  patch -Np1 -i ../Python-2.5-gdbm-1.patch &&
  patch -Np1 -i ../Python-{{Python-Version}}-gdbm-1.patch &&
  CC="gcc ${BUILDN32}" CXX="g++ ${BUILDN32}" ./configure --prefix=/usr \
  CC="gcc ${BUILDN32}" CXX="g++ ${BUILDN32}" ./configure --prefix=/usr \
     --libdir=/usr/lib32 --enable-shared &&
     --libdir=/usr/lib32 --enable-shared &&
Line 80: Line 80:
  make install &&
  make install &&
  mv -v /usr/bin/python{,-n32} &&
  mv -v /usr/bin/python{,-n32} &&
  mv -v /usr/bin/python2.5{,-n32} &&
  mv -v /usr/bin/python{{Python-Version}}{,-n32} &&
  mv -v /usr/include/python2.5/pyconfig{,-n32}.h
  mv -v /usr/include/python{{Python-Version}}/pyconfig{,-n32}.h


=== 64Bit ===
=== 64Bit ===
Line 87: Line 87:
Change the libdir that Python is going to use to lib64:
Change the libdir that Python is going to use to lib64:


  patch -Np1 -i ../Python-2.5-multilib-1.patch
  patch -Np1 -i ../Python-{{Python-Version}}multilib-1.patch
  sed -i -e "s:@@MULTILIB_DIR@@:lib64:g" \
  sed -i -e "s:@@MULTILIB_DIR@@:lib64:g" \
         Lib/distutils/command/install.py \
         Lib/distutils/command/install.py \
Line 99: Line 99:
Compile the package:
Compile the package:


  patch -Np1 -i ../Python-2.5-gdbm-1.patch &&
  patch -Np1 -i ../Python-{{Python-Version}}-gdbm-1.patch &&
  CC="gcc ${BUILD64}" CXX="g++ ${BUILD64}" ./configure --prefix=/usr \
  CC="gcc ${BUILD64}" CXX="g++ ${BUILD64}" ./configure --prefix=/usr \
     --libdir=/usr/lib64 --enable-shared &&
     --libdir=/usr/lib64 --enable-shared &&
Line 108: Line 108:
  make install &&
  make install &&
  mv -v /usr/bin/python{,-64} &&
  mv -v /usr/bin/python{,-64} &&
  mv -v /usr/bin/python2.5{,-64} &&
  mv -v /usr/bin/python{{Python-Version}}{,-64} &&
  ln -sfv multiarch_wrapper /usr/bin/python &&
  ln -sfv multiarch_wrapper /usr/bin/python &&
  ln -sfv multiarch_wrapper /usr/bin/python2.4 &&
  ln -sfv multiarch_wrapper /usr/bin/python2.4 &&
  mv -v /usr/include/python2.5/pyconfig{,-64}.h
  mv -v /usr/include/python{{Python-Version}}/pyconfig{,-64}.h


==== Creating a Stub Header ====
==== Creating a Stub Header ====


  cat > /usr/include/python2.5/pyconfig.h << "EOF"
  cat > /usr/include/python{{Python-Version}}/pyconfig.h << "EOF"
  /* pyconfig.h.  Stub Header  */
  /* pyconfig.h.  Stub Header  */
  #ifndef __STUB__PYCONFIG_H__
  #ifndef __STUB__PYCONFIG_H__
Line 135: Line 135:
==== Creating a Stub Header For Mips ====
==== Creating a Stub Header For Mips ====


  cat > /usr/include/python2.5/pyconfig.h << "EOF"
  cat > /usr/include/python{{Python-Version}}/pyconfig.h << "EOF"
  /* pyconfig.h.  Stub Header  */
  /* pyconfig.h.  Stub Header  */
  #ifndef __STUB__PYCONFIG_H__
  #ifndef __STUB__PYCONFIG_H__

Revision as of 14:40, 17 December 2006

Download Source: http://www.python.org/ftp/python/2.7.8/Python-2.7.8.tar.bz2
Required Patch: http://svn.cross-lfs.org/svn/repos/patches/Python/Python-2.7.8-gdbm-1.patch
Required Patch (For Multilib): http://svn.cross-lfs.org/svn/repos/patches/Python/Python-2.7.8-multilib-1.patch

Introduction to Python

The Python package contains the Python development environment. This is useful for object-oriented programming, writing scripts, prototyping large programs or developing entire applications.

Dependencies

Optional

Non-Multilib

Compile the package:

patch -Np1 -i ../Python-2.7.8-gdbm-1.patch &&
./configure --prefix=/usr --enable-shared &&
make

Install the package

make install

Multilib

32Bit

Compile the package:

patch -Np1 -i ../Python-2.7.8-gdbm-1.patch &&
CC="gcc ${BUILD32}" CXX="g++ ${BUILD32}" ./configure --prefix=/usr \
    --enable-shared &&
make

Install the package

make install &&
mv -v /usr/bin/python{,-32} &&
mv -v /usr/bin/python2.7.8{,-32} &&
mv -v /usr/include/python2.7.8/pyconfig{,-32}.h

N32

Change the libdir that Python is going to use to lib32:

patch -Np1 -i ../Python-2.7.8-multilib-1.patch
sed -i -e "s:@@MULTILIB_DIR@@:lib32:g" \
        Lib/distutils/command/install.py \
        Lib/distutils/sysconfig.py \
        Lib/site.py \
        Makefile.pre.in \
        Modules/Setup.dist \
        Modules/getpath.c \
        setup.py

Compile the package:

patch -Np1 -i ../Python-2.7.8-gdbm-1.patch &&
CC="gcc ${BUILDN32}" CXX="g++ ${BUILDN32}" ./configure --prefix=/usr \
    --libdir=/usr/lib32 --enable-shared &&
make

Install the package

make install &&
mv -v /usr/bin/python{,-n32} &&
mv -v /usr/bin/python2.7.8{,-n32} &&
mv -v /usr/include/python2.7.8/pyconfig{,-n32}.h

64Bit

Change the libdir that Python is going to use to lib64:

patch -Np1 -i ../Python-2.7.8multilib-1.patch
sed -i -e "s:@@MULTILIB_DIR@@:lib64:g" \
        Lib/distutils/command/install.py \
        Lib/distutils/sysconfig.py \
        Lib/site.py \
        Makefile.pre.in \
        Modules/Setup.dist \
        Modules/getpath.c \
        setup.py

Compile the package:

patch -Np1 -i ../Python-2.7.8-gdbm-1.patch &&
CC="gcc ${BUILD64}" CXX="g++ ${BUILD64}" ./configure --prefix=/usr \
    --libdir=/usr/lib64 --enable-shared &&
make

Install the package

make install &&
mv -v /usr/bin/python{,-64} &&
mv -v /usr/bin/python2.7.8{,-64} &&
ln -sfv multiarch_wrapper /usr/bin/python &&
ln -sfv multiarch_wrapper /usr/bin/python2.4 &&
mv -v /usr/include/python2.7.8/pyconfig{,-64}.h

Creating a Stub Header

cat > /usr/include/python2.7.8/pyconfig.h << "EOF"
/* pyconfig.h.  Stub Header  */
#ifndef __STUB__PYCONFIG_H__
#define __STUB__PYCONFIG_H__

#if defined(__x86_64) || \
    defined(__sparc64__) || \
    defined(__arch64__) || \
    defined(__powerpc64__) || \
    defined (__s390x__)
# include "pyconfig-64.h"
#else
# include "pyconfig-32.h"
#endif

#endif /* __STUB__PYCONFIG_H__ */
EOF

Creating a Stub Header For Mips

cat > /usr/include/python2.7.8/pyconfig.h << "EOF"
/* pyconfig.h.  Stub Header  */
#ifndef __STUB__PYCONFIG_H__
#define __STUB__PYCONFIG_H__

#include <sgidefs.h>

#if (_MIPS_SIM == _ABIO32)
# include "pyconfig-32.h"
#elif (_MIPS_SIM == _ABIN32)
# include "pyconfig-n32.h"
#elif (_MIPS_SIM == _ABI64)
# include "pyconfig-64.h"
#endif

#endif /* __STUB__PYCONFIG_H__ */
EOF
Retrieved from "?title=Python&oldid=5446"