|
| 1 | +REM *************************************************************************** |
| 2 | +REM package64.cmd |
| 3 | +REM --------------------- |
| 4 | +REM begin : August 2013 |
| 5 | +REM copyright : (C) 2013 by Juergen E. Fischer |
| 6 | +REM email : jef at norbit dot de |
| 7 | +REM *************************************************************************** |
| 8 | +REM * * |
| 9 | +REM * This program is free software; you can redistribute it and/or modify * |
| 10 | +REM * it under the terms of the GNU General Public License as published by * |
| 11 | +REM * the Free Software Foundation; either version 2 of the License, or * |
| 12 | +REM * (at your option) any later version. * |
| 13 | +REM * * |
| 14 | +REM *************************************************************************** |
| 15 | +@echo off |
| 16 | +set GRASS_VERSION=6.4.3 |
| 17 | + |
| 18 | +set BUILDDIR=%CD%\build64 |
| 19 | +REM set BUILDDIR=%TEMP%\qgis_unstable |
| 20 | +set LOG=%BUILDDIR%\build.log |
| 21 | + |
| 22 | +if not exist "%BUILDDIR%" mkdir %BUILDDIR% |
| 23 | +if not exist "%BUILDDIR%" goto error |
| 24 | + |
| 25 | +set VERSION=%1 |
| 26 | +set PACKAGE=%2 |
| 27 | +set PACKAGENAME=%3 |
| 28 | +if "%VERSION%"=="" goto error |
| 29 | +if "%PACKAGE%"=="" goto error |
| 30 | +if "%PACKAGENAME%"=="" set PACKAGENAME=qgis |
| 31 | + |
| 32 | +path %SYSTEMROOT%\system32;%SYSTEMROOT%;%SYSTEMROOT%\System32\Wbem;%PROGRAMFILES(X86)%\CMake 2.8\bin |
| 33 | +set PYTHONPATH= |
| 34 | + |
| 35 | +call "%PROGRAMFILES%\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" amd64 |
| 36 | +path %PATH%;%PROGRAMFILES(X86)%\Microsoft Visual Studio 10.0\Common7\IDE |
| 37 | + |
| 38 | +if "%OSGEO4W_ROOT%"=="" set OSGEO4W_ROOT=C:\OSGeo4W64 |
| 39 | +if not exist "%OSGEO4W_ROOT%\bin\o4w_env.bat" goto error |
| 40 | +call "%OSGEO4W_ROOT%\bin\o4w_env.bat" |
| 41 | +path %PATH%;c:\cygwin\bin |
| 42 | +echo on |
| 43 | + |
| 44 | +set O4W_ROOT=%OSGEO4W_ROOT:\=/% |
| 45 | +set LIB_DIR=%O4W_ROOT% |
| 46 | + |
| 47 | +set DEVENV=devenv |
| 48 | + |
| 49 | +PROMPT qgis%VERSION%$g |
| 50 | + |
| 51 | +set BUILDCONF=Release |
| 52 | + |
| 53 | + |
| 54 | +cd ..\.. |
| 55 | +set SRCDIR=%CD% |
| 56 | + |
| 57 | +if "%BUILDDIR:~1,1%"==":" %BUILDDIR:~0,2% |
| 58 | +cd %BUILDDIR% |
| 59 | + |
| 60 | +if exist repackage goto package |
| 61 | + |
| 62 | +if not exist build.log goto build |
| 63 | + |
| 64 | +REM |
| 65 | +REM try renaming the logfile to see if it's locked |
| 66 | +REM |
| 67 | + |
| 68 | +if exist build.tmp del build.tmp |
| 69 | +if exist build.tmp goto error |
| 70 | + |
| 71 | +ren build.log build.tmp |
| 72 | +if exist build.log goto locked |
| 73 | +if not exist build.tmp goto locked |
| 74 | + |
| 75 | +ren build.tmp build.log |
| 76 | +if exist build.tmp goto locked |
| 77 | +if not exist build.log goto locked |
| 78 | + |
| 79 | +goto build |
| 80 | + |
| 81 | +:locked |
| 82 | +echo Logfile locked |
| 83 | +if exist build.tmp del build.tmp |
| 84 | +goto error |
| 85 | + |
| 86 | +:build |
| 87 | +echo Logging to %LOG% |
| 88 | +echo BEGIN: %DATE% %TIME%>>%LOG% 2>&1 |
| 89 | +if errorlevel 1 goto error |
| 90 | + |
| 91 | +set >buildenv.log |
| 92 | + |
| 93 | +if exist CMakeCache.txt goto skipcmake |
| 94 | + |
| 95 | +echo CMAKE: %DATE% %TIME%>>%LOG% 2>&1 |
| 96 | +if errorlevel 1 goto error |
| 97 | + |
| 98 | +set LIB=%LIB%;%OSGEO4W_ROOT%\lib |
| 99 | +set INCLUDE=%INCLUDE%;%OSGEO4W_ROOT%\include |
| 100 | +set GRASS_PREFIX=%O4W_ROOT%/apps/grass/grass-%GRASS_VERSION% |
| 101 | + |
| 102 | +cmake -G "Visual Studio 10 Win64" ^ |
| 103 | + -D PEDANTIC=TRUE ^ |
| 104 | + -D WITH_MAPSERVER=TRUE ^ |
| 105 | + -D WITH_GLOBE=FALSE ^ |
| 106 | + -D WITH_TOUCH=TRUE ^ |
| 107 | + -D WITH_GRASS=TRUE ^ |
| 108 | + -D CMAKE_BUILD_TYPE=%BUILDCONF% ^ |
| 109 | + -D CMAKE_CONFIGURATION_TYPES=%BUILDCONF% ^ |
| 110 | + -D GEOS_LIBRARY=%O4W_ROOT%/lib/geos_c.lib ^ |
| 111 | + -D SQLITE3_LIBRARY=%O4W_ROOT%/lib/sqlite3_i.lib ^ |
| 112 | + -D SPATIALITE_LIBRARY=%O4W_ROOT%/lib/spatialite_i.lib ^ |
| 113 | + -D SPATIALINDEX_LIBRARY=%O4W_ROOT%/lib/spatialindex-64.lib ^ |
| 114 | + -D PYTHON_EXECUTABLE=%O4W_ROOT%/bin/python.exe ^ |
| 115 | + -D PYTHON_INCLUDE_PATH=%O4W_ROOT%/apps/Python27/include ^ |
| 116 | + -D PYTHON_LIBRARY=%O4W_ROOT%/apps/Python27/libs/python27.lib ^ |
| 117 | + -D SIP_BINARY_PATH=%O4W_ROOT%/bin/sip.exe ^ |
| 118 | + -D QT_BINARY_DIR=%O4W_ROOT%/bin ^ |
| 119 | + -D QT_LIBRARY_DIR=%O4W_ROOT%/lib ^ |
| 120 | + -D QT_HEADERS_DIR=%O4W_ROOT%/include/qt4 ^ |
| 121 | + -D QWT_INCLUDE_DIR=%O4W_ROOT%/include/qwt ^ |
| 122 | + -D QWT_LIBRARY=%O4W_ROOT%/lib/qwt5.lib ^ |
| 123 | + -D CMAKE_INSTALL_PREFIX=%O4W_ROOT%/apps/%PACKAGENAME% ^ |
| 124 | + -D FCGI_INCLUDE_DIR=%O4W_ROOT%/include ^ |
| 125 | + -D FCGI_LIBRARY=%O4W_ROOT%/lib/libfcgi.lib ^ |
| 126 | + -D SETUPAPI_LIBRARY="%PROGRAMFILES(X86)%/Microsoft SDKs/Windows/v7.0A/Lib/x64/SetupAPI.Lib" ^ |
| 127 | + %SRCDIR%>>%LOG% 2>&1 |
| 128 | +if errorlevel 1 goto error |
| 129 | + |
| 130 | +REM bail out if python or grass was not found |
| 131 | +grep -Eq "^(Python not being built|Could not find GRASS)" %LOG% |
| 132 | +if not errorlevel 1 goto error |
| 133 | + |
| 134 | +:skipcmake |
| 135 | + |
| 136 | +echo ZERO_CHECK: %DATE% %TIME%>>%LOG% 2>&1 |
| 137 | +%DEVENV% qgis%VERSION%.sln /Project ZERO_CHECK /Build %BUILDCONF% /Out %LOG%>>%LOG% 2>&1 |
| 138 | +if errorlevel 1 goto error |
| 139 | + |
| 140 | +echo ALL_BUILD: %DATE% %TIME%>>%LOG% 2>&1 |
| 141 | +%DEVENV% qgis%VERSION%.sln /Project ALL_BUILD /Build %BUILDCONF% /Out %LOG%>>%LOG% 2>&1 |
| 142 | +if errorlevel 1 goto error |
| 143 | + |
| 144 | +echo INSTALL: %DATE% %TIME%>>%LOG% 2>&1 |
| 145 | +%DEVENV% qgis%VERSION%.sln /Project INSTALL /Build %BUILDCONF% /Out %LOG%>>%LOG% 2>&1 |
| 146 | +if errorlevel 1 goto error |
| 147 | + |
| 148 | +:package |
| 149 | +echo PACKAGE: %DATE% %TIME%>>%LOG% 2>&1 |
| 150 | + |
| 151 | +cd .. |
| 152 | +sed -e 's/@package@/%PACKAGENAME%/g' -e 's/@version@/%VERSION%/g' -e 's/@grassversion@/%GRASS_VERSION%/g' postinstall-common.bat >%OSGEO4W_ROOT%\etc\postinstall\\%PACKAGENAME%-common.bat |
| 153 | + |
| 154 | +sed -e 's/@package@/%PACKAGENAME%/g' -e 's/@version@/%VERSION%/g' -e 's/@grassversion@/%GRASS_VERSION%/g' postinstall-desktop64.bat >%OSGEO4W_ROOT%\etc\postinstall\%PACKAGENAME%.bat |
| 155 | +sed -e 's/@package@/%PACKAGENAME%/g' -e 's/@version@/%VERSION%/g' -e 's/@grassversion@/%GRASS_VERSION%/g' preremove-desktop.bat >%OSGEO4W_ROOT%\etc\preremove\%PACKAGENAME%.bat |
| 156 | +sed -e 's/@package@/%PACKAGENAME%/g' -e 's/@version@/%VERSION%/g' -e 's/@grassversion@/%GRASS_VERSION%/g' qgis.bat.tmpl >%OSGEO4W_ROOT%\bin\%PACKAGENAME%.bat.tmpl |
| 157 | +sed -e 's/@package@/%PACKAGENAME%/g' -e 's/@version@/%VERSION%/g' -e 's/@grassversion@/%GRASS_VERSION%/g' browser.bat.tmpl >%OSGEO4W_ROOT%\bin\%PACKAGENAME%-browser.bat.tmpl |
| 158 | +sed -e 's/@package@/%PACKAGENAME%/g' -e 's/@version@/%VERSION%/g' -e 's/@grassversion@/%GRASS_VERSION%/g' qgis.reg.tmpl >%OSGEO4W_ROOT%\apps\%PACKAGENAME%\bin\qgis.reg.tmpl |
| 159 | + |
| 160 | +sed -e 's/@package@/%PACKAGENAME%/g' -e 's/@version@/%VERSION%/g' -e 's/@grassversion@/%GRASS_VERSION%/g' postinstall-server.bat >%OSGEO4W_ROOT%\etc\postinstall\%PACKAGENAME%-server.bat |
| 161 | +sed -e 's/@package@/%PACKAGENAME%/g' -e 's/@version@/%VERSION%/g' -e 's/@grassversion@/%GRASS_VERSION%/g' preremove-server.bat >%OSGEO4W_ROOT%\etc\preremove\%PACKAGENAME%-server.bat |
| 162 | +if not exist %OSGEO4W_ROOT%\httpd.d mkdir %OSGEO4W_ROOT%\httpd.d |
| 163 | +sed -e 's/@package@/%PACKAGENAME%/g' -e 's/@version@/%VERSION%/g' -e 's/@grassversion@/%GRASS_VERSION%/g' httpd.conf.tmpl >%OSGEO4W_ROOT%\httpd.d\httpd_%PACKAGENAME%.conf.tmpl |
| 164 | + |
| 165 | +REM sed -e 's/%OSGEO4W_ROOT:\=\\\\\\\\%/@osgeo4w@/' %OSGEO4W_ROOT%\apps\%PACKAGENAME%\python\qgis\qgisconfig.py >%OSGEO4W_ROOT%\apps\%PACKAGENAME%\python\qgis\qgisconfig.py.tmpl |
| 166 | +REM if errorlevel 1 goto error |
| 167 | + |
| 168 | +REM del %OSGEO4W_ROOT%\apps\%PACKAGENAME%\python\qgis\qgisconfig.py |
| 169 | + |
| 170 | +touch exclude |
| 171 | + |
| 172 | +tar -C %OSGEO4W_ROOT% -cjf %PACKAGENAME%-common-%VERSION%-%PACKAGE%.tar.bz2 ^ |
| 173 | + --exclude-from exclude ^ |
| 174 | + --exclude "*.pyc" ^ |
| 175 | + "apps/%PACKAGENAME%/bin/qgispython.dll" ^ |
| 176 | + "apps/%PACKAGENAME%/bin/qgis_analysis.dll" ^ |
| 177 | + "apps/%PACKAGENAME%/bin/qgis_networkanalysis.dll" ^ |
| 178 | + "apps/%PACKAGENAME%/bin/qgis_core.dll" ^ |
| 179 | + "apps/%PACKAGENAME%/bin/qgis_gui.dll" ^ |
| 180 | + "apps/%PACKAGENAME%/doc/" ^ |
| 181 | + "apps/%PACKAGENAME%/plugins/delimitedtextprovider.dll" ^ |
| 182 | + "apps/%PACKAGENAME%/plugins/diagramoverlay.dll" ^ |
| 183 | + "apps/%PACKAGENAME%/plugins/gdalprovider.dll" ^ |
| 184 | + "apps/%PACKAGENAME%/plugins/gpxprovider.dll" ^ |
| 185 | + "apps/%PACKAGENAME%/plugins/memoryprovider.dll" ^ |
| 186 | + "apps/%PACKAGENAME%/plugins/ogrprovider.dll" ^ |
| 187 | + "apps/%PACKAGENAME%/plugins/osmprovider.dll" ^ |
| 188 | + "apps/%PACKAGENAME%/plugins/postgresprovider.dll" ^ |
| 189 | + "apps/%PACKAGENAME%/plugins/spatialiteprovider.dll" ^ |
| 190 | + "apps/%PACKAGENAME%/plugins/sqlanywhereprovider.dll" ^ |
| 191 | + "apps/%PACKAGENAME%/plugins/qgissqlanyconnection.dll" ^ |
| 192 | + "apps/%PACKAGENAME%/plugins/wfsprovider.dll" ^ |
| 193 | + "apps/%PACKAGENAME%/plugins/wmsprovider.dll" ^ |
| 194 | + "apps/%PACKAGENAME%/plugins/mssqlprovider.dll" ^ |
| 195 | + "apps/%PACKAGENAME%/resources/qgis.db" ^ |
| 196 | + "apps/%PACKAGENAME%/resources/spatialite.db" ^ |
| 197 | + "apps/%PACKAGENAME%/resources/srs.db" ^ |
| 198 | + "apps/%PACKAGENAME%/resources/symbology-ng-style.xml" ^ |
| 199 | + "apps/%PACKAGENAME%/svg/" ^ |
| 200 | + "apps/%PACKAGENAME%/crssync.exe" ^ |
| 201 | + "etc/postinstall/%PACKAGENAME%-common.bat" ^ |
| 202 | + >>%LOG% 2>&1 |
| 203 | +if errorlevel 1 goto error |
| 204 | + |
| 205 | +tar -C %OSGEO4W_ROOT% -cjf %PACKAGENAME%-server-%VERSION%-%PACKAGE%.tar.bz2 ^ |
| 206 | + --exclude-from exclude ^ |
| 207 | + --exclude "*.pyc" ^ |
| 208 | + "apps/%PACKAGENAME%/bin/qgis_mapserv.fcgi.exe" ^ |
| 209 | + "apps/%PACKAGENAME%/bin/admin.sld" ^ |
| 210 | + "apps/%PACKAGENAME%/bin/wms_metadata.xml" ^ |
| 211 | + "httpd.d/httpd_%PACKAGENAME%.conf.tmpl" ^ |
| 212 | + "etc/postinstall/%PACKAGENAME%-server.bat" ^ |
| 213 | + "etc/preremove/%PACKAGENAME%-server.bat" ^ |
| 214 | + >>%LOG% 2>&1 |
| 215 | +if errorlevel 1 goto error |
| 216 | + |
| 217 | +move %OSGEO4W_ROOT%\apps\%PACKAGENAME%\bin\qgis.exe %OSGEO4W_ROOT%\bin\%PACKAGENAME%-bin.exe |
| 218 | +move %OSGEO4W_ROOT%\apps\%PACKAGENAME%\bin\qbrowser.exe %OSGEO4W_ROOT%\bin\%PACKAGENAME%-browser-bin.exe |
| 219 | +tar -C %OSGEO4W_ROOT% -cjf %PACKAGENAME%-%VERSION%-%PACKAGE%.tar.bz2 ^ |
| 220 | + --exclude-from exclude ^ |
| 221 | + --exclude "*.pyc" ^ |
| 222 | + "bin/%PACKAGENAME%-browser-bin.exe" ^ |
| 223 | + "bin/%PACKAGENAME%-bin.exe" ^ |
| 224 | + "apps/%PACKAGENAME%/bin/qgis.reg.tmpl" ^ |
| 225 | + "apps/%PACKAGENAME%/i18n/" ^ |
| 226 | + "apps/%PACKAGENAME%/icons/" ^ |
| 227 | + "apps/%PACKAGENAME%/images/" ^ |
| 228 | + "apps/%PACKAGENAME%/plugins/coordinatecaptureplugin.dll" ^ |
| 229 | + "apps/%PACKAGENAME%/plugins/delimitedtextplugin.dll" ^ |
| 230 | + "apps/%PACKAGENAME%/plugins/dxf2shpconverterplugin.dll" ^ |
| 231 | + "apps/%PACKAGENAME%/plugins/evis.dll" ^ |
| 232 | + "apps/%PACKAGENAME%/plugins/georefplugin.dll" ^ |
| 233 | + "apps/%PACKAGENAME%/plugins/gpsimporterplugin.dll" ^ |
| 234 | + "apps/%PACKAGENAME%/plugins/interpolationplugin.dll" ^ |
| 235 | + "apps/%PACKAGENAME%/plugins/offlineeditingplugin.dll" ^ |
| 236 | + "apps/%PACKAGENAME%/plugins/oracleplugin.dll" ^ |
| 237 | + "apps/%PACKAGENAME%/plugins/rasterterrainplugin.dll" ^ |
| 238 | + "apps/%PACKAGENAME%/plugins/roadgraphplugin.dll" ^ |
| 239 | + "apps/%PACKAGENAME%/plugins/spatialqueryplugin.dll" ^ |
| 240 | + "apps/%PACKAGENAME%/plugins/spitplugin.dll" ^ |
| 241 | + "apps/%PACKAGENAME%/plugins/sqlanywhereplugin.dll" ^ |
| 242 | + "apps/%PACKAGENAME%/plugins/zonalstatisticsplugin.dll" ^ |
| 243 | + "apps/%PACKAGENAME%/plugins/heatmapplugin.dll" ^ |
| 244 | + "apps/%PACKAGENAME%/qgis_help.exe" ^ |
| 245 | + "apps/%PACKAGENAME%/python/" ^ |
| 246 | + "apps/%PACKAGENAME%/resources/context_help/" ^ |
| 247 | + "apps/%PACKAGENAME%/resources/function_help/" ^ |
| 248 | + "apps/%PACKAGENAME%/resources/customization.xml" ^ |
| 249 | + "apps/%PACKAGENAME%/resources/qgis_help.db" ^ |
| 250 | + "bin/%PACKAGENAME%.bat.tmpl" ^ |
| 251 | + "bin/%PACKAGENAME%-browser.bat.tmpl" ^ |
| 252 | + "etc/postinstall/%PACKAGENAME%.bat" ^ |
| 253 | + "etc/preremove/%PACKAGENAME%.bat" ^ |
| 254 | + >>%LOG% 2>&1 |
| 255 | +if errorlevel 1 goto error |
| 256 | + |
| 257 | +tar -C %OSGEO4W_ROOT% -cjf %PACKAGENAME%-grass-plugin-%VERSION%-%PACKAGE%.tar.bz2 ^ |
| 258 | + --exclude-from exclude ^ |
| 259 | + --exclude "*.pyc" ^ |
| 260 | + "apps/%PACKAGENAME%/grass" ^ |
| 261 | + "apps/%PACKAGENAME%/bin/qgisgrass.dll" ^ |
| 262 | + "apps/%PACKAGENAME%/plugins/grassrasterprovider.dll" ^ |
| 263 | + "apps/%PACKAGENAME%/plugins/grassplugin.dll" ^ |
| 264 | + "apps/%PACKAGENAME%/plugins/grassprovider.dll" ^ |
| 265 | + >>%LOG% 2>&1 |
| 266 | +if errorlevel 1 goto error |
| 267 | + |
| 268 | +goto skipglobe |
| 269 | +tar -C %OSGEO4W_ROOT% -cjf %PACKAGENAME%-globe-plugin-%VERSION%-%PACKAGE%.tar.bz2 ^ |
| 270 | + --exclude-from exclude ^ |
| 271 | + --exclude "*.pyc" ^ |
| 272 | + "apps/%PACKAGENAME%/globe" ^ |
| 273 | + "apps/%PACKAGENAME%/plugins/globeplugin.dll" ^ |
| 274 | + >>%LOG% 2>&1 |
| 275 | +if errorlevel 1 goto error |
| 276 | +:skipglobe |
| 277 | + |
| 278 | +tar -C %OSGEO4W_ROOT% -cjf %PACKAGENAME%-devel-%VERSION%-%PACKAGE%.tar.bz2 ^ |
| 279 | + --exclude-from exclude ^ |
| 280 | + --exclude "*.pyc" ^ |
| 281 | + "apps/%PACKAGENAME%/FindQGIS.cmake" ^ |
| 282 | + "apps/%PACKAGENAME%/include/" ^ |
| 283 | + "apps/%PACKAGENAME%/lib/" ^ |
| 284 | + >>%LOG% 2>&1 |
| 285 | +if errorlevel 1 goto error |
| 286 | + |
| 287 | +goto end |
| 288 | + |
| 289 | +:error |
| 290 | +echo BUILD ERROR %ERRORLEVEL%: %DATE% %TIME% |
| 291 | +echo BUILD ERROR %ERRORLEVEL%: %DATE% %TIME%>>%LOG% 2>&1 |
| 292 | +if exist %PACKAGENAME%-common-%VERSION%-%PACKAGE%.tar.bz2 del %PACKAGENAME%-common-%VERSION%-%PACKAGE%.tar.bz2 |
| 293 | +if exist %PACKAGENAME%-%VERSION%-%PACKAGE%.tar.bz2 del %PACKAGENAME%-%VERSION%-%PACKAGE%.tar.bz2 |
| 294 | +if exist %PACKAGENAME%-server-%VERSION%-%PACKAGE%.tar.bz2 del %PACKAGENAME%-server-%VERSION%-%PACKAGE%.tar.bz2 |
| 295 | +if exist %PACKAGENAME%-devel-%VERSION%-%PACKAGE%.tar.bz2 del %PACKAGENAME%-devel-%VERSION%-%PACKAGE%.tar.bz2 |
| 296 | +if exist %PACKAGENAME%-grass-plugin-%VERSION%-%PACKAGE%.tar.bz2 del %PACKAGENAME%-grass-plugin-%VERSION%-%PACKAGE%.tar.bz2 |
| 297 | +if exist %PACKAGENAME%-globe-plugin-%VERSION%-%PACKAGE%.tar.bz2 del %PACKAGENAME%-globe-plugin-%VERSION%-%PACKAGE%.tar.bz2 |
| 298 | + |
| 299 | +:end |
| 300 | +echo FINISHED: %DATE% %TIME% >>%LOG% 2>&1 |
0 commit comments