Skip to content

Commit

Permalink
osgeo4w: switch nightly to GDAL3 and PROJ6 nightlies
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Aug 9, 2019
1 parent 7e16b6c commit bc1aea6
Show file tree
Hide file tree
Showing 21 changed files with 71 additions and 27 deletions.
10 changes: 9 additions & 1 deletion ms-windows/osgeo4w/package-nightly.cmd
Expand Up @@ -34,6 +34,7 @@ if not exist "%BUILDDIR%" mkdir %BUILDDIR%
if not exist "%BUILDDIR%" (echo could not create build directory %BUILDDIR% & goto error)

call msvc-env.bat %ARCH%
call gdal-dev-env.bat

set O4W_ROOT=%OSGEO4W_ROOT:\=/%
set LIB_DIR=%O4W_ROOT%
Expand Down Expand Up @@ -149,6 +150,10 @@ cmake -G "%CMAKEGEN%" ^
-D WITH_CUSTOM_WIDGETS=TRUE ^
-D CMAKE_BUILD_TYPE=%BUILDCONF% ^
-D CMAKE_CONFIGURATION_TYPES=%BUILDCONF% ^
-D PROJ_LIBRARY=%O4W_ROOT%/apps/proj-dev/lib/proj_6_1.lib ^
-D PROJ_INCLUDE_DIR=%O4W_ROOT%/apps/proj-dev/include ^
-D GDAL_LIBRARY=%O4W_ROOT%/apps/gdal-dev/lib/gdal_i.lib ^
-D GDAL_INCLUDE_DIR=%O4W_ROOT%/apps/gdal-dev/include ^
-D GEOS_LIBRARY=%O4W_ROOT%/lib/geos_c.lib ^
-D SQLITE3_LIBRARY=%O4W_ROOT%/lib/sqlite3_i.lib ^
-D SPATIALITE_LIBRARY=%O4W_ROOT%/lib/spatialite_i.lib ^
Expand Down Expand Up @@ -248,12 +253,15 @@ if errorlevel 1 (echo creation of designer template failed & goto error)
sed -e 's/@package@/%PACKAGENAME%/g' -e 's/@version@/%VERSION%/g' qgis.reg.tmpl >%PKGDIR%\bin\qgis.reg.tmpl
if errorlevel 1 (echo creation of registry template & goto error)

sed -e 's/@package@/%PACKAGENAME%/g' -e 's/@version@/%VERSION%/g' -e '/^call py3_env.bat/acall gdal-dev-env.bat' qgis.bat.tmpl >%OSGEO4W_ROOT%\bin\%PACKAGENAME%.bat.tmpl
if errorlevel 1 (echo creation of desktop template failed & goto error)

set batches=
for %%g IN (%GRASS_VERSIONS%) do (
for /f "usebackq tokens=1" %%a in (`%%g --config version`) do set gv=%%a
for /F "delims=." %%i in ("!gv!") do set v=%%i

sed -e 's/@package@/%PACKAGENAME%/g' -e 's/@version@/%VERSION%/g' -e 's/@grasspath@/%%g/g' -e 's/@grassversion@/!gv!/g' qgis-grass.bat.tmpl >%OSGEO4W_ROOT%\bin\%PACKAGENAME%-g!v!.bat.tmpl
sed -e 's/@package@/%PACKAGENAME%/g' -e 's/@version@/%VERSION%/g' -e 's/@grasspath@/%%g/g' -e 's/@grassversion@/!gv!/g' -e '/^call py3_env.bat/acall gdal-dev-env.bat' qgis-grass.bat.tmpl >%OSGEO4W_ROOT%\bin\%PACKAGENAME%-g!v!.bat.tmpl
if errorlevel 1 (echo creation of desktop template failed & goto error)
set batches=!batches! bin/%PACKAGENAME%-g!v!.bat.tmpl
)
Expand Down
24 changes: 17 additions & 7 deletions ms-windows/osgeo4w/postinstall-dev.bat
@@ -1,5 +1,6 @@
setlocal enabledelayedexpansion

textreplace -std -t bin\@package@.bat
textreplace -std -t bin\@package@-designer.bat
textreplace -std -t bin\python-@package@.bat

Expand All @@ -8,17 +9,25 @@ if "%OSGEO4W_DESKTOP%"=="" set OSGEO4W_DESKTOP=~$folder.common_desktop$
if not %OSGEO4W_MENU_LINKS%==0 mkdir "%OSGEO4W_STARTMENU%"
if not %OSGEO4W_DESKTOP_LINKS%==0 mkdir "%OSGEO4W_DESKTOP%"

