Skip to content

Commit a265073

Browse files
committedJan 26, 2018
update package*.cmd for 3 and GRASS 7.x
1 parent 7b95917 commit a265073

File tree

2 files changed

+52
-23
lines changed

2 files changed

+52
-23
lines changed
 

‎ms-windows/osgeo4w/package-nightly.cmd

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ set CMAKE_OPT=^
7070
-D CMAKE_CXX_FLAGS_RELWITHDEBINFO="/MD /ZI /MP /Od /D NDEBUG /D QGISDEBUG" ^
7171
-D CMAKE_PDB_OUTPUT_DIRECTORY_RELWITHDEBINFO=%BUILDDIR%\apps\%PACKAGENAME%\pdb ^
7272
-D SPATIALINDEX_LIBRARY=%O4W_ROOT%/lib/spatialindex_i.lib
73-
7473
goto cmake
7574

7675
:cmake_x86_64
@@ -90,10 +89,15 @@ set CMAKE_OPT=^
9089
-D CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS=TRUE
9190

9291
:cmake
93-
for /f "usebackq tokens=1" %%a in (`%OSGEO4W_ROOT%\bin\grass72 --config path`) do set GRASS72_PATH=%%a
94-
for %%i in ("%GRASS72_PATH%") do set GRASS72_VERSION=%%~nxi
95-
set GRASS72_VERSION=%GRASS72_VERSION:grass-=%
96-
set GRASS_VERSIONS=%GRASS72_VERSION%
92+
set GRASS7=
93+
if exist %OSGEO4W_ROOT%\bin\grass72.bat set GRASS7=%OSGEO4W_ROOT%\bin\grass72.bat
94+
if exist %OSGEO4W_ROOT%\bin\grass74.bat set GRASS7=%OSGEO4W_ROOT%\bin\grass74.bat
95+
if "%GRASS7%"=="" (echo GRASS7 not found & goto error)
96+
97+
for /f "usebackq tokens=1" %%a in (`%GRASS7% --config path`) do set GRASS7_PATH=%%a
98+
for %%i in ("%GRASS7_PATH%") do set GRASS7_VERSION=%%~nxi
99+
set GRASS7_VERSION=%GRASS7_VERSION:grass-=%
100+
set GRASS_VERSIONS=%GRASS7_VERSION%
97101

98102
set PYTHONPATH=
99103
if exist "%PF86%\CMake\bin" path %PATH%;c:\cygwin\bin;%PF86%\CMake\bin
@@ -167,7 +171,7 @@ cmake -G Ninja ^
167171
-D WITH_GRASS=TRUE ^
168172
-D WITH_3D=TRUE ^
169173
-D WITH_GRASS7=TRUE ^
170-
-D GRASS_PREFIX7=%GRASS72_PATH:\=/% ^
174+
-D GRASS_PREFIX7=%GRASS7_PATH:\=/% ^
171175
-D WITH_GLOBE=FALSE ^
172176
-D WITH_ORACLE=TRUE ^
173177
-D WITH_CUSTOM_WIDGETS=TRUE ^
@@ -267,14 +271,11 @@ for %%g IN (%GRASS_VERSIONS%) do (
267271
)
268272

269273
sed -e 's/@package@/%PACKAGENAME%/g' -e 's/@version@/%VERSION%/g' python.bat.tmpl >%OSGEO4W_ROOT%\bin\python-%PACKAGENAME%.bat.tmpl
270-
if errorlevel 1 (echo creation of python wrapper failed & goto error)
274+
if errorlevel 1 (echo creation of python wrapper template failed & goto error)
271275

272-
REM sed -e 's/%OSGEO4W_ROOT:\=\\\\\\\\%/@osgeo4w@/' %PKGDIR%\python\qgis\qgisconfig.py >%PKGDIR%\python\qgis\qgisconfig.py.tmpl
273-
REM if errorlevel 1 (echo creation of qgisconfig.py.tmpl failed & goto error)
274-
275-
REM del %PKGDIR%\python\qgis\qgisconfig.py
276276

277277
touch exclude
278+
if exist ..\skipbuild (echo skip build & goto skipbuild)
278279

279280
move %PKGDIR%\bin\qgis.exe %OSGEO4W_ROOT%\bin\%PACKAGENAME%-bin.exe
280281
if errorlevel 1 (echo move of desktop executable failed & goto error)

‎ms-windows/osgeo4w/package.cmd

