Develop and Download Open Source Software

Browse Subversion Repository

Contents of /trunk/installer/release.bat

Parent Directory Parent Directory | Revision Log Revision Log


Revision 9791 - (show annotations) (download) (as text)
Tue Mar 8 14:37:08 2022 UTC (2 years ago) by zmatsuo
File MIME type: application/x-msdos-program
File size: 6799 byte(s)
リリース用スクリプト

- ミスなくリリース用バイナリを作成するためのスクリプト
- 他の機能も追加
  - ライブラリのダウンロード(更新)
  - 環境変数 PATH を設定したcmdの起動
  - ツールのバージョンチェック
- スナップショットフォルダを snapshot-YYMMDD_HHMMSS に変更
  - 変更前は snapshot-YYMMDD_N
1 @echo off
2 setlocal
3 set CUR=%~dp0
4 cd /d %CUR%
5
6 call :setup_tools_env
7
8 echo =======
9 echo 1. download libs, rebuild libs and Tera Term, installer, archive
10 echo 2. build libs
11 echo 3. build libs and rebuild Tera Term, installer, archive (for Release build)
12 echo 4. build libs and Tera Term (for Normal build, snapshot)
13 echo 7. exec cmd.exe
14 echo 8. check tools
15 echo 9. exit
16
17 if "%1" == "" (
18 set /p no="select no "
19 ) else (
20 set no=%1
21 )
22 echo %no%
23
24 if "%no%" == "1" (
25 call :update_libs
26 call :build_teraterm freeze_state
27 )
28
29 if "%no%" == "2" (
30 call :build_libs
31 )
32
33 if "%no%" == "3" (
34 call :build_teraterm freeze_state
35 )
36
37 if "%no%" == "4" (
38 call :build_teraterm
39 )
40
41 if "%no%" == "7" (
42 call :exec_cmd
43 )
44
45 if "%no%" == "8" (
46 call :check_tools
47 )
48
49 pause
50 exit 0
51
52
53 rem ####################
54 :update_libs
55
56 setlocal
57 cd /d %CUR%..\libs
58
59 :oniguruma
60 %CURL% -L https://github.com/kkos/oniguruma/releases/download/v6.9.7.1/onig-6.9.7.1.tar.gz -o oniguruma.tar.gz
61 %CMAKE% -E tar xf oniguruma.tar.gz
62 %CMAKE% -E rm -rf oniguruma
63 %CMAKE% -E rename onig-6.9.7 oniguruma
64
65 :zlib
66 %CURL% -L https://zlib.net/zlib-1.2.11.tar.xz -o zlib.tar.xz
67 %CMAKE% -E tar xf zlib.tar.xz
68 %CMAKE% -E rm -rf zlib
69 %CMAKE% -E rename zlib-1.2.11 zlib
70
71 :putty
72 %CURL% -L https://the.earth.li/~sgtatham/putty/0.76/putty-0.76.tar.gz -o putty.tar.gz
73 %CMAKE% -E tar xf putty.tar.gz
74 %CMAKE% -E rm -rf putty
75 %CMAKE% -E rename putty-0.76 putty
76
77 :SFMT
78 %CURL% -L http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/SFMT/SFMT-src-1.5.1.zip -o sfmt.zip
79 %CMAKE% -E tar xf sfmt.zip
80 %CMAKE% -E rm -rf SFMT
81 %CMAKE% -E rename SFMT-src-1.5.1 SFMT
82 echo #define SFMT_VERSION "1.5.1" > SFMT\SFMT_version_for_teraterm.h
83
84 :cJSON
85 %CURL% -L https://github.com/DaveGamble/cJSON/archive/v1.7.14.zip -o cJSON.zip
86 %CMAKE% -E tar xf cJSON.zip
87 %CMAKE% -E rm -rf cJSON
88 %CMAKE% -E rename cJSON-1.7.14 cJSON
89
90 :argon2
91 %CURL% -L https://github.com/P-H-C/phc-winner-argon2/archive/refs/tags/20190702.tar.gz -o argon2.tar.gz
92 %CMAKE% -E tar xf argon2.tar.gz
93 %CMAKE% -E rm -rf argon2
94 %CMAKE% -E rename phc-winner-argon2-20190702 argon2
95
96 :libressl
97 %CURL% -L https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-3.4.2.tar.gz -o libressl.tar.gz
98 %CMAKE% -E tar xf libressl.tar.gz
99 %CMAKE% -E rm -rf libressl
100 %CMAKE% -E rename libressl-3.4.2 libressl
101
102 endlocal
103 exit /b 0
104
105 rem ####################
106 :build_libs
107
108 setlocal
109 cd /d %CUR%..\libs
110 call buildall.bat
111 endlocal
112 exit /b 0
113
114 rem ####################
115 :build_teraterm
116
117 setlocal
118 cd /d %CUR%
119
120 if "%1" == "freeze_state" (
121 call build.bat rebuild
122 call makearchive.bat release
123 ) else (
124 call makearchive.bat
125 )
126 call ..\buildtools\svnrev\sourcetree_info.bat
127 if "%1" == "freeze_state" (
128 pushd Output
129 %CMAKE% -E tar cf TERATERM_r%SVNVERSION%_%DATE%_%TIME%.zip --format=zip teraterm-5.0/
130 popd
131 ) else (
132 %CMAKE% -E tar cf TERATERM_r%SVNVERSION%_%DATE%_%TIME%.zip --format=zip snapshot-%DATE%_%TIME%
133 )
134 %INNO_SETUP% teraterm.iss
135
136 endlocal
137 exit /b 0
138
139 rem ####################
140 :setup_tools_env
141
142 set CURL=%SystemRoot%\System32\curl.exe
143 set CYGWIN_PATH=C:\cygwin64\bin
144 set VS_BASE=C:\Program Files (x86)\Microsoft Visual Studio\2019
145
146 if exist toolinfo.bat (
147 echo found toolinfo.bat
148 call toolinfo.bat
149 echo toolinfo.bat ok
150 ) else (
151 set PATH=
152 )
153
154 call :search_perl
155 call :search_svn
156 call :search_iscc
157 set PATH=%PATH%;%SVN_PATH%
158 set PATH=%PATH%;%PERL_PATH%
159 set PATH=%PATH%;%SystemRoot%
160 set PATH=%PATH%;%SystemRoot%\system32
161 call :set_vs_env
162 call :search_cmake
163 set PATH=%PATH%;%CYGWIN_PATH%
164 set PATH=%PATH%;%CMAKE_PATH%
165 exit /b 0
166
167 rem ####################
168 :search_perl
169 if exist %PERL_PATH%\perl.exe (
170 set PERL=%PERL_PATH%\perl.exe
171 exit /b 0
172 )
173
174 set PERL=perl.exe
175 where %PERL% > nul 2>&1
176 if %errorlevel% == 0 exit /b 0
177 set PERL=%CUR%..\buildtools\perl\perl\bin\perl.exe
178 if exist %PERL% exit /b 0
179 set PERL=C:\Strawberry\perl\bin\perl.exe
180 if exist %PERL% exit /b 0
181 set PERL=C:\Perl64\bin\perl.exe
182 if exist %PERL% exit /b 0
183 set PERL=C:\Perl\bin\perl.exe
184 if exist %PERL% exit /b 0
185 set PERL=C:\cygwin64\usr\bin\perl.exe
186 if exist %PERL% exit /b 0
187 set PERL=C:\cygwin\usr\bin\perl.exe
188 if exist %PERL% exit /b 0
189 echo perl not found
190 pause
191 exit
192
193 rem ####################
194 :search_svn
195 if exist %SVN_PATH%\svn.exe (
196 set SVN=%SVN_PATH%\svn.exe
197 exit /b 0
198 )
199
200 set SVN=svn.exe
201 where %SVN% > nul 2>&1
202 if %errorlevel% == 0 exit /b 0
203 set SVN_PATH=C:\Program Files (x86)\Subversion\bin
204 set SVN="%SVN_PATH%\svn.exe"
205 if exist %SVN% exit /b 0
206 set SVN_PATH=C:\Program Files\TortoiseSVN\bin
207 set SVN="%SVN_PATH%\svn.exe"
208 if exist %SVN% exit /b 0
209 echo svn not found
210 pause
211 exit
212
213 rem ####################
214 :search_cmake
215 if exist %CMAKE_PATH%\cmake.exe (
216 set CMAKE="%CMAKE_PATH%\cmake.exe"
217 exit /b 0
218 )
219
220 where %CMAKE% > nul 2>&1
221 if %errorlevel% == 0 exit /b 0
222 set CMAKE_PATH=C:\Program Files\CMake\bin
223 set CMAKE="%CMAKE_PATH%\cmake.exe"
224 if exist %CMAKE% exit /b 0
225 set CMAKE_PATH=%VCINSTALLDIR%\..\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin
226 set CMAKE="%CMAKE_PATH%\cmake.exe"
227 if exist %CMAKE% exit /b 0
228 echo cmake not found
229 pause
230 exit
231
232 rem ####################
233 :search_iscc
234 if [%INNO_SETUP%] == [] goto search_iscc_1
235 if exist %INNO_SETUP% (
236 exit /b 0
237 )
238 echo INNO_SETUP=%INNO_SETUP%
239 goto search_iscc_not_found
240
241 :search_iscc_1
242 set INNO_SETUP=%CUR%..\buildtools\innosetup6\bin\ISCC.exe
243 if exist %INNO_SETUP% exit /b 0
244 set INNO_SETUP="C:\Program Files (x86)\Inno Setup 6\iscc.exe"
245 if exist %INNO_SETUP% exit /b 0
246 :search_iscc_not_found
247 echo iscc(inno setup) not found
248 pause
249 exit
250
251 rem ####################
252 :set_vs_env
253
254 if exist "%VS_BASE%\Community" (
255 call "%VS_BASE%\Community\VC\Auxiliary\Build\vcvars32.bat"
256 )
257 if exist "%VS_BASE%\Professional" (
258 call "%VS_BASE%\Profssional\VC\Auxiliary\Build\vcvars32.bat"
259 )
260 if exist "%VS_BASE%\Enterprise" (
261 call "%VS_BASE%\Enterprise\VC\Auxiliary\Build\vcvars32.bat"
262 )
263 exit /b 0
264
265 rem ####################
266 :exec_cmd
267 cmd
268 exit /b 0
269
270 rem ####################
271 :check_tools
272
273 echo cmd(windows)
274 ver
275
276 echo Visual Studio
277 echo VS_BASE=%VS_BASE%
278 cl
279
280 echo curl
281 where curl
282 echo CURL=%CURL%
283 %CURL% --version
284
285 echo svn
286 where svn
287 echo SVN_PATH=%SVN_PATH%
288 echo SVN=%SVN%
289 svn --version
290
291 echo perl
292 where perl
293 echo PERL_PATH=%PERL_PATH%
294 echo PERL=%PERL%
295 perl --version
296
297 echo cmake
298 where cmake
299 echo CMAKE_PATH=%CMAKE_PATH%
300 echo CMAKE=%CMAKE%
301 %CMAKE% --version
302
303 echo cygwin
304 echo CYGWIN_PATH=%CYGWIN_PATH%
305 cygcheck -c base-cygwin
306 cygcheck -c gcc-core
307 cygcheck -c w32api-headers
308 cygcheck -c make
309
310 echo inno setup
311 echo INNO_SETUP=%INNO_SETUP%
312 %INNO_SETUP% /?
313
314 exit /b 0

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26