| 1 | = Making a Python 2.7 package for OSGeo4W = |
| 2 | |
| 3 | Some rough notes for how [wiki:MAttWilkie ]I built a python 2.7 package. |
| 4 | |
| 5 | Open a command shell and |
| 6 | {{{ |
| 7 | set osgeo4w_root=c:\o4w_py27 |
| 8 | apt.exe setup |
| 9 | |
| 10 | :: to share cache with existing install |
| 11 | :: and avoid needless downloads |
| 12 | copy c:\osgeo4w\etc\setup\last-cache %osgeo4w_root%\etc\setup\ |
| 13 | |
| 14 | :: install py25, then examine folder structure |
| 15 | apt install python |
| 16 | |
| 17 | :: install py27 from standard msi installer (outside o4w) |
| 18 | start d:\dee\Downloads\Programming\python-2.7.1.msi |
| 19 | |
| 20 | :: Manually compare c:\python27 to c:\o4w_py27\ |
| 21 | :: then reflect the structure |
| 22 | |
| 23 | xcopy /s c:\python27 C:\o4w_py27\apps\Python27 |
| 24 | pushd %osgeo4w_root% |
| 25 | move apps\Python27\*.exe bin\ |
| 26 | |
| 27 | if exist %windir%\SysWOW64\python27.dll copy %windir%\SysWOW64\python27.dll bin\ |
| 28 | if exist %windir%\System32\python27.dll copy %windir%\System32\python27.dll bin\ |
| 29 | |
| 30 | :: overwrite python shell batch file |
| 31 | :: (must be run from within bat file or the %% don't collapse properly to single %) |
| 32 | SET PYTHONHOME=%%OSGEO4W_ROOT%%\apps\Python27> etc\ini\python.bat |
| 33 | |
| 34 | :: now create the package archive |
| 35 | 7z a -ttar python-2.7.1-1.tar apps\Python27 bin\python*.exe bin\w9xpopen.exe bin\python27.dll etc\ini\python.bat |
| 36 | 7z a -tbzip2 -mx9 -mmt=on python-2.7.1-1.tar.bz2 python-2.7.1-1.tar |
| 37 | }}} |
| 38 | |
| 39 | Then |