build.bat 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. rem Partially ripped from Syzop's Unreal repo =]]]]
  2. rem Build script for AppVey0r
  3. rem Let's start with this lol
  4. tzutil /s "GMT Standard Time"
  5. rem Initialize Visual Studio variables
  6. rem Keeping the if for future reference, there's no real need for it atm lol
  7. if "%TARGET%" == "Visual Studio 2017" call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars32.bat"
  8. rem Installing basic tools lol
  9. cinst unrar -y
  10. cinst unzip -y
  11. cinst wget -y
  12. cinst 7zip -y
  13. rem Setting up some dirs
  14. cd \projects
  15. mkdir _zip
  16. mkdir _zip\malv
  17. mkdir _zip\spec
  18. mkdir _zip\u4
  19. mkdir _zip\uncommon
  20. mkdir unrealircd-deps
  21. rem Grabbing UnrealIRCD sauce y0
  22. if "%GOTTEMVERSION%" == "git" (
  23. git clone --branch=unreal40 https://github.com/unrealircd/unrealircd.git c:\projects\unrealircd
  24. ) else (
  25. wget https://www.unrealircd.org/unrealircd4/unrealircd-%GOTTEMVERSION%.tar.gz
  26. 7z e unrealircd-%GOTTEMVERSION%.tar.gz && 7z x unrealircd-%GOTTEMVERSION%.tar
  27. rem Rename for good measure imo
  28. ren unrealircd-%GOTTEMVERSION% unrealircd
  29. )
  30. rem Copying module sources (not using br0ken and templates obv fambi)
  31. cd unrealircd-mods
  32. xcopy malv\*.c \projects\unrealircd\src\modules\third /y
  33. xcopy spec\*.c \projects\unrealircd\src\modules\third /y
  34. xcopy u4\*.c \projects\unrealircd\src\modules\third /y
  35. xcopy uncommon\*.c \projects\unrealircd\src\modules\third /y
  36. set totalcount=0
  37. for %%x in (\projects\unrealircd\src\modules\third\*.c) do set /a totalcount+=1
  38. rem Installing UnrealIRCd dependencies
  39. cd \projects\unrealircd-deps
  40. wget https://www.unrealircd.org/files/dev/win/SetACL.exe
  41. rem Different format for git builds ;];]
  42. if "%GOTTEMVERSION%" == "git" (
  43. wget https://www.unrealircd.org/files/dev/win/libs/unrealircd-libraries-devel.zip
  44. unzip unrealircd-libraries-devel.zip
  45. ) else (
  46. wget https://www.unrealircd.org/files/dev/win/libs/unrealircd-libraries-%GOTTEMVERSION%.zip
  47. unzip unrealircd-libraries-%GOTTEMVERSION%.zip
  48. )
  49. rem Now the actual build
  50. cd \projects\unrealircd
  51. wget https://www.unrealircd.org/files/dev/win/dlltool.exe
  52. call extras\build-tests\windows\compilecmd\%SHORTNAME%.bat
  53. rem The above command will fail, due to missing symbol file
  54. rem However the symbol file can only be generated after the above command
  55. rem So... we create the symbolfile...
  56. nmake -f makefile.win32 SYMBOLFILE
  57. rem And we re-run the exact same command:
  58. call extras\build-tests\windows\compilecmd\%SHORTNAME%.bat
  59. if %ERRORLEVEL% NEQ 0 EXIT /B 1
  60. rem Now need to patch the Unreal repo's build script for 4.0.16 only as it has been modified later on =]
  61. rem Dirty regex to not break muh Sublime's syntax highlighting nor actual functionality xdxd
  62. if "%GOTTEMVERSION%" == "4.0.16" sed -i "s/\(PCRE2LIB.*\.lib[\"\"] *$\)/\1 %%*/" extras\build-tests\windows\compilecmd\%SHORTNAME%.bat
  63. rem Now compile all mods broski, we can do this with Unreal's own build skrip thanks to Syzop ;];]
  64. for /R "src\modules\third" %%f in (*.c) do (
  65. call extras\build-tests\windows\compilecmd\%SHORTNAME%.bat CUSTOMMODULE MODULEFILE=%%~nf
  66. if exist \projects\unrealircd-mods\malv\%%~nf.c xcopy src\modules\third\%%~nf.dll \projects\_zip\malv /y
  67. if exist \projects\unrealircd-mods\spec\%%~nf.c xcopy src\modules\third\%%~nf.dll \projects\_zip\spec /y
  68. if exist \projects\unrealircd-mods\u4\%%~nf.c xcopy src\modules\third\%%~nf.dll \projects\_zip\u4 /y
  69. if exist \projects\unrealircd-mods\uncommon\%%~nf.c xcopy src\modules\third\%%~nf.dll \projects\_zip\uncommon /y
  70. )
  71. rem Check if we got enough DLLs (like, all of em lol)
  72. set mycount=0
  73. for %%x in (src\modules\third\*.dll) do set /a mycount+=1
  74. echo "Total needed: %totalcount% -- Got: %mycount%"
  75. if %mycount% NEQ %totalcount% EXIT /B 1
  76. rem We gucci mane, let's prepare some files for el zipperin0
  77. cd \projects\_zip
  78. rem Need to shit out datetime file (premium build deets etc)
  79. set HOUR=%time:~0,2%
  80. set dtStamp9=%date:~-4%/%date:~4,2%/%date:~7,2% 0%time:~1,1%:%time:~3,2%:%time:~6,2%
  81. set dtStamp24=%date:~-4%/%date:~4,2%/%date:~7,2% %time:~0,2%:%time:~3,2%:%time:~6,2%
  82. if "%HOUR:~0,1%" == " " (set dtStamp=%dtStamp9%) else (set dtStamp=%dtStamp24%)
  83. echo Built on: %dtStamp% GMT >built.txt
  84. rem Fancy ass HTML version of the repo's README ;];;] (regenerated way before we get to this point lmao)
  85. wget https://u4win.gottem.nl/README.html
  86. rem Zip em up and show some proof lol
  87. 7z a -xr!*.zip -r unrealircd-mods-%GOTTEMVERSION%.zip *
  88. dir unrealircd-mods-%GOTTEMVERSION%.zip
  89. sha256sum unrealircd-mods-%GOTTEMVERSION%.zip
  90. rem Upload artifact
  91. mv unrealircd-mods-%GOTTEMVERSION%.zip \projects\unrealircd-mods
  92. cd \projects\unrealircd-mods
  93. appveyor PushArtifact unrealircd-mods-%GOTTEMVERSION%.zip
  94. if %ERRORLEVEL% NEQ 0 EXIT /B 1