mirror of
https://github.com/Egor00f/kolibrios-gcc-toolchain.git
synced 2025-09-20 18:00:07 +02:00
Merge pull request #9 from Egor00f/add-chocolatey-package
Add chocolatey package
This commit is contained in:
100
.github/workflows/test.yml
vendored
100
.github/workflows/test.yml
vendored
@@ -1,4 +1,4 @@
|
||||
name: test
|
||||
name: Test
|
||||
|
||||
on:
|
||||
push:
|
||||
@@ -8,10 +8,10 @@ on:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
|
||||
#Test linux install script
|
||||
linux-install:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
@@ -26,8 +26,8 @@ jobs:
|
||||
kos32-gcc -v
|
||||
kos32-g++ -v
|
||||
|
||||
#Test windows install script
|
||||
windows-install:
|
||||
#Test Batch install script
|
||||
batch-install:
|
||||
runs-on: windows-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
@@ -38,11 +38,31 @@ jobs:
|
||||
choco install 7zip
|
||||
|
||||
- name: Run script
|
||||
run: ${{ github.workspace }}/install.bat
|
||||
run: ${{ github.workspace }}\install.bat
|
||||
|
||||
#Test PowerShell install script
|
||||
PowerShell-install:
|
||||
runs-on: windows-latest
|
||||
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
|
||||
|
||||
- name: Test
|
||||
run: |
|
||||
kos32-gcc -v
|
||||
kos32-g++ -v
|
||||
|
||||
#Test Windows Installer
|
||||
build-Installer:
|
||||
runs-on: windows-latest
|
||||
needs: PowerShell-install
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
@@ -58,24 +78,37 @@ jobs:
|
||||
# Upload entire repository
|
||||
path: './build/installer.exe'
|
||||
|
||||
# Test Package
|
||||
package:
|
||||
# Test deb package build
|
||||
deb-package-build:
|
||||
runs-on: ubuntu-latest
|
||||
needs: linux-install
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
cmake -B ${{ github.workspace }}/build
|
||||
cmake --build ${{ github.workspace }}/build --target Package
|
||||
cmake --build ${{ github.workspace }}/build --target deb
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: package
|
||||
name: deb-package
|
||||
# Upload entire repository
|
||||
path: './build/package.deb'
|
||||
|
||||
|
||||
# Test deb package install/remove
|
||||
deb-package-test:
|
||||
runs-on: ubuntu-latest
|
||||
needs: deb-package-build
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
cmake -B ${{ github.workspace }}/build
|
||||
cmake --build ${{ github.workspace }}/build --target deb
|
||||
|
||||
- name: Install package
|
||||
run: echo '/kolibrios-toolchain' | sudo apt install ${{ github.workspace }}/build/package.deb -y
|
||||
|
||||
@@ -94,3 +127,50 @@ jobs:
|
||||
- name: Remove package
|
||||
run: sudo apt remove kos32-gcc
|
||||
|
||||
#Test chocolatey package build
|
||||
chocolatey-package-build:
|
||||
runs-on: windows-latest
|
||||
needs: PowerShell-install
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
cmake -B ${{ github.workspace }}/build
|
||||
cmake --build ${{ github.workspace }}/build --target choco
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: choco-package
|
||||
# Upload entire repository
|
||||
path: './build/choco-package.nupkg'
|
||||
|
||||
# Test chocolatey package install/remove
|
||||
chocolatey-package-test:
|
||||
runs-on: windows-latest
|
||||
needs: chocolatey-package-build
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Install modules
|
||||
run: |
|
||||
Set-PSRepository PSGallery -InstallationPolicy Trusted
|
||||
Install-Module -Name 7Zip4PowerShell
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
cmake -B ${{ github.workspace }}/build
|
||||
cmake --build ${{ github.workspace }}/build --target choco
|
||||
|
||||
- name: Install package
|
||||
run: choco install ${{ github.workspace }}\build\choco-package.nupkg
|
||||
|
||||
- name: Test
|
||||
run: |
|
||||
kos32-gcc -v
|
||||
kos32-g++ -v
|
||||
|
||||
- name: Remove package
|
||||
run: choco uninstall kos32-gcc
|
||||
|
||||
|
3
.gitignore
vendored
3
.gitignore
vendored
@@ -3,3 +3,6 @@ package/DEBIAN/postinst
|
||||
package/DEBIAN/copyright
|
||||
package.deb
|
||||
build/
|
||||
chocolatey/kos32-gcc*.nupkg
|
||||
chocolatey/install.ps1
|
||||
chocolatey/tools/install.ps1
|
||||
|
@@ -7,7 +7,7 @@ project(
|
||||
|
||||
|
||||
add_custom_target(
|
||||
Package
|
||||
deb
|
||||
COMMAND cp -f ${CMAKE_CURRENT_SOURCE_DIR}/install.sh ${CMAKE_CURRENT_SOURCE_DIR}/package/DEBIAN/postinst
|
||||
COMMAND cp -f ${CMAKE_CURRENT_SOURCE_DIR}/LICENSE ${CMAKE_CURRENT_SOURCE_DIR}/package/DEBIAN/copyright
|
||||
COMMAND chmod 775 ${CMAKE_CURRENT_SOURCE_DIR}/package/DEBIAN
|
||||
@@ -18,9 +18,19 @@ add_custom_target(
|
||||
COMMAND chmod 775 ${CMAKE_CURRENT_SOURCE_DIR}/package/DEBIAN/copyright
|
||||
COMMAND dpkg-deb --build ${CMAKE_CURRENT_SOURCE_DIR}/package ${CMAKE_CURRENT_BINARY_DIR}/package.deb
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||
COMMENT "Build deb package"
|
||||
)
|
||||
|
||||
add_custom_target(
|
||||
Installer
|
||||
COMMAND iscc /O"${CMAKE_CURRENT_BINARY_DIR}" ${CMAKE_CURRENT_SOURCE_DIR}/installator.iss
|
||||
COMMENT "Build windows installer"
|
||||
)
|
||||
|
||||
add_custom_target(
|
||||
choco
|
||||
COMMAND cp -f ${CMAKE_CURRENT_SOURCE_DIR}/install.ps1 ${CMAKE_CURRENT_SOURCE_DIR}/chocolatey/tools
|
||||
COMMAND choco pack
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/chocolatey
|
||||
COMMENT "Build chocolatey package"
|
||||
)
|
||||
|
22
chocolatey/kos32-gcc.nuspec
Normal file
22
chocolatey/kos32-gcc.nuspec
Normal file
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
|
||||
<metadata>
|
||||
<id>kos32-gcc</id>
|
||||
<title>KolibriOS gcc toolchain installer</title>
|
||||
<version>0.1.5</version>
|
||||
<authors>Egor00f</authors>
|
||||
<owners>Egor00f</owners>
|
||||
<summary>idk</summary>
|
||||
<description>_KolibriOS gcc toolchain installer. This package installing KolibriOS gcc toolchain by Serge.</description>
|
||||
<packageSourceUrl>https://github.com/Egor00f/kolibrios-gcc-toolchain/</packageSourceUrl>
|
||||
<tags>kolibrios toolchain compiler C/C++</tags>
|
||||
<copyright></copyright>
|
||||
<licenseUrl>https://github.com/Egor00f/kolibrios-gcc-toolchain/blob/main/LICENSE</licenseUrl>
|
||||
<requireLicenseAcceptance>false</requireLicenseAcceptance>
|
||||
<!--<iconUrl>http://cdn.rawgit.com/__CHOCO_PKG_MAINTAINER_REPO__/master/icons/__NAME__.png</iconUrl>-->
|
||||
<releaseNotes></releaseNotes>
|
||||
</metadata>
|
||||
<files>
|
||||
<file src="tools\**" target="tools" />
|
||||
</files>
|
||||
</package>
|
14
chocolatey/tools/chocolateyInstall.ps1
Normal file
14
chocolatey/tools/chocolateyInstall.ps1
Normal file
@@ -0,0 +1,14 @@
|
||||
#NOTE: Please remove any commented lines to tidy up prior to releasing the package, including this one
|
||||
|
||||
$packageName = 'kos32-gcc' # arbitrary name for the package, used in messages
|
||||
|
||||
# main helpers - these have error handling tucked into them already
|
||||
# installer, will assert administrative rights
|
||||
|
||||
|
||||
$INSTALL_PATH = Read-Host 'Path to install toolchain(Enter - default)'
|
||||
|
||||
C:\ProgramData\Chocolatey\lib\kos32-gcc\tools\install.ps1
|
||||
|
||||
Out-File -FilePath C:\ProgramData\Chocolatey\lib\kos32-gcc\install-path -InputObject $INSTALL_PATH
|
||||
|
4
chocolatey/tools/chocolateyUninstall.ps1
Normal file
4
chocolatey/tools/chocolateyUninstall.ps1
Normal file
@@ -0,0 +1,4 @@
|
||||
|
||||
$installPath = Get-Content C:\ProgramData\Chocolatey\lib\kos32-gcc\install-path | Out-String | ConvertFrom-StringData
|
||||
|
||||
Remove-Item -LiteralPath $installPath -Force -Recurse
|
57
install.ps1
Normal file
57
install.ps1
Normal file
@@ -0,0 +1,57 @@
|
||||
#Requires -RunAsAdministrator
|
||||
|
||||
param(
|
||||
[string]$InstallPath='C:\MinGW\msys\1.0\home\autobuild\tools'
|
||||
)
|
||||
|
||||
if (Get-Module -ListAvailable -Name 7Zip4PowerShell)
|
||||
{}
|
||||
else
|
||||
{
|
||||
Install-Module -Name 7Zip4PowerShell
|
||||
}
|
||||
|
||||
$LIBS_PATH = '$InstallPath\win32\mingw32\lib\'
|
||||
$LIBS_URL = 'http://builds.kolibrios.org/en_US/data/contrib/sdk/lib/'
|
||||
|
||||
|
||||
Write-Progress -Activity 'Installing toolchain' -Status 'Installing toolchain' -PercentComplete 0 -CurrentOperation 'Create the $InstallPath folder'
|
||||
|
||||
mkdir $InstallPath -Force
|
||||
|
||||
|
||||
Write-Progress -Activity 'Installing toolchain' -Status 'Installing toolchain' -PercentComplete 1 -CurrentOperation 'Download the kos32-gcc toolchain'
|
||||
|
||||
Invoke-WebRequest http://ftp.kolibrios.org/users/Serge/new/Toolchain/msys-kos32-5.4.0.7z -OutFile $InstallPath\kos32-toolchain.7z
|
||||
|
||||
|
||||
Write-Progress -Activity 'Installing toolchain' -Status 'Installing toolchain' -PercentComplete 20 -CurrentOperation 'Unpacking kos32-gcc toolchain'
|
||||
|
||||
Expand-7Zip -ArchiveFileName $InstallPath\kos32-toolchain.7z -TargetPath $InstallPath
|
||||
|
||||
|
||||
Write-Progress -Activity 'Installing toolchain' -Status 'Installing libraries' -PercentComplete 40 -CurrentOperation 'Downloading libraries'
|
||||
|
||||
Invoke-WebRequest http://ftp.kolibrios.org/users/Serge/new/Toolchain/sdk-28-10-16.7z -OutFile $InstallPath\win32\mingw32\sdk-28-10-16.7z
|
||||
|
||||
|
||||
Write-Progress -Activity 'Installing toolchain' -Status 'Installing libraries' -PercentComplete 50 -CurrentOperation 'Unpacking libraries'
|
||||
|
||||
Expand-7Zip -ArchiveFileName $InstallPath\win32\mingw32\sdk-28-10-16.7z -TargetPath $InstallPath\win32\mingw32\
|
||||
|
||||
|
||||
|
||||
Write-Progress -Activity 'Installing toolchain' -Status 'Installing libraries' -PercentComplete 60 -CurrentOperation "Download libraries"
|
||||
|
||||
|
||||
$response = Invoke-WebRequest -Uri $LIBS_URL -Method GET
|
||||
|
||||
$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"
|
||||
|
@@ -2,7 +2,7 @@
|
||||
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
|
||||
|
||||
#define MyAppName "KolibriOS gcc toolchain"
|
||||
#define MyAppVersion "0.1.4"
|
||||
#define MyAppVersion "0.1.5"
|
||||
#define MyAppPublisher "Egor00f"
|
||||
#define MyAppURL "https://github.com/Egor00f/kolibrios-gcc-toolchain"
|
||||
|
||||
@@ -65,11 +65,11 @@ Root: HKLM; Subkey: "SYSTEM\CurrentControlSet\Control\Session Manager\Environmen
|
||||
Check: NeedsAddPath('{app}\win32\bin')
|
||||
|
||||
[Files]
|
||||
Source: ".\install.bat"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
|
||||
Source: ".\install.ps1"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
|
||||
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
|
||||
|
||||
[Run]
|
||||
Filename: "{app}\install.bat"; description: "install script"; StatusMsg: "Installing toolchain"; Parameters: "{app}"; Flags: runhidden logoutput
|
||||
Filename: "{app}\install.ps1"; description: "install script"; StatusMsg: "Installing toolchain"; Parameters: "-InstallPath {app}"; Flags: runhidden logoutput
|
||||
|
||||
[Icons]
|
||||
Name: "{group}\{cm:ProgramOnTheWeb,{#MyAppName}}"; Filename: "{#MyAppURL}"
|
||||
|
@@ -1,5 +1,5 @@
|
||||
Package: kos32-gcc
|
||||
Version: 0.1.4
|
||||
Version: 0.1.5
|
||||
Architecture: all
|
||||
Section: devel
|
||||
Depends: libc6-i386:amd64, libmpc3:amd64
|
||||
|
Reference in New Issue
Block a user