Skip to content
Permalink
Browse files

osgeo4w: detect python version in package.cmd

(cherry picked from commit faeb160)
  • Loading branch information
jef-n committed Oct 11, 2018
1 parent 3ce743e commit 0de984d7f93ed26f96feb411e8606e09499b3233
Showing with 12 additions and 14 deletions.
  1. +6 −7 ms-windows/osgeo4w/package-nightly.cmd
  2. +6 −7 ms-windows/osgeo4w/package.cmd
@@ -48,7 +48,6 @@ if not exist "%SETUPAPI_LIBRARY%" set SETUPAPI_LIBRARY=%PF86%\Windows Kits\8.0\L
if not exist "%SETUPAPI_LIBRARY%" (echo SETUPAPI_LIBRARY not found & goto error)

set CMAKE_OPT=^
-D SIP_BINARY_PATH=%O4W_ROOT%/apps/Python36/sip.exe ^
-D CMAKE_CXX_FLAGS_RELWITHDEBINFO="/MD /ZI /MP /Od /D NDEBUG" ^
-D CMAKE_PDB_OUTPUT_DIRECTORY_RELWITHDEBINFO=%BUILDDIR%\apps\%PACKAGENAME%\pdb ^
-D SPATIALINDEX_LIBRARY=%O4W_ROOT%/lib/spatialindex_i.lib
@@ -62,7 +61,6 @@ if not exist "%SETUPAPI_LIBRARY%" (echo SETUPAPI_LIBRARY not found & goto error)

set CMAKE_OPT=^
-D SPATIALINDEX_LIBRARY=%O4W_ROOT%/lib/spatialindex-64.lib ^
-D SIP_BINARY_PATH=%O4W_ROOT%/apps/Python36/sip.exe ^
-D CMAKE_CXX_FLAGS_RELWITHDEBINFO="/MD /Zi /MP /Od /D NDEBUG" ^
-D CMAKE_PDB_OUTPUT_DIRECTORY_RELWITHDEBINFO=%BUILDDIR%\apps\%PACKAGENAME%\pdb ^
-D SETUPAPI_LIBRARY="%SETUPAPI_LIBRARY%" ^
@@ -131,6 +129,8 @@ if errorlevel 1 goto error

if "%CMAKEGEN%"=="" set CMAKEGEN=Ninja

for %%i in (%PYTHONHOME%) do set PYVER=%%~ni

cmake -G "%CMAKEGEN%" ^
-D CMAKE_CXX_COMPILER="%CMAKE_COMPILER_PATH:\=/%/cl.exe" ^
-D CMAKE_C_COMPILER="%CMAKE_COMPILER_PATH:\=/%/cl.exe" ^
@@ -154,11 +154,10 @@ cmake -G "%CMAKEGEN%" ^
-D SQLITE3_LIBRARY=%O4W_ROOT%/lib/sqlite3_i.lib ^
-D SPATIALITE_LIBRARY=%O4W_ROOT%/lib/spatialite_i.lib ^
-D PYTHON_EXECUTABLE=%O4W_ROOT%/bin/python3.exe ^
-D PYTHON_INCLUDE_PATH=%O4W_ROOT%/apps/Python36/include ^
-D PYTHON_LIBRARY=%O4W_ROOT%/apps/Python36/libs/python36.lib ^
-D QT_BINARY_DIR=%O4W_ROOT%/bin ^
-D SIP_BINARY_PATH=%PYTHONHOME:\=/%/sip.exe ^
-D PYTHON_INCLUDE_PATH=%PYTHONHOME:\=/%/include ^
-D PYTHON_LIBRARY=%PYTHONHOME:\=/%/libs/%PYVER%.lib ^
-D QT_LIBRARY_DIR=%O4W_ROOT%/lib ^
-D QT_HEADERS_DIR=%O4W_ROOT%/apps/qt5/include ^
-D CMAKE_INSTALL_PREFIX=%O4W_ROOT%/apps/%PACKAGENAME% ^
-D FCGI_INCLUDE_DIR=%O4W_ROOT%/include ^
-D FCGI_LIBRARY=%O4W_ROOT%/lib/libfcgi.lib ^
@@ -278,7 +277,7 @@ move %OSGEO4W_ROOT%\apps\qt5\plugins\designer\qgis_customwidgets.dll %PKGDIR%\qt
if errorlevel 1 (echo move of customwidgets failed & goto error)

