X-Git-Url: https://git.street.me.uk/andy/viking.git/blobdiff_plain/7097c6b4145f011bb927fcf161126c1ed61d596a..02468bf10a1db541843fb089135585ea4fdcd4e2:/win32/prepare.bat diff --git a/win32/prepare.bat b/win32/prepare.bat index 81602e0f..7c773447 100644 --- a/win32/prepare.bat +++ b/win32/prepare.bat @@ -30,7 +30,7 @@ if not exist "%ProgramFiles%\7-Zip\7z.exe" ( %ZIP_INST% /S if ERRORLEVEL 1 goto Error ) - + echo =+=+= echo Checking mingw... echo =+=+= @@ -73,7 +73,14 @@ set W32API_URL=%MINGW_BASE_URL%/w32api/w32api-4.0.3/%W32API_LZ%/download set ZLIB_LZ=zlib-1.2.8-1-mingw32-dll.tar.lzma set ZLIB_URL=%MINGW_BASE_URL%/zlib/zlib-1.2.8/%ZLIB_LZ%/download set GETTEXT_LZ=gettext-0.18.3.1-1-mingw32-dll.tar.lzma -set GETTEXT_URL=%MINGW_BASE_URL%/gettext/gettext-0.18.3.1-1/%GETTEXT_LZ%/download +set GETTEXT_URL=%MINGW_BASE_URL%/gettext/gettext-0.18.3.1-1/%GETTEXT_LZ%/download + +set GCC-CPP_BIN_LZ=gcc-c++-4.8.1-4-mingw32-bin.tar.lzma +set GCC-CPP_BIN_URL=%MINGW_BASE_URL%/gcc/Version4/gcc-4.8.1-4/%GCC-CPP_BIN_LZ%/download +set GCC-CPP_DEV_LZ=gcc-c++-4.8.1-4-mingw32-dev.tar.lzma +set GCC-CPP_DEV_URL=%MINGW_BASE_URL%/gcc/Version4/gcc-4.8.1-4/%GCC-CPP_DEV_LZ%/download +set GCC-CPP_DLL_LZ=gcc-c++-4.8.1-4-mingw32-dll.tar.lzma +set GCC-CPP_DLL_URL=%MINGW_BASE_URL%/gcc/Version4/gcc-4.8.1-4/%GCC-CPP_DLL_LZ%/download if not exist "%MINGW_BIN%" ( :: Here we download all default components manually in an attempt to get autoinstall to work... @@ -133,6 +140,27 @@ if not exist "%MINGW_BIN%" ( call :Download "%GETTEXT_LZ%" "%GETTEXT_URL%" call :InstallLZMA "%GETTEXT_LZ%" + + REM Seems '+' in the filename screws things up for script function calls :( + REM call :Download "%GCC_CPP_DEV_LZ%" "%GCC_CPP_DEV_URL%" + REM call :InstallLZMA "%GCC_CPP_DEV_LZ%" + + REM call :Download "%GCC_CPP_DLL_LZ%" "%GCC_CPP_DLL_URL%" + REM call :InstallLZMA "%GCC_CPP_DLL_LZ%" + + REM call :Download "%GCC_CPP_BIN_LZ%" "%GCC_CPP_BIN_URL%" + REM call :InstallLZMA "%GCC_CPP_BIN_LZ%" + + REM Do it every time... + wget http://sourceforge.net/projects/mingw/files/MinGW/Base/gcc/Version4/gcc-4.8.1-4/gcc-c++-4.8.1-4-mingw32-bin.tar.lzma/download + wget http://sourceforge.net/projects/mingw/files/MinGW/Base/gcc/Version4/gcc-4.8.1-4/gcc-c++-4.8.1-4-mingw32-dev.tar.lzma/download + wget http://sourceforge.net/projects/mingw/files/MinGW/Base/gcc/Version4/gcc-4.8.1-4/gcc-c++-4.8.1-4-mingw32-dll.tar.lzma/download + 7z e gcc-c++-4.8.1-4-mingw32-bin.tar.lzma + 7z e gcc-c++-4.8.1-4-mingw32-dev.tar.lzma + 7z e gcc-c++-4.8.1-4-mingw32-dll.tar.lzma + 7z x gcc-c++-4.8.1-4-mingw32-bin.tar -o"%MinGW%" -y + 7z x gcc-c++-4.8.1-4-mingw32-dev.tar -o"%MinGW%" -y + 7z x gcc-c++-4.8.1-4-mingw32-dll.tar -o"%MinGW%" -y ) echo =+=+= @@ -358,6 +386,26 @@ if not exist "%MINGW_BIN%\sqlite3.dll" ( if ERRORLEVEL 1 goto Error ) + +echo =+=+= +echo Mapnik... +echo =+=+= +set MAPNIK_ZIP=mapnik-win-sdk-v2.2.0.zip +set MAPNIK_URL=http://mapnik.s3.amazonaws.com/dist/v2.2.0/%MAPNIK_ZIP% +if not exist "%MINGW_BIN%\mapnik.dll" ( + call :Download "%MAPNIK_ZIP%" "%MAPNIK_URL%" + 7z x %MAPNIK_ZIP% + if ERRORLEVEL 1 goto Error + copy /Y mapnik-v2.2.0\include\* "%MinGW%\include" + copy /Y mapnik-v2.2.0\lib\*.lib "%MinGW%\lib\" + copy /Y mapnik-v2.2.0\lib\*.dll "%MinGW%\bin" + copy /Y mapnik-v2.2.0\lib\mapnik\input "\" + rmdir /S /Q mapnik-v2.2.0 + REM Mapnik 2.2.0 seems to ship with a unicode copy which is missing ptypes.h + REM Copy headers from a known good version... + REM See fix in calling shell script when using wine +) + :: :: Ideally building the code on Windows shouldn't need Doc Utils or the Help processor stuff :: But ATM it's too hard to avoid. @@ -415,19 +463,38 @@ if not exist "%MINGW_BIN%\iconv.dll" ( rmdir /Q /S %ICONV% ) + +echo =+=+= +echo Checking libzip... +echo =+=+= +REM Originally planned to extract from an existing MINGW32 RPM, +REM which worked OK to compile+link but Viking did not run up after install +REM I think the dll is linked to a different gcc runtime +set LIBZIP=mingw32-libzip-1.0.1-3 +set LIBZIP_RPM=mingw32-libzip-1.0.1-3.fc24.noarch.rpm +if not exist "%MINGW_BIN%\libzip.dll" ( + echo MANUALLY NEED TO ACQUIRE AND INSTALL LIBZIP + EXIT +REM Instead build libzip from source +REM http://www.nih.at/libzip/ - download latest source (31d625ae55b5 on 16/11/15) +REM Use CMake (v3.4.0) on Windows +REM wine cmd +REM set CC=gcc +REM set PATH=%PATH%;%SystemDrive%\Mingw\bin +REM cmake -DCMAKE_C_COMPILER:FILEPATH='gcc' -G "MSYS Makefiles" . +REM set PATH=%PATH%;%SystemDrive%\msys\1.0\bin +REM make +REM (needed to fix zipint.h to include limits.h for a successful compile) +REM Copy libzip.dll.a,libzip.dll,zip.h+zipconf.h to appropraite places. +) + :: Note GPSBabel can not be directly downloaded via wget :: ATM get it manually from here: :: http://www.gpsbabel.org/download.html -set GPSBABEL_INST=GPSBabel-1.4.4-Setup.exe -if not exist "%ProgramFiles%\GPSBabel" ( - echo Installing GPSBabel... - if exist %GPSBABEL_INST% ( - %GPSBABEL_INST% /silent - if ERRORLEVEL 1 goto Error - ) else ( - echo Required %GPSBABEL_INST% not found. Exitting - exit /b - ) +set GPSBABEL_INST=GPSBabel-1.5.2-Setup.exe +if not exist %GPSBABEL_INST% ( + echo Required %GPSBABEL_INST% not found. Exitting + exit /b ) echo =+=+=