wiki:pkg-python/Python27

Version 11 (modified by maphew, 12 years ago) ( diff )

note re: default location of pythonxx.dll

Making a Python 2.7 package for OSGeo4W

Recipe for building a python package.

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-%ver%
cd python-%ver%
mkdir apps bin etc

:: Add batch files for `etc\ini`, `etc\postinstall`, & `bin` from skeleton
xcopy /s ..\python-skeleton\* .\

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

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

Now create the package archive

rem 7z a -ttar ..\python-%ver-pkg%.tar apps bin etc
rem 7z a -tbzip2 -mx9 -mmt=on ..\python-%ver-pkg%.tar.bz2 ..\python-%ver-pkg%.tar
%osgeo4w_root%\apps\msys\bin\tar.exe cvjf ../python-%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.

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

Attachments (1)

Download all attachments as: .zip

Note: See TracWiki for help on using the wiki.