Lines changed: 40 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -62,17 +62,20 @@ call "%PF86%\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86
6262
path %path%;%PF86%\Microsoft Visual Studio 14.0\VC\bin
6363
set CMAKE_COMPILER_PATH=%PF86%\Microsoft Visual Studio 14.0\VC\bin
6464
set SETUPAPI_LIBRARY=c:\Program Files (x86)\Windows Kits\10\Lib\10.0.14393.0\um\x86\SetupAPI.Lib
65+
if not exist "%SETUPAPI_LIBRARY%" set SETUPAPI_LIBRARY=c:\Program Files (x86)\Windows Kits\8.0\Lib\win8\um\x86\SetupAPI.Lib
6566
if not exist "%SETUPAPI_LIBRARY%" (echo SETUPAPI_LIBRARY not found & goto error)
6667

6768
set CMAKE_OPT=^
6869
-D SIP_BINARY_PATH=%O4W_ROOT%/apps/Python36/sip.exe ^
70+
-D SPATIALINDEX_LIBRARY=%O4W_ROOT%/lib/spatialindex_i.lib
6971
goto cmake
7072

7173
:cmake_x86_64
7274
call "%PF86%\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64
7375
path %path%;%PF86%\Microsoft Visual Studio 14.0\VC\bin
7476
set CMAKE_COMPILER_PATH=%PF86%\Microsoft Visual Studio 14.0\VC\bin\amd64
7577
set SETUPAPI_LIBRARY=c:\Program Files (x86)\Windows Kits\10\Lib\10.0.14393.0\um\x64\SetupAPI.Lib
78+
if not exist "%SETUPAPI_LIBRARY%" set SETUPAPI_LIBRARY=c:\Program Files (x86)\Windows Kits\8.0\Lib\win8\um\x64\SetupAPI.Lib
7679
if not exist "%SETUPAPI_LIBRARY%" (echo SETUPAPI_LIBRARY not found & goto error)
7780

7881
set CMAKE_OPT=^
@@ -84,13 +87,19 @@ set CMAKE_OPT=^
8487
-D CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS=TRUE
8588

8689
:cmake
87-
for /f "usebackq tokens=1" %%a in (`%OSGEO4W_ROOT%\bin\grass72 --config path`) do set GRASS72_PATH=%%a
88-
for %%i in ("%GRASS72_PATH%") do set GRASS72_VERSION=%%~nxi
89-
set GRASS72_VERSION=%GRASS72_VERSION:grass-=%
90-
set GRASS_VERSIONS=%GRASS72_VERSION%
90+
set GRASS7=
91+
if exist %OSGEO4W_ROOT%\bin\grass72.bat set GRASS7=%OSGEO4W_ROOT%\bin\grass72.bat
92+
if exist %OSGEO4W_ROOT%\bin\grass74.bat set GRASS7=%OSGEO4W_ROOT%\bin\grass74.bat
93+
if "%GRASS7%"=="" (echo GRASS7 not found & goto error)
94+
95+
for /f "usebackq tokens=1" %%a in (`%GRASS7% --config path`) do set GRASS7_PATH=%%a
96+
for %%i in ("%GRASS7_PATH%") do set GRASS7_VERSION=%%~nxi
97+
set GRASS7_VERSION=%GRASS7_VERSION:grass-=%
98+
set GRASS_VERSIONS=%GRASS7_VERSION%
9199

92100
set PYTHONPATH=
93-
path %PATH%;c:\cygwin\bin;%PF86%\CMake\bin
101+
if exist "%PF86%\CMake\bin" path %PATH%;c:\cygwin\bin;%PF86%\CMake\bin
102+
if exist "%PROGRAMFILES%\CMake\bin" path %PATH%;c:\cygwin\bin;%PROGRAMFILES%\CMake\bin
94103

95104
PROMPT qgis%VERSION%$g
96105

@@ -158,8 +167,9 @@ cmake -G Ninja ^
158167
-D WITH_SERVER=TRUE ^
159168
-D SERVER_SKIP_ECW=TRUE ^
160169
-D WITH_GRASS=TRUE ^
170+
-D WITH_3D=TRUE ^
161171
-D WITH_GRASS7=TRUE ^
162-
-D GRASS_PREFIX7=%GRASS72_PATH:\=/% ^
172+
-D GRASS_PREFIX7=%GRASS7_PATH:\=/% ^
163173
-D WITH_GLOBE=FALSE ^
164174
-D WITH_ORACLE=TRUE ^
165175
-D WITH_CUSTOM_WIDGETS=TRUE ^
@@ -192,27 +202,38 @@ cmake --build %BUILDDIR% --target clean --config %BUILDCONF%
192202
if errorlevel 1 (echo clean failed & goto error)
193203

