Skip to content

Commit

Permalink
fix downloading libraries && add remove package && fix powershell scr…
Browse files Browse the repository at this point in the history
…ipt depends in tests
  • Loading branch information
Egor00f committed Nov 17, 2024
1 parent 80198a0 commit 743ad5a
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 11 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Install modules
run: |
Set-PSRepository PSGallery -InstallationPolicy Trusted
Install-Module -Name 7Zip4PowerShell
- name: Run script
run: ${{ github.workspace }}\install.ps1

Expand Down
2 changes: 2 additions & 0 deletions chocolatey/tools/chocolateyInstall.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@ Install-ChocolateyPackage "$packageName" -validExitCodes $validExitCodes
$INSTALL_PATH = Read-Host 'Path to install toolchain(Enter - default)'

.\install.ps1 -InstallPath $INSTALL_PATH

$env:KOS32GCCPATH = $INSTALL_PATH
2 changes: 2 additions & 0 deletions chocolatey/tools/chocolateyUninstall.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

rm $env:KOS32GCCPATH -r -f
27 changes: 16 additions & 11 deletions install.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#Requires -RunAsAdministrator
#Requires -RunAsAdministrator

param(
[string]$InstallPath='C:\MinGW\msys\1.0\home\autobuild\tools'
Expand All @@ -11,15 +11,13 @@ else
Install-Module -Name 7Zip4PowerShell
}

$URL_TO_LIBS = "http://builds.kolibrios.org/en_US/data/contrib/sdk/lib"

$LIST_OF_LIBS = 'libdll.a', 'libfreetype.a', 'libc.dll.a', 'libSDLn.a', 'libSDL_mixer.a', 'libcurses.a', 'libz.dll.a', 'libogg.a', 'libvorbis.a', 'libopenjpeg.a', 'libopenjpeg.a', 'libsqlite3.dll.a', 'libjbig2dec.a'

$LIBS_PATH = '$InstallPath\win32\mingw32\lib\'
$LIBS_URL = 'http://builds.kolibrios.org/en_US/data/contrib/sdk/lib/'


Write-Progress -Activity 'Installing toolchain' -Status 'toolchain' -PercentComplete 0 -CurrentOperation 'Create the $InstallPath folder'

mkdir $InstallPath
mkdir $InstallPath -Force


Write-Progress -Activity 'Installing toolchain' -Status 'toolchain' -PercentComplete 1 -CurrentOperation 'Download the kos32-gcc toolchain'
Expand All @@ -43,11 +41,18 @@ Expand-7Zip -ArchiveFileName $InstallPath\win32\mingw32\sdk-28-10-16.7z -TargetP



for (($i = 0); $i -lt $LIST_OF_LIBS.count; $i++)
{
Write-Progress -Activity 'Installing toolchain' -Status 'Installing libraries' -PercentComplete 50+(50 * ($i / $LIST_OF_LIBS.count) ) -CurrentOperation = 'download $($LIST_OF_LIBS[$i])'
Write-Progress -Activity 'Installing toolchain' -Status 'Installing libraries' -PercentComplete 60 -CurrentOperation "Download libraries"


$LINK = "$URL_TO_LIBS/$LIST_OF_LIBS[$i]"
$response = Invoke-WebRequest -Uri $LIBS_URL -Method GET

Invoke-WebRequest $LINK -OutFile $InstallPath\win32\mingw32\lib\$LIST_OF_LIBS[$i]
$files = @( $response.Content -split [environment]::NewLine | ? { $_ -like '*tageswerte*.zip*' } | % { $_ -replace '^(.*>)(tages.*\.zip)<.*', '$2' } )

foreach( $file in $files ) {

Invoke-WebRequest -Uri ($LIBS_URL + $file) -Method GET -OutFile ($LIBS_PATH + $file)
}

Write-Progress -Activity 'Installing toolchain' -Status 'Done!' -PercentComplete 99 -CurrentOperation "end"

$env:Path += ';$InstallPath\win32\bin'

0 comments on commit 743ad5a

Please sign in to comment.