X-Git-Url: https://git.street.me.uk/andy/viking.git/blobdiff_plain/5f12fb6ad83608ba04d591b0ee3f8184eb175b4c..02468bf10a1db541843fb089135585ea4fdcd4e2:/win32/prepare.bat?ds=inline diff --git a/win32/prepare.bat b/win32/prepare.bat index cc5ec60b..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 =+=+= @@ -229,25 +257,20 @@ if not exist "%MINGW_BIN%\xgettext.exe" ( echo =+=+= echo Checking libcurl... echo =+=+= -set CURL_TAR=libcurl-7.14.0_nossl-1sid.tar -set CURL_BZ2=%CURL_TAR%.bz2 +REM Win32 - Generic - http://curl.haxx.se/download.html +set CURL=curl-7.34.0-devel-mingw32 +set CURL_ZIP=%CURL%.zip if not exist "%MINGW_BIN%\libcurl.dll" ( - if not exist %CURL_BZ2% ( - wget http://downloads.sourceforge.net/devpaks/libcurl-7.14.0_nossl-1sid.DevPak?download - move libcurl-7.14.0_nossl-1sid.DevPak %CURL_BZ2% - ) + call :Download %CURL_ZIP% http://curl.haxx.se/gknw.net/7.34.0/dist-w32/%CURL_ZIP% echo Extracting libcurl... - 7z e %CURL_BZ2% - 7z x %CURL_TAR% -o"libcurl" + 7z x -y %CURL_ZIP% -o"libcurl" if ERRORLEVEL 1 goto Error @echo ON - move libcurl\include "%MinGW%\include\curl - copy /Y libcurl\bin\*.* "%MinGW_BIN%" - copy /Y libcurl\lib\*.* "%MinGW%\lib" - copy /Y libcurl\docs\*.* "%MinGW%\doc" - copy /Y COPYING.txt "%MinGW%\COPYING_curl.txt" + xcopy /S /Y libcurl\%CURL%\include\*.* "%MinGW%\include" + xcopy /S /Y libcurl\%CURL%\bin\*.* "%MinGW_BIN%" + xcopy /S /Y libcurl\%CURL%\lib\*.a "%MinGW%\lib" + copy /Y libcurl\%CURL%\COPYING "%MinGW%\COPYING_curl.txt" rmdir /S /Q libcurl - del %CURL_TAR% @echo OFF ) @@ -363,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. @@ -420,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 =+=+=