Skip to content

Commit

Permalink
[ci] use wget for file download on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
vovkos committed Aug 1, 2024
1 parent ced5ca1 commit a65b2b2
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 35 deletions.
72 changes: 38 additions & 34 deletions ci/github-actions/install-windows.bat
Original file line number Diff line number Diff line change
Expand Up @@ -16,82 +16,86 @@ set DOWNLOAD_DIR_CMAKE=%DOWNLOAD_DIR:\=/%

:: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

:: wget

echo Installing wget...

choco install wget --no-progress
if %errorlevel% neq 0 exit /b %errorlevel%

:: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

:: Ragel

echo Downloading Ragel %RAGEL_DOWNLOAD_URL%...
echo Downloading %RAGEL_DOWNLOAD_URL%...

mkdir %DOWNLOAD_DIR%
powershell "Invoke-WebRequest -Uri %RAGEL_DOWNLOAD_URL% -OutFile %DOWNLOAD_DIR%\ragel.exe"
if %errorlevel% neq 0 eit /b %errorlevel%
wget -nv %RAGEL_DOWNLOAD_URL% -O %DOWNLOAD_DIR%\ragel.exe
if %errorlevel% neq 0 exit /b %errorlevel%

echo set (RAGEL_EXE %DOWNLOAD_DIR_CMAKE%/ragel.exe) >> paths.cmake
echo set(RAGEL_EXE %DOWNLOAD_DIR_CMAKE%/ragel.exe) >> paths.cmake

:: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

:: Lua (CMake-based)

echo Downloading Lua %LUA_DOWNLOAD_URL%...
echo Downloading %LUA_DOWNLOAD_URL%...

mkdir %DOWNLOAD_DIR%\lua
powershell "Invoke-WebRequest -Uri %LUA_DOWNLOAD_URL% -OutFile %DOWNLOAD_DIR%\lua\lua.zip"
if %errorlevel% neq 0 eit /b %errorlevel%
wget -nv %LUA_DOWNLOAD_URL% -O %DOWNLOAD_DIR%\lua\lua.zip
if %errorlevel% neq 0 exit /b %errorlevel%

7z x -y %DOWNLOAD_DIR%\lua\lua.zip
if %errorlevel% neq 0 eit /b %errorlevel%
if %errorlevel% neq 0 exit /b %errorlevel%

ren Lua-%LUA_VERSION% lua
if %errorlevel% neq 0 eit /b %errorlevel%
if %errorlevel% neq 0 exit /b %errorlevel%

:: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

:: OpenSSL

echo Installing OpenSSL...
echo Installing OpenSSL %OPENSSL_VERSION%...

choco install openssl --version=1.1.1.2000 --no-progress -- %CHOCO_PLATFORM%
if %errorlevel% neq 0 eit /b %errorlevel%
choco install openssl --version=%OPENSSL_VERSION% --no-progress -- %CHOCO_PLATFORM%
if %errorlevel% neq 0 exit /b %errorlevel%

set OPENSSL_ROOT_DIR=C:/Program Files%PROGRAM_FILES_DIR_SUFFIX%/OpenSSL%OPENSSL_DIR_SUFFIX%

echo set (OPENSSL_INC_DIR "%OPENSSL_ROOT_DIR%/include") >> paths.cmake
echo set (OPENSSL_LIB_DIR "%OPENSSL_ROOT_DIR%/lib") >> paths.cmake
echo set (OPENSSL_DLL_DIR "%OPENSSL_ROOT_DIR%/bin") >> paths.cmake
echo set (OPENSSL_CRYPTO_LIB_NAME libcrypto) >> paths.cmake
echo set (OPENSSL_CRYPTO_DLL_NAME libcrypto%OPENSSL_DLL_SUFFIX%) >> paths.cmake
echo set (OPENSSL_SSL_LIB_NAME libssl) >> paths.cmake
echo set (OPENSSL_SSL_DLL_NAME libssl%OPENSSL_DLL_SUFFIX%) >> paths.cmake
echo set(OPENSSL_INC_DIR "%OPENSSL_ROOT_DIR%/include") >> paths.cmake
echo set(OPENSSL_LIB_DIR "%OPENSSL_ROOT_DIR%/lib") >> paths.cmake
echo set(OPENSSL_DLL_DIR "%OPENSSL_ROOT_DIR%/bin") >> paths.cmake
echo set(OPENSSL_CRYPTO_LIB_NAME libcrypto) >> paths.cmake
echo set(OPENSSL_CRYPTO_DLL_NAME libcrypto%OPENSSL_DLL_SUFFIX%) >> paths.cmake
echo set(OPENSSL_SSL_LIB_NAME libssl) >> paths.cmake
echo set(OPENSSL_SSL_DLL_NAME libssl%OPENSSL_DLL_SUFFIX%) >> paths.cmake

:: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

:: LLVM

echo Downloading LLVM %LLVM_DOWNLOAD_URL%...

powershell "Invoke-WebRequest -Uri %LLVM_DOWNLOAD_URL% -OutFile %DOWNLOAD_DIR%\%LLVM_DOWNLOAD_FILE%"
if %errorlevel% neq 0 eit /b %errorlevel%
echo Downloading %LLVM_DOWNLOAD_URL%...

dir "%DOWNLOAD_DIR%\%LLVM_DOWNLOAD_FILE%"

echo Extracting %DOWNLOAD_DIR%\%LLVM_DOWNLOAD_FILE%...
wget -nv %LLVM_DOWNLOAD_URL% -O %DOWNLOAD_DIR%\%LLVM_DOWNLOAD_FILE%
if %errorlevel% neq 0 exit /b %errorlevel%

7z x -y %DOWNLOAD_DIR%\%LLVM_DOWNLOAD_FILE% -o%DOWNLOAD_DIR%
if %errorlevel% neq 0 eit /b %errorlevel%

echo Done extracting
if %errorlevel% neq 0 exit /b %errorlevel%

ren %DOWNLOAD_DIR%\%LLVM_RELEASE_NAME% llvm
if %errorlevel% neq 0 exit /b %errorlevel%

perl %COMPARE_VERSIONS_PL% %LLVM_VERSION% 3.5
if %errorlevel% == -1 goto llvm34x

echo set (LLVM_CMAKE_DIR %DOWNLOAD_DIR_CMAKE%/llvm/lib/cmake/llvm) >> paths.cmake
echo set(LLVM_CMAKE_DIR %DOWNLOAD_DIR_CMAKE%/llvm/lib/cmake/llvm) >> paths.cmake
goto :eof

:llvm34x

echo set (LLVM_INC_DIR %DOWNLOAD_DIR_CMAKE%/llvm/include) >> paths.cmake
echo set (LLVM_LIB_DIR %DOWNLOAD_DIR_CMAKE%/llvm/lib) >> paths.cmake
echo set (LLVM_CMAKE_DIR %DOWNLOAD_DIR_CMAKE%/llvm/share/llvm/cmake) >> paths.cmake
echo set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${LLVM_CMAKE_DIR}) >> paths.cmake
echo set(LLVM_INC_DIR %DOWNLOAD_DIR_CMAKE%/llvm/include) >> paths.cmake
echo set(LLVM_LIB_DIR %DOWNLOAD_DIR_CMAKE%/llvm/lib) >> paths.cmake
echo set(LLVM_CMAKE_DIR %DOWNLOAD_DIR_CMAKE%/llvm/share/llvm/cmake) >> paths.cmake
echo set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${LLVM_CMAKE_DIR}) >> paths.cmake

::..............................................................................
4 changes: 3 additions & 1 deletion ci/github-actions/set-env.bat
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ set LLVM_DOWNLOAD_URL=https://github.com/vovkos/llvm-package-windows/releases/do
set LUA_VERSION=5.4.5
set LUA_DOWNLOAD_URL=https://github.com/walterschell/Lua/archive/refs/tags/v%LUA_VERSION%.zip

set OPENSSL_VERSION=1.1.1.2100

set RAGEL_DOWNLOAD_URL=https://github.com/eloraiby/ragel-windows/raw/master/ragel.exe

set CMAKE_CONFIGURE_FLAGS=-G "%CMAKE_GENERATOR%" %CMAKE_OPTIONS%
Expand All @@ -124,7 +126,7 @@ set CMAKE_BUILD_FLAGS= ^
echo ---------------------------------------------------------------------------
echo LLVM_VERSION: %LLVM_VERSION%
echo LLVM_DOWNLOAD_URL: %LLVM_DOWNLOAD_URL%
echo LUA_LIB_NAME: %LUA_LIB_NAME%
echo LUA_DOWNLOAD_URL: %LUA_DOWNLOAD_URL%
echo OPENSSL_VERSION: %OPENSSL_VERSION%
echo RAGEL_DOWNLOAD_URL: %RAGEL_DOWNLOAD_URL%
echo ---------------------------------------------------------------------------

0 comments on commit a65b2b2

Please sign in to comment.