194204
:skipclean
205+
if exist ..\skipbuild (echo skip build & goto skipbuild)
195206
echo ALL_BUILD: %DATE% %TIME%
196207
cmake --build %BUILDDIR% --config %BUILDCONF%
197208
if errorlevel 1 cmake --build %BUILDDIR% --config %BUILDCONF%
198209
if errorlevel 1 (echo build failed twice & goto error)
199210

211+
:skipbuild
200212
if exist ..\skiptests goto skiptests
201213

202214
echo RUN_TESTS: %DATE% %TIME%
203215

204216
set oldtemp=%TEMP%
205217
set oldtmp=%TMP%
206218
set oldpath=%PATH%
219+
220+
set TEMP=%TEMP%\%PACKAGENAME%-%ARCH%
221+
set TMP=%TEMP%
222+
if exist "%TEMP%" rmdir /s /q "%TEMP%"
223+
mkdir "%TEMP%"
224+
207225
for %%g IN (%GRASS_VERSIONS%) do (
208226
set path=!path!;%OSGEO4W_ROOT%\apps\grass\grass-%%g\lib
209227
set GISBASE=%OSGEO4W_ROOT%\apps\grass\grass-%%g
210228
)
211-
PATH %path%;%BUILDDIR%\output\plugins\%BUILDCONF%
229+
PATH %path%;%BUILDDIR%\output\plugins
230+
set QT_PLUGIN_PATH=%BUILDDIR%\output\plugins;%OSGEO4W_ROOT%\apps\qt5\plugins
212231

213232
cmake --build %BUILDDIR% --target Experimental --config %BUILDCONF%
214233
if errorlevel 1 echo TESTS WERE NOT SUCCESSFUL.
215234

235+
set TEMP=%oldtemp%
236+
set TMP=%oldtmp%
216237
PATH %oldpath%
217238

218239
:skiptests
@@ -244,10 +265,6 @@ if errorlevel 1 (echo creation of desktop template failed & goto error)
244265

245266
sed -e 's/@package@/%PACKAGENAME%/g' -e 's/@version@/%VERSION%/g' designer.bat.tmpl >%OSGEO4W_ROOT%\bin\%PACKAGENAME%-designer.bat.tmpl
246267
if errorlevel 1 (echo creation of designer template failed & goto error)
247-
248-
sed -e 's/@package@/%PACKAGENAME%/g' -e 's/@version@/%VERSION%/g' python.bat.tmpl >%OSGEO4W_ROOT%\bin\python-%PACKAGENAME%.bat.tmpl
249-
if errorlevel 1 (echo creation of python wrapper template failed & goto error)
250-
251268
sed -e 's/@package@/%PACKAGENAME%/g' -e 's/@version@/%VERSION%/g' qgis.reg.tmpl >%PKGDIR%\bin\qgis.reg.tmpl
252269
if errorlevel 1 (echo creation of registry template & goto error)
253270

@@ -278,12 +295,16 @@ for %%g IN (%GRASS_VERSIONS%) do (
278295
set packages=!packages! "-grass-plugin!w!"
279296
)
280297

298+
sed -e 's/@package@/%PACKAGENAME%/g' -e 's/@version@/%VERSION%/g' python.bat.tmpl >%OSGEO4W_ROOT%\bin\python-%PACKAGENAME%.bat.tmpl
299+
if errorlevel 1 (echo creation of python wrapper template failed & goto error)
300+
281301
sed -e 's/@package@/%PACKAGENAME%/g' -e 's/@version@/%VERSION%/g' preremove-grass-plugin-common.bat >%OSGEO4W_ROOT%\etc\preremove\%PACKAGENAME%-grass-plugin-common.bat
282302
if errorlevel 1 (echo creation of grass common preremove failed & goto error)
283303
sed -e 's/@package@/%PACKAGENAME%/g' -e 's/@version@/%VERSION%/g' postinstall-grass-plugin-common.bat >%OSGEO4W_ROOT%\etc\postinstall\%PACKAGENAME%-grass-plugin-common.bat
284304
if errorlevel 1 (echo creation of grass common postinstall failed & goto error)
285305

286306
touch exclude
307+
if exist ..\skipbuild (echo skip build & goto skipbuild)
287308