if not exist %PKGDIR%\python\PyQt5\uic\widget-plugins mkdir %PKGDIR%\python\PyQt5\uic\widget-plugins
move %OSGEO4W_ROOT%\apps\Python36\Lib\site-packages\PyQt5\uic\widget-plugins\qgis_customwidgets.py %PKGDIR%\python\PyQt5\uic\widget-plugins
move %PYTHONHOME%\Lib\site-packages\PyQt5\uic\widget-plugins\qgis_customwidgets.py %PKGDIR%\python\PyQt5\uic\widget-plugins
if errorlevel 1 (echo move of customwidgets binding failed & goto error)

if not exist %ARCH%\release\qgis\%PACKAGENAME% mkdir %ARCH%\release\qgis\%PACKAGENAME%
@@ -48,7 +48,6 @@ if not exist "%SETUPAPI_LIBRARY%" set SETUPAPI_LIBRARY=%PF86%\Windows Kits\8.0\L
if not exist "%SETUPAPI_LIBRARY%" (echo SETUPAPI_LIBRARY not found & goto error)

set CMAKE_OPT=^
-D SIP_BINARY_PATH=%O4W_ROOT%/apps/Python36/sip.exe ^
-D SPATIALINDEX_LIBRARY=%O4W_ROOT%/lib/spatialindex_i.lib
goto cmake

@@ -60,7 +59,6 @@ if not exist "%SETUPAPI_LIBRARY%" (echo SETUPAPI_LIBRARY not found & goto error)

set CMAKE_OPT=^
-D SPATIALINDEX_LIBRARY=%O4W_ROOT%/lib/spatialindex-64.lib ^
-D SIP_BINARY_PATH=%O4W_ROOT%/apps/Python36/sip.exe ^
-D SETUPAPI_LIBRARY="%SETUPAPI_LIBRARY%" ^
-D CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS=TRUE

@@ -133,6 +131,8 @@ if errorlevel 1 goto error

if "%CMAKEGEN%"=="" set CMAKEGEN=Ninja

for %%i in (%PYTHONHOME%) do set PYVER=%%~ni

cmake -G "%CMAKEGEN%" ^
-D CMAKE_CXX_COMPILER="%CMAKE_COMPILER_PATH:\=/%/cl.exe" ^
-D CMAKE_C_COMPILER="%CMAKE_COMPILER_PATH:\=/%/cl.exe" ^
@@ -159,11 +159,10 @@ cmake -G "%CMAKEGEN%" ^
-D SQLITE3_LIBRARY=%O4W_ROOT%/lib/sqlite3_i.lib ^
-D SPATIALITE_LIBRARY=%O4W_ROOT%/lib/spatialite_i.lib ^
-D PYTHON_EXECUTABLE=%O4W_ROOT%/bin/python3.exe ^
-D PYTHON_INCLUDE_PATH=%O4W_ROOT%/apps/Python36/include ^
-D PYTHON_LIBRARY=%O4W_ROOT%/apps/Python36/libs/python36.lib ^
-D QT_BINARY_DIR=%O4W_ROOT%/bin ^
-D SIP_BINARY_PATH=%PYTHONHOME:\=/%/sip.exe ^
-D PYTHON_INCLUDE_PATH=%PYTHONHOME:\=/%/include ^
-D PYTHON_LIBRARY=%PYTHONHOME:\=/%/libs/%PYVER%.lib ^
-D QT_LIBRARY_DIR=%O4W_ROOT%/lib ^
-D QT_HEADERS_DIR=%O4W_ROOT%/apps/qt5/include ^
-D CMAKE_INSTALL_PREFIX=%O4W_ROOT%/apps/%PACKAGENAME% ^
-D FCGI_INCLUDE_DIR=%O4W_ROOT%/include ^
-D FCGI_LIBRARY=%O4W_ROOT%/lib/libfcgi.lib ^
@@ -366,7 +365,7 @@ move %OSGEO4W_ROOT%\apps\qt5\plugins\designer\qgis_customwidgets.dll %PKGDIR%\qt
if errorlevel 1 (echo move of customwidgets failed & goto error)

if not exist %PKGDIR%\python\PyQt5\uic\widget-plugins mkdir %PKGDIR%\python\PyQt5\uic\widget-plugins
move %OSGEO4W_ROOT%\apps\Python36\Lib\site-packages\PyQt5\uic\widget-plugins\qgis_customwidgets.py %PKGDIR%\python\PyQt5\uic\widget-plugins
move %PYTHONHOME%\Lib\site-packages\PyQt5\uic\widget-plugins\qgis_customwidgets.py %PKGDIR%\python\PyQt5\uic\widget-plugins
if errorlevel 1 (echo move of customwidgets binding failed & goto error)

if not exist %ARCH%\release\qgis\%PACKAGENAME% mkdir %ARCH%\release\qgis\%PACKAGENAME%

0 comments on commit 0de984d

Please sign in to comment.
You can’t perform that action at this time.