call "%OSGEO4W_ROOT%\bin\@package@.bat" --postinstall

if not %OSGEO4W_MENU_LINKS%==0 nircmd shortcut "%OSGEO4W_ROOT%\bin\@package@-bin.exe" "%OSGEO4W_STARTMENU%" "QGIS Desktop @version@" "" "" "" "" "~$folder.mydocuments$"
if not %OSGEO4W_DESKTOP_LINKS%==0 nircmd shortcut "%OSGEO4W_ROOT%\bin\@package@-bin.exe" "%OSGEO4W_DESKTOP%" "QGIS Desktop @version@" "" "" "" "" "~$folder.mydocuments$"

for %%g in (@grassversions@) do (
set gv=
for /f "usebackq tokens=1" %%a in (`%%g --config version`) do set gv=%%a
for /F "delims=." %%i in ("!gv!") do set v=%%i
if not "!gv!"=="" (
for /F "delims=." %%i in ("!gv!") do set v=%%i

copy "%OSGEO4W_ROOT%\bin\@package@-bin.exe" "%OSGEO4W_ROOT%\bin\@package@-bin-g!v!.exe"
copy "%OSGEO4W_ROOT%\bin\@package@-bin.vars" "%OSGEO4W_ROOT%\bin\@package@-bin-g!v!.vars"
textreplace -std -map @grassmajor@ !v! -t bin\@package@-g!v!.bat
call "%OSGEO4W_ROOT%\bin\@package@-g!v!.bat" --postinstall
copy "%OSGEO4W_ROOT%\bin\@package@-bin.exe" "%OSGEO4W_ROOT%\bin\@package@-bin-g!v!.exe"
copy "%OSGEO4W_ROOT%\bin\@package@-bin.vars" "%OSGEO4W_ROOT%\bin\@package@-bin-g!v!.vars"
textreplace -std -map @grassmajor@ !v! -t bin\@package@-g!v!.bat
call "%OSGEO4W_ROOT%\bin\@package@-g!v!.bat" --postinstall

if not %OSGEO4W_MENU_LINKS%==0 nircmd shortcut "%OSGEO4W_ROOT%\bin\@package@-bin-g!v!.exe" "%OSGEO4W_STARTMENU%" "QGIS Desktop @version@ with GRASS !gv! (Nightly)" "" "" "" "" "~$folder.mydocuments$"
if not %OSGEO4W_DESKTOP_LINKS%==0 nircmd shortcut "%OSGEO4W_ROOT%\bin\@package@-bin-g!v!.exe" "%OSGEO4W_DESKTOP%" "QGIS Desktop @version@ with GRASS !gv! (Nightly)" "" "" "" "" "~$folder.mydocuments$"
if not %OSGEO4W_MENU_LINKS%==0 nircmd shortcut "%OSGEO4W_ROOT%\bin\@package@-bin-g!v!.exe" "%OSGEO4W_STARTMENU%" "QGIS Desktop @version@ with GRASS !gv! (Nightly)" "" "" "" "" "~$folder.mydocuments$"
if not %OSGEO4W_DESKTOP_LINKS%==0 nircmd shortcut "%OSGEO4W_ROOT%\bin\@package@-bin-g!v!.exe" "%OSGEO4W_DESKTOP%" "QGIS Desktop @version@ with GRASS !gv! (Nightly)" "" "" "" "" "~$folder.mydocuments$"
)
)

if not %OSGEO4W_MENU_LINKS%==0 nircmd shortcut "%OSGEO4W_ROOT%\bin\nircmd.exe" "%OSGEO4W_STARTMENU%" "Qt Designer with QGIS @version@ custom widgets (Nightly)" "exec hide """%OSGEO4W_ROOT%\bin\@package@-designer.bat"" "%OSGEO4W_ROOT%\apps\@package@\icons\QGIS.ico" "" "" "~$folder.mydocuments$"
Expand All @@ -34,6 +43,7 @@ if not exist "%O4W_ROOT%\apps\qgis\bin\qgis.reg" nircmd elevate "%WINDIR%\regedi

