Difference between revisions of "Python"
(Multilib updates) |
|||
Line 3: | Line 3: | ||
!Download Source: | !Download Source: | ||
| http://www.python.org/ftp/python/{{Python-Version}}/Python-{{Python-Version}}.tar.xz | | http://www.python.org/ftp/python/{{Python-Version}}/Python-{{Python-Version}}.tar.xz | ||
− | |||
− | |||
|-valign="top" | |-valign="top" | ||
!Required Patch (For Multilib): | !Required Patch (For Multilib): | ||
Line 66: | Line 64: | ||
patch -Np1 -i ../Python-{{Python-Version}}-multilib-1.patch && | patch -Np1 -i ../Python-{{Python-Version}}-multilib-1.patch && | ||
− | sed -i -e "s | + | |
− | + | export LIBDIRSUFFIX=32 | |
− | + | sed -i -e "s|@@MULTILIB_DIR@@|/lib${LIBDIRSUFFIX}|g" Lib/distutils/command/install.py \ | |
− | + | Lib/distutils/sysconfig.py \ | |
− | + | Lib/pydoc.py \ | |
− | + | Lib/site.py \ | |
− | + | Lib/sysconfig.py \ | |
− | + | Lib/test/test_dl.py \ | |
+ | Lib/test/test_site.py \ | ||
+ | Lib/trace.py \ | ||
+ | Makefile.pre.in \ | ||
+ | Modules/getpath.c \ | ||
+ | setup.py | ||
Compile the package: | Compile the package: | ||
Line 79: | Line 82: | ||
sed -i "s@/usr/X11R6@${XORG_PREFIX}@g" setup.py && | sed -i "s@/usr/X11R6@${XORG_PREFIX}@g" setup.py && | ||
CC="gcc ${BUILDN32}" CXX="g++ ${BUILDN32}" ./configure --prefix=/usr \ | CC="gcc ${BUILDN32}" CXX="g++ ${BUILDN32}" ./configure --prefix=/usr \ | ||
− | --libdir=/usr/ | + | --libdir=/usr/lib${LIBDIRSUFFIX} --enable-shared && |
make | make | ||
Line 88: | Line 91: | ||
mv -v /usr/bin/python{{Python-Version2}}{,-n32} && | mv -v /usr/bin/python{{Python-Version2}}{,-n32} && | ||
mv -v /usr/include/python{{Python-Version2}}/pyconfig{,-n32}.h | mv -v /usr/include/python{{Python-Version2}}/pyconfig{,-n32}.h | ||
+ | |||
+ | unset ${LIBDIRSUFFIX} | ||
=== 64Bit === | === 64Bit === | ||
Line 94: | Line 99: | ||
patch -Np1 -i ../Python-{{Python-Version}}-multilib-1.patch && | patch -Np1 -i ../Python-{{Python-Version}}-multilib-1.patch && | ||
− | sed -i -e "s | + | |
− | + | export LIBDIRSUFFIX=64 | |
− | + | sed -i -e "s|@@MULTILIB_DIR@@|/lib${LIBDIRSUFFIX}|g" Lib/distutils/command/install.py \ | |
− | + | Lib/distutils/sysconfig.py \ | |
− | + | Lib/pydoc.py \ | |
− | + | Lib/site.py \ | |
− | + | Lib/sysconfig.py \ | |
− | + | Lib/test/test_dl.py \ | |
+ | Lib/test/test_site.py \ | ||
+ | Lib/trace.py \ | ||
+ | Makefile.pre.in \ | ||
+ | Modules/getpath.c \ | ||
+ | setup.py | ||
Compile the package: | Compile the package: | ||
Line 107: | Line 117: | ||
sed -i "s@/usr/X11R6@${XORG_PREFIX}@g" setup.py && | sed -i "s@/usr/X11R6@${XORG_PREFIX}@g" setup.py && | ||
CC="gcc ${BUILD64}" CXX="g++ ${BUILD64}" ./configure --prefix=/usr \ | CC="gcc ${BUILD64}" CXX="g++ ${BUILD64}" ./configure --prefix=/usr \ | ||
− | --libdir=/usr/ | + | --libdir=/usr/lib${LIBDIRSUFFIX} --enable-shared && |
make | make | ||
Line 118: | Line 128: | ||
ln -sfv multiarch_wrapper /usr/bin/python{{Python-Version2}} && | ln -sfv multiarch_wrapper /usr/bin/python{{Python-Version2}} && | ||
mv -v /usr/include/python{{Python-Version2}}/pyconfig{,-64}.h | mv -v /usr/include/python{{Python-Version2}}/pyconfig{,-64}.h | ||
+ | |||
+ | unset ${LIBDIRSUFFIX} | ||
{{Stub-Header|pyconfig|/usr/include/python{{Python-Version2}}}} | {{Stub-Header|pyconfig|/usr/include/python{{Python-Version2}}}} |
Revision as of 14:58, 19 September 2012
Download Source: | http://www.python.org/ftp/python/2.7.8/Python-2.7.8.tar.xz |
---|---|
Required Patch (For Multilib): | http://svn.cross-lfs.org/svn/repos/patches/Python/Python-2.7.8-multilib-1.patch |
Contents
Introduction to Python
Python is a dynamic object-oriented programming language that can be used for many kinds of software development. It offers strong support for integration with other languages and tools, comes with extensive standard libraries, and can be learned in a few days. Many Python programmers report substantial productivity gains and feel the language encourages the development of higher quality, more maintainable code.
Project Homepage: http://www.python.org/
Dependencies
Optional
Non-Multilib
Compile the package:
sed -i "s@/usr/X11R6@${XORG_PREFIX}@g" setup.py && ./configure --prefix=/usr --enable-shared && make
Install the package
make install
Command Explanations
--enable-shared: Enables the building of shared libraries.
Multilib
32Bit
Compile the package:
sed -i "s@/usr/X11R6@${XORG_PREFIX}@g" setup.py && 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{,-32} && mv -v /usr/include/python2.7/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 && export LIBDIRSUFFIX=32 sed -i -e "s|@@MULTILIB_DIR@@|/lib${LIBDIRSUFFIX}|g" Lib/distutils/command/install.py \ Lib/distutils/sysconfig.py \ Lib/pydoc.py \ Lib/site.py \ Lib/sysconfig.py \ Lib/test/test_dl.py \ Lib/test/test_site.py \ Lib/trace.py \ Makefile.pre.in \ Modules/getpath.c \ setup.py
Compile the package:
sed -i "s@/usr/X11R6@${XORG_PREFIX}@g" setup.py && CC="gcc ${BUILDN32}" CXX="g++ ${BUILDN32}" ./configure --prefix=/usr \ --libdir=/usr/lib${LIBDIRSUFFIX} --enable-shared && make
Install the package
make install && mv -v /usr/bin/python{,-n32} && mv -v /usr/bin/python2.7{,-n32} && mv -v /usr/include/python2.7/pyconfig{,-n32}.h
unset ${LIBDIRSUFFIX}
64Bit
Change the libdir that Python is going to use to lib64:
patch -Np1 -i ../Python-2.7.8-multilib-1.patch && export LIBDIRSUFFIX=64 sed -i -e "s|@@MULTILIB_DIR@@|/lib${LIBDIRSUFFIX}|g" Lib/distutils/command/install.py \ Lib/distutils/sysconfig.py \ Lib/pydoc.py \ Lib/site.py \ Lib/sysconfig.py \ Lib/test/test_dl.py \ Lib/test/test_site.py \ Lib/trace.py \ Makefile.pre.in \ Modules/getpath.c \ setup.py
Compile the package:
sed -i "s@/usr/X11R6@${XORG_PREFIX}@g" setup.py && CC="gcc ${BUILD64}" CXX="g++ ${BUILD64}" ./configure --prefix=/usr \ --libdir=/usr/lib${LIBDIRSUFFIX} --enable-shared && make
Install the package
make install && mv -v /usr/bin/python{,-64} && mv -v /usr/bin/python2.7{,-64} && ln -sfv multiarch_wrapper /usr/bin/python && ln -sfv multiarch_wrapper /usr/bin/python2.7 && mv -v /usr/include/python2.7/pyconfig{,-64}.h
unset ${LIBDIRSUFFIX}
Creating a Stub Header (Multilib Only)
Creating a Generic Stub Header
cat > /usr/include/python2.7/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/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
Contents
Installed Programs: | pydoc, python, python2.7, python-config, python2.7-config, smtpd.py, and (if Tk is installed) idle |
---|---|
Installed Libraries: | libpython2.7.so and various modules in /usr/lib/lib-dynload |
Installed Directories: | /usr/include/python2.7, /usr/lib/python2.7 |
Short Descriptions
pydoc | is a tool for reading python documentation. |
---|---|
python | is an interpreted, interactive, object-oriented programming language. |
python2.7 | is a version-specific version of python. |
python-config | is a symlink to python2.7-config. |
python2.7.8-config | ??? |
smtpd.py | is a Python implemention of the minimal SMTP protocol as defined in RFC 821. |
idle | is an Integrated DeveLopment Environment (IDLE) for Python. It's based on Tkinter, Python's bindings to the Tk widget set. |
libpython2.7.so | ??? |