wiki:pkg-python/Python27

Making a Python 2.7 package for OSGeo4W

Recipe for building the python packages (-core, -help, -wrapper).

Open a command shell and

set vv=27
set ver=2.7.2
set ver-pkg=%ver%-1

:: install py27 from standard 32bit msi installer to Current User[*]
wget http://www.python.org/ftp/python/%ver%/python-%ver%.msi
start python-%ver%.msi

pushd d:\o4w-packages\python
mkdir python-core python-wrapper python-help

Manually compare c:\python27 to previous o4w python installs, then reflect the structure

cd python-core
xcopy /s/d c:\python%vv% apps\Python%vv%
move apps\Python%vv%\*.exe bin\
move apps\Python%vv%\*.dll bin\

mkdir ..\python-help\apps\Python%vv%\Doc
move apps\Python%vv%\Doc ..\python-help\apps\Python%vv%\Doc

Now create the package archives

%osgeo4w_root%\apps\msys\bin\tar.exe cvjf ../python-%ver-pkg%.tar.bz2 apps bin

pushd ..\python-help
%osgeo4w_root%\apps\msys\bin\tar.exe cvjf ../python-help-%ver-pkg%.tar.bz2 apps

pushd ..\python-wrapper
%osgeo4w_root%\apps\msys\bin\tar.exe cvjf ../python-wrapper-%ver-pkg%.tar.bz2 apps bin etc

Notes

When python is installed for All Users the pythonxx.dll will go to %windir%\System32, while with Current User it will be in the same dir as python.exe. (see http://pyscripter.blogspot.ca/2010/10/where-on-earth-is-pythonxxdll.html)

Until #101 is fixed again, use tar from msys package instead of 7zip (with msys fore instead of backslash is important).

Last modified 13 years ago Last modified on 03/30/12 13:59:07

Attachments (1)

Download all attachments as: .zip

Note: See TracWiki for help on using the wiki.