288309
for %%i in (%packages%) do (
289310
if not exist %ARCH%\release\qgis\%PACKAGENAME%%%i mkdir %ARCH%\release\qgis\%PACKAGENAME%%%i
@@ -294,8 +315,10 @@ tar -C %OSGEO4W_ROOT% -cjf %ARCH%/release/qgis/%PACKAGENAME%-common/%PACKAGENAME
294315
--exclude "*.pyc" ^
295316
"apps/%PACKAGENAME%/bin/qgispython.dll" ^
296317
"apps/%PACKAGENAME%/bin/qgis_analysis.dll" ^
318+
"apps/%PACKAGENAME%/bin/qgis_3d.dll" ^
297319
"apps/%PACKAGENAME%/bin/qgis_core.dll" ^
298320
"apps/%PACKAGENAME%/bin/qgis_gui.dll" ^
321+
"apps/%PACKAGENAME%/bin/qgis_native.dll" ^
299322
"apps/%PACKAGENAME%/doc/" ^
300323
"apps/%PACKAGENAME%/plugins/basicauthmethod.dll" ^
301324
"apps/%PACKAGENAME%/plugins/delimitedtextprovider.dll" ^
@@ -334,7 +357,8 @@ tar -C %OSGEO4W_ROOT% -cjf %ARCH%/release/qgis/%PACKAGENAME%-server/%PACKAGENAME
334357
"apps/%PACKAGENAME%/bin/qgis_server.dll" ^
335358
"apps/%PACKAGENAME%/bin/admin.sld" ^
336359
"apps/%PACKAGENAME%/bin/wms_metadata.xml" ^
337-
"apps/%PACKAGENAME%/bin/schemaExtension.xsd" ^
360+
"apps/%PACKAGENAME%/resources/server/schemaExtension.xsd" ^
361+
"apps/%PACKAGENAME%/server/" ^
338362
"apps/%PACKAGENAME%/python/qgis/_server.pyd" ^
339363
"apps/%PACKAGENAME%/python/qgis/server/" ^
340364
"httpd.d/httpd_%PACKAGENAME%.conf.tmpl" ^
@@ -368,6 +392,7 @@ tar -C %OSGEO4W_ROOT% -cjf %ARCH%/release/qgis/%PACKAGENAME%/%PACKAGENAME%-%VERS
368392
--exclude "apps/%PACKAGENAME%/python/qgis/_server.pyd" ^
369393
--exclude "apps/%PACKAGENAME%/python/qgis/_server.lib" ^
370394
--exclude "apps/%PACKAGENAME%/python/qgis/server" ^
395+
--exclude "apps/%PACKAGENAME%/server/" ^
371396
"bin/%PACKAGENAME%-bin.exe" ^
372397
"bin/%PACKAGENAME%-bin.vars" ^
373398
"bin/python-%PACKAGENAME%.bat.tmpl" ^
@@ -391,6 +416,8 @@ tar -C %OSGEO4W_ROOT% -cjf %ARCH%/release/qgis/%PACKAGENAME%/%PACKAGENAME%-%VERS
391416
"apps/%PACKAGENAME%/resources/data/" ^
392417
"apps/%PACKAGENAME%/resources/metadata-ISO/" ^
393418
"apps/%PACKAGENAME%/resources/2to3migration.txt" ^
419+
"apps/%PACKAGENAME%/qgiscrashhandler.exe" ^
420+
"apps/%PACKAGENAME%/qgis_global_settings.ini" ^
394421
"bin/%PACKAGENAME%.bat.tmpl" ^
395422
"bin/%PACKAGENAME%-designer.bat.tmpl" ^
396423
"etc/postinstall/%PACKAGENAME%.bat" ^
@@ -473,6 +500,7 @@ echo BUILD ERROR %ERRORLEVEL%: %DATE% %TIME%
473500
for %%i in ("" "-common" "-server" "-devel" "-grass-plugin" "-globe-plugin" "-oracle-provider") do (
474501
if exist %ARCH%\release\qgis\%PACKAGENAME%%%i\%PACKAGENAME%%%i-%VERSION%-%PACKAGE%.tar.bz2 del %ARCH%\release\qgis\%PACKAGENAME%%%i\%PACKAGENAME%%%i-%VERSION%-%PACKAGE%.tar.bz2
475502
)
503+
exit /b 1
476504

477505
:end
478506
echo FINISHED: %DATE% %TIME%

0 commit comments

Comments
 (0)
Please sign in to comment.