appveyor_preinstall.ps1 3.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. mkdir C:\projects\slic3r\FreeGLUT
  2. if (!(Test-Path "C:\users\appveyor\freeglut.$env:ARCH.7z"))
  3. {
  4. wget "https://bintray.com/lordofhyphens/Slic3r/download_file?file_path=freeglut-mingw-3.0.0.$env:ARCH.7z" -o C:\users\appveyor\freeglut.$env:ARCH.7z
  5. }
  6. cmd /c "7z x C:\Users\appveyor\freeglut.$env:ARCH.7z -oC:\projects\slic3r\FreeGLUT"
  7. if (!(Test-Path "C:\users\appveyor\strawberry.$env:ARCH.msi")) {
  8. if ($env:ARCH -eq "64bit") {
  9. wget "https://bintray.com/lordofhyphens/Slic3r/download_file?file_path=slic3r-perl-5.24.1.4-64bit.msi" -o "C:\users\appveyor\strawberry.$env:ARCH.msi" | Write-Output
  10. } else {
  11. wget "http://strawberryperl.com/download/5.24.1.1/strawberry-perl-5.24.1.1-32bit.msi" -o "C:\users\appveyor\strawberry.$env:ARCH.msi" | Write-Output
  12. }
  13. }
  14. if (!($env:ARCH -eq "32bit")) {
  15. if (!(Test-Path "C:\users\appveyor\extra_perl.7z")) {
  16. wget "https://bintray.com/lordofhyphens/Slic3r/download_file?file_path=Strawberry-6.3.0-seg-archive.7z" -o "C:\users\appveyor\extra_perl.7z" | Write-Output
  17. }
  18. }
  19. msiexec.exe /i "C:\users\appveyor\strawberry.$env:ARCH.msi" /quiet
  20. if (!($env:ARCH -eq "32bit")) {
  21. cmd /c "7z x -aoa C:\Users\appveyor\extra_perl.7z -oC:\"
  22. }
  23. if (!(Test-Path "C:\users\appveyor\winscp.zip")) {
  24. wget "https://bintray.com/lordofhyphens/Slic3r/download_file?file_path=WinSCP-5.9.4-Portable.zip" -o "C:\users\appveyor\winscp.zip" | Write-Output
  25. }
  26. cmd /c "7z x C:\Users\appveyor\winscp.zip -oC:\Strawberry\c\bin"
  27. rm -r C:\min* -Force
  28. rm -r C:\msys64\mingw* -Force
  29. rm -r C:\cygwin* -Force
  30. rm -r C:\Perl -Force
  31. $PERLDIR = 'C:\Strawberry'
  32. $env:Path = "C:\Strawberry\c\bin;C:\Strawberry\perl\bin;C:\Strawberry\perl\vendor\bin;" + $env:Path
  33. if(Test-Path -Path 'C:\Strawberry' ) {
  34. copy C:\Strawberry\c\bin\gcc.exe C:\Strawberry\c\bin\cc.exe
  35. cmd /c mklink /D C:\Perl C:\Strawberry\perl
  36. mkdir C:\dev
  37. if (!(Test-Path "C:\users\appveyor\boost.1.63.0.$env:ARCH.7z") -Or $env:FORCE_BOOST_REINSTALL -eq 1) {
  38. if ($env:ARCH -eq "64bit") {
  39. wget "http://www.siusgs.com/slic3r/buildserver/win/boost_1_63_0-x64-gcc-6.3.0-seh.7z" -O "C:\users\appveyor\boost.1.63.0.$env:ARCH.7z" | Write-Output
  40. } else {
  41. wget "https://bintray.com/lordofhyphens/Slic3r/download_file?file_path=boost_1_63_0-x32-gcc-4.9.2-sjlj.7z" -O "C:\users\appveyor\boost.1.63.0.$env:ARCH.7z" | Write-Output
  42. }
  43. }
  44. Add-AppveyorCompilationMessage -Message "Extracting cached archive."
  45. cmd /c "7z x C:\Users\appveyor\boost.1.63.0.$env:ARCH.7z -oC:\dev"
  46. mkdir C:\dev\CitrusPerl
  47. cmd /C mklink /D C:\dev\CitrusPerl\mingw32 C:\Strawberry\c
  48. cd C:\projects\slic3r
  49. cpanm ExtUtils::Typemaps::Basic
  50. cpanm ExtUtils::Typemaps::Default
  51. cpanm local::lib
  52. Add-AppveyorCompilationMessage -Message "Finished install script."
  53. rm -r 'C:\Program Files\Git\usr\bin' -Force
  54. } else {
  55. Add-AppveyorCompilationMessage -Message "No strawberry perl!"
  56. }
  57. Add-AppveyorCompilationMessage -Message "Installing wxWidgets (xsgui dependency))"
  58. if ($env:FORCE_WX_BUILD -eq 1) {
  59. rm "C:\Users\appveyor\wxwidgets-$env:ARCH.7z" -Force
  60. }
  61. if (!(Test-Path "C:\Users\appveyor\wxwidgets-$env:ARCH.7z")) {
  62. Add-AppveyorCompilationMessage -Message "Extracting wxWidgets for $env:ARCH"
  63. wget "https://bintray.com/lordofhyphens/Slic3r/download_file?file_path=wxwidgets-$env:ARCH.7z" -o C:\users\appveyor\wxwidgets-$env:ARCH.7z
  64. 7z x C:\users\appveyor\wxwidgets-$env:ARCH.7z -oC:\dev
  65. } else {
  66. Add-AppveyorCompilationMessage -Message "Extracting prebuilt wxWidgets."
  67. 7z x "C:\Users\appveyor\wxwidgets-$env:ARCH.7z" -oC:\dev
  68. }