chicken-package/build.ps1

65 lines
2.4 KiB
PowerShell
Raw Normal View History

2020-03-01 18:46:53 +00:00
#Set-Variable -Name "version" -Value "4.12.0"
2020-03-01 19:28:19 +00:00
#$version = '5.2.0'
#$binaryversion=11
2020-03-01 18:46:53 +00:00
# Building
C:\tools\msys64\usr\bin\bash.exe --login -c 'pacboy -Sy --needed --noconfirm binutils:x make:x gcc:x gettext:x readline:x'
$env:Path+=";C:\tools\msys64\mingw64\bin"
mingw32-make.exe -C chickenbuild PLATFORM=mingw ARCH=x86-64 PREFIX=C:/tools/chicken
2020-03-01 23:06:25 +00:00
choco new chicken --version $Env:version --maintainername="'Daniel Ziltener'"
2020-03-01 18:46:53 +00:00
Remove-Item -Recurse -Force chicken\tools\
Remove-Item -Force chicken\ReadMe.md
# Copying files
$bindir="chicken\tools\bin"
New-Item $bindir -ItemType Directory
Copy-Item chickenbuild\LICENSE chicken\LICENSE.txt
Copy-Item VERIFICATION.txt chicken\VERIFICATION.txt
Copy-Item chickenbuild\*.exe $bindir
Copy-Item chickenbuild\*.bat $bindir
Copy-Item chickenbuild\*.dll $bindir
$includedir="chicken\tools\include\chicken"
New-Item $includedir -ItemType Directory
Copy-Item chickenbuild\chicken.h $includedir
Copy-Item chickenbuild\chicken-config.h $includedir
$linkerlibdir="chicken\tools\lib"
New-Item $linkerlibdir -ItemType Directory
Copy-Item chickenbuild\libchicken.a $linkerlibdir
Copy-Item chickenbuild\libchicken.dll.a $linkerlibdir
$extbindir="chicken\tools\lib\chicken\9"
New-Item $extbindir -ItemType Directory
Copy-Item chickenbuild\*.so $extbindir
Copy-Item chickenbuild\*.db $extbindir
$docdir="chicken\tools\share\chicken\doc"
New-Item $docdir -ItemType Directory
Copy-Item chickenbuild\chicken.png $docdir
Copy-Item chickenbuild\feathers.tcl $docdir
Copy-Item chickenbuild\LICENSE $docdir
Copy-Item chickenbuild\README $docdir
Copy-Item chickenbuild\manual-html $docdir\manual-html -Recurse
$man1dir="chicken\tools\man1"
New-Item $man1dir -ItemType Directory
Copy-Item chickenbuild\*.1 $man1dir
Copy-Item chickenbuild\setup.defaults chicken\tools\share\chicken
Copy-Item chocolateyInstall.ps1 .\chicken\
Copy-Item chocolateyUninstall.ps1 .\chicken\
# Create ignorefiles to prevent creation of shims
$files = get-childitem "chicken" -include *.exe -recurse
cd chicken
foreach ($file in $files) {
#generate an ignore file
New-Item "$file.ignore" -type file -force | Out-Null
}
cd ..
# Cleanup and packaging
Remove-Item -Recurse -Force chickenbuild
2020-03-01 23:06:25 +00:00
(Get-Content chicken.nuspec).replace("CHICKEN_VERSION", "$Env:version") | Set-Content chicken\chicken.nuspec
2020-03-01 18:46:53 +00:00
cd chicken
choco pack
cd ..
2020-03-01 23:06:25 +00:00
mv .\chicken\chicken.$Env:version.nupkg .\