call "%OSGEO4W_ROOT%\bin\o4w_env.bat"
call qt5_env.bat
call gdal-dev-env.bat
path %PATH%;%OSGEO4W_ROOT%\apps\@package@\bin
set QGIS_PREFIX_PATH=%OSGEO4W_ROOT:\=/%/apps/@package@
"%OSGEO4W_ROOT%\apps\@package@\crssync"
Expand Down
4 changes: 2 additions & 2 deletions src/gui/CMakeLists.txt
Expand Up @@ -1032,13 +1032,13 @@ INCLUDE_DIRECTORIES(
${CMAKE_BINARY_DIR}/src/native
)
INCLUDE_DIRECTORIES(SYSTEM
${PROJ_INCLUDE_DIR}
${GDAL_INCLUDE_DIR}
${QCA_INCLUDE_DIR}
${QTKEYCHAIN_INCLUDE_DIR}
${QWT_INCLUDE_DIR}
${SQLITE3_INCLUDE_DIR}
${QSCINTILLA_INCLUDE_DIR}
${GDAL_INCLUDE_DIR}
${PROJ_INCLUDE_DIR}
)

# disable deprecation warnings for classes re-exporting deprecated methods
Expand Down
6 changes: 3 additions & 3 deletions src/gui/qgsdatumtransformdialog.cpp
Expand Up @@ -175,7 +175,7 @@ QgsDatumTransformDialog::QgsDatumTransformDialog( const QgsCoordinateReferenceSy
// proj 6 doesn't provide deprecated operations
mHideDeprecatedCheckBox->setVisible( false );

#if PROJ_VERSION_MAJOR>6 or PROJ_VERSION_MINOR>=2
#if PROJ_VERSION_MAJOR>6 || PROJ_VERSION_MINOR>=2
mShowSupersededCheckBox->setVisible( true );
#else
mShowSupersededCheckBox->setVisible( false );
Expand Down Expand Up @@ -295,7 +295,7 @@ void QgsDatumTransformDialog::load( QPair<int, int> selectedDatumTransforms, con
QStringList areasOfUse;
QStringList authorityCodes;

#if PROJ_VERSION_MAJOR > 6 or PROJ_VERSION_MINOR >= 2
#if PROJ_VERSION_MAJOR > 6 || PROJ_VERSION_MINOR >= 2
QStringList opText;
for ( const QgsDatumTransform::SingleOperationDetails &singleOpDetails : transform.operationDetails )
{
Expand Down Expand Up @@ -359,7 +359,7 @@ void QgsDatumTransformDialog::load( QPair<int, int> selectedDatumTransforms, con
if ( !id.isEmpty() && !authorityCodes.contains( id ) )
authorityCodes << id;

#if PROJ_VERSION_MAJOR > 6 or PROJ_VERSION_MINOR >= 2
#if PROJ_VERSION_MAJOR > 6 || PROJ_VERSION_MINOR >= 2
const QColor disabled = palette().color( QPalette::Disabled, QPalette::Text );
const QColor active = palette().color( QPalette::Active, QPalette::Text );

Expand Down
3 changes: 3 additions & 0 deletions src/plugins/grass/qgsgrassnewmapset.cpp
Expand Up @@ -46,6 +46,9 @@ extern "C"
#if defined(_MSC_VER) && defined(M_PI_4)
#undef M_PI_4 //avoid redefinition warning
#endif
#if defined(PROJ_VERSION_MAJOR) && PROJ_VERSION_MAJOR>=6
#define ACCEPT_USE_OF_DEPRECATED_PROJ_API_H
#endif
#include <grass/gprojects.h>
}

Expand Down
2 changes: 1 addition & 1 deletion src/providers/grass/CMakeLists.txt
Expand Up @@ -18,8 +18,8 @@ INCLUDE_DIRECTORIES(
)
INCLUDE_DIRECTORIES (SYSTEM
${GDAL_INCLUDE_DIR}
${GEOS_INCLUDE_DIR}
${PROJ_INCLUDE_DIR}
${GEOS_INCLUDE_DIR}
${POSTGRES_INCLUDE_DIR}
)

Expand Down
3 changes: 3 additions & 0 deletions src/providers/grass/qgis.g.info.c
Expand Up @@ -35,6 +35,9 @@
#if defined(_MSC_VER) && defined(M_PI_4)
#undef M_PI_4 //avoid redefinition warning
#endif
#if defined(PROJ_VERSION_MAJOR) && PROJ_VERSION_MAJOR>=6
#define ACCEPT_USE_OF_DEPRECATED_PROJ_API_H
#endif
#include <grass/gprojects.h>

int main( int argc, char **argv )
Expand Down
3 changes: 3 additions & 0 deletions src/providers/grass/qgsgrass.cpp
Expand Up @@ -66,6 +66,9 @@ extern "C"
#if defined(_MSC_VER) && defined(M_PI_4)
#undef M_PI_4 //avoid redefinition warning
#endif
#if defined(PROJ_VERSION_MAJOR) && PROJ_VERSION_MAJOR>=6
#define ACCEPT_USE_OF_DEPRECATED_PROJ_API_H
#endif
#include <grass/gprojects.h>
#include <grass/vector.h>
#include <grass/raster.h>
Expand Down
3 changes: 3 additions & 0 deletions src/providers/grass/qgsgrassprovider.cpp
Expand Up @@ -60,6 +60,9 @@ extern "C"
#if defined(_MSC_VER) && defined(M_PI_4)
#undef M_PI_4 //avoid redefinition warning
#endif
#if defined(PROJ_VERSION_MAJOR) && PROJ_VERSION_MAJOR>=6
#define ACCEPT_USE_OF_DEPRECATED_PROJ_API_H
#endif
#include <grass/gprojects.h>
#include <grass/gis.h>
#include <grass/dbmi.h>
Expand Down
3 changes: 3 additions & 0 deletions src/providers/grass/qgsgrassvector.cpp
Expand Up @@ -31,6 +31,9 @@ extern "C"
#if defined(_MSC_VER) && defined(M_PI_4)
#undef M_PI_4 //avoid redefinition warning
#endif
#if defined(PROJ_VERSION_MAJOR) && PROJ_VERSION_MAJOR>=6
#define ACCEPT_USE_OF_DEPRECATED_PROJ_API_H
#endif
#include <grass/gprojects.h>
#include <grass/vector.h>
#include <grass/raster.h>
Expand Down
3 changes: 3 additions & 0 deletions src/providers/grass/qgsgrassvectormap.cpp
Expand Up @@ -35,6 +35,9 @@ extern "C"
#if defined(_MSC_VER) && defined(M_PI_4)
#undef M_PI_4 //avoid redefinition warning
#endif
#if defined(PROJ_VERSION_MAJOR) && PROJ_VERSION_MAJOR>=6
#define ACCEPT_USE_OF_DEPRECATED_PROJ_API_H
#endif
#include <grass/gprojects.h>
#include <grass/gis.h>
#include <grass/dbmi.h>
Expand Down
3 changes: 3 additions & 0 deletions src/providers/grass/qgsgrassvectormaplayer.cpp
Expand Up @@ -30,6 +30,9 @@ extern "C"
#if defined(_MSC_VER) && defined(M_PI_4)
#undef M_PI_4 //avoid redefinition warning
#endif
#if defined(PROJ_VERSION_MAJOR) && PROJ_VERSION_MAJOR>=6
#define ACCEPT_USE_OF_DEPRECATED_PROJ_API_H
#endif
#include <grass/gprojects.h>
#include <grass/gis.h>
#include <grass/dbmi.h>
Expand Down
3 changes: 3 additions & 0 deletions src/providers/grass/qgsgrassvectormaplayer.h
Expand Up @@ -32,6 +32,9 @@ extern "C"
#if defined(_MSC_VER) && defined(M_PI_4)
#undef M_PI_4 //avoid redefinition warning
#endif
#if defined(PROJ_VERSION_MAJOR) && PROJ_VERSION_MAJOR>=6
#define ACCEPT_USE_OF_DEPRECATED_PROJ_API_H
#endif
#include <grass/gprojects.h>
#include <grass/gis.h>
#include <grass/dbmi.h>
Expand Down
4 changes: 2 additions & 2 deletions src/quickgui/CMakeLists.txt
Expand Up @@ -73,11 +73,11 @@ INCLUDE_DIRECTORIES(
)

INCLUDE_DIRECTORIES(SYSTEM
${GDAL_INCLUDE_DIR}
${PROJ_INCLUDE_DIR}
${LIBZIP_INCLUDE_DIRS}
${SPATIALINDEX_INCLUDE_DIR}
${PROJ_INCLUDE_DIR}
${GEOS_INCLUDE_DIR}
${GDAL_INCLUDE_DIR}
${EXPAT_INCLUDE_DIR}
${SQLITE3_INCLUDE_DIR}
${SPATIALITE_INCLUDE_DIR}
Expand Down
4 changes: 2 additions & 2 deletions src/quickgui/plugin/CMakeLists.txt
Expand Up @@ -62,11 +62,11 @@ INCLUDE_DIRECTORIES(
)

INCLUDE_DIRECTORIES(SYSTEM
${GDAL_INCLUDE_DIR}
${PROJ_INCLUDE_DIR}
${LIBZIP_INCLUDE_DIRS}
${SPATIALINDEX_INCLUDE_DIR}
${PROJ_INCLUDE_DIR}
${GEOS_INCLUDE_DIR}
${GDAL_INCLUDE_DIR}
${EXPAT_INCLUDE_DIR}
${SQLITE3_INCLUDE_DIR}
${SPATIALITE_INCLUDE_DIR}
Expand Down
2 changes: 1 addition & 1 deletion tests/src/auth/CMakeLists.txt
Expand Up @@ -22,9 +22,9 @@ INCLUDE_DIRECTORIES(
)

INCLUDE_DIRECTORIES(SYSTEM
${QT_INCLUDE_DIR}
${GDAL_INCLUDE_DIR}
${PROJ_INCLUDE_DIR}
${QT_INCLUDE_DIR}
${GEOS_INCLUDE_DIR}
${QCA_INCLUDE_DIR}
${SQLITE3_INCLUDE_DIR}
Expand Down
4 changes: 2 additions & 2 deletions tests/src/core/CMakeLists.txt
Expand Up @@ -32,10 +32,10 @@ INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_BINARY_DIR}/src/core
)
INCLUDE_DIRECTORIES(SYSTEM
${QT_INCLUDE_DIR}
${GDAL_INCLUDE_DIR}
${PROJ_INCLUDE_DIR}
${GEOS_INCLUDE_DIR}
${QT_INCLUDE_DIR}
${GDAL_INCLUDE_DIR}
${QCA_INCLUDE_DIR}
${QTKEYCHAIN_INCLUDE_DIR}
${SQLITE3_INCLUDE_DIR}
Expand Down
4 changes: 2 additions & 2 deletions tests/src/providers/grass/CMakeLists.txt
Expand Up @@ -3,9 +3,9 @@ INCLUDE_DIRECTORIES(
)
INCLUDE_DIRECTORIES(SYSTEM
${GDAL_INCLUDE_DIR}
${GEOS_INCLUDE_DIR}
${POSTGRES_INCLUDE_DIR}
${PROJ_INCLUDE_DIR}
${POSTGRES_INCLUDE_DIR}
${GEOS_INCLUDE_DIR}
)


Expand Down
4 changes: 2 additions & 2 deletions tests/src/quickgui/CMakeLists.txt
Expand Up @@ -36,10 +36,10 @@ INCLUDE_DIRECTORIES(
)

INCLUDE_DIRECTORIES(SYSTEM
${LIBZIP_INCLUDE_DIRS}
${SPATIALINDEX_INCLUDE_DIR}
${PROJ_INCLUDE_DIR}
${GEOS_INCLUDE_DIR}
${LIBZIP_INCLUDE_DIRS}
${SPATIALINDEX_INCLUDE_DIR}
${GDAL_INCLUDE_DIR}
${EXPAT_INCLUDE_DIR}
${SQLITE3_INCLUDE_DIR}
Expand Down
4 changes: 2 additions & 2 deletions tests/src/quickgui/app/CMakeLists.txt
Expand Up @@ -40,11 +40,11 @@ INCLUDE_DIRECTORIES(
)

INCLUDE_DIRECTORIES(SYSTEM
${GDAL_INCLUDE_DIR}
${PROJ_INCLUDE_DIR}
${LIBZIP_INCLUDE_DIRS}
${SPATIALINDEX_INCLUDE_DIR}
${PROJ_INCLUDE_DIR}
${GEOS_INCLUDE_DIR}
${GDAL_INCLUDE_DIR}
${EXPAT_INCLUDE_DIR}
${SQLITE3_INCLUDE_DIR}
${SPATIALITE_INCLUDE_DIR}
Expand Down
2 changes: 2 additions & 0 deletions tests/src/server/CMakeLists.txt
@@ -1,4 +1,6 @@
IF(NOT MSVC)
ADD_SUBDIRECTORY(wms)
ENDIF(NOT MSVC)

INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
Expand Down

1 comment on commit bc1aea6

@nyalldawson
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @jef-n!

I'll look into those grass deprecated API use. (I keep forgetting about that provider... Which unfortunately seems more or less abandoned these days)

Please sign in to comment.