@@ -55,6 +55,20 @@ def add_ri2_key
55
55
exec_check "Sign RI2 Key" , "bash.exe -c \" pacman-key --lsign-key #{ key } \" " , false
56
56
end
57
57
58
+ def gcc_downgrade
59
+ [ 'gcc-libs' , 'gcc' ] . each do |base |
60
+ pkg_name = "#{ base } -#{ @gcc } -any.pkg.tar.zst"
61
+ pkg = "https://github.com/ruby/setup-msys2-gcc/releases/download/msys2-packages/#{ PKG_PRE } #{ pkg_name } "
62
+ pkg_sig = "#{ pkg } .sig"
63
+
64
+ download pkg , "./#{ PKG_PRE } #{ pkg_name } "
65
+ download pkg_sig , "./#{ PKG_PRE } #{ pkg_name } .sig"
66
+
67
+ # install package
68
+ exec_check "Install #{ base } -#{ @gcc } Downgrade" , "pacman.exe -Udd --noconfirm --noprogressbar #{ PKG_PRE } #{ pkg_name } "
69
+ end
70
+ end
71
+
58
72
def openssl_downgrade
59
73
add_ri2_key
60
74
@@ -123,9 +137,16 @@ def openssl_copy_cert_files
123
137
end
124
138
125
139
def install_gcc
140
+
141
+ @gcc = '14.2.0-3'
142
+
126
143
args = '--noconfirm --noprogressbar --needed'
144
+
127
145
# zlib required by gcc, gdbm for older Rubies
128
- base_gcc = %w[ make pkgconf libmangle-git tools-git gcc curl ]
146
+ base_gcc = @gcc ?
147
+ %w[ make pkgconf libmangle-git tools-git curl ] :
148
+ %w[ make pkgconf libmangle-git tools-git gcc curl ]
149
+
129
150
base_ruby = PKG_NAME . end_with? ( '-3.0' ) ?
130
151
%w[ gdbm gmp libffi libyaml openssl ragel readline ] :
131
152
%w[ gdbm gmp libffi libyaml openssl ragel readline ]
@@ -142,10 +163,12 @@ def install_gcc
142
163
# Note that OpenSSL may need to be ignored
143
164
if PKG_NAME . end_with? ( '-3.0' )
144
165
pacman_syuu
145
- else
166
+ else
146
167
pacman_syuu
147
168
end
148
169
170
+ gcc_downgrade if @gcc
171
+
149
172
exec_check "Updating the following #{ PKG_PRE [ 0 ..-2 ] } packages:#{ RST } \n " \
150
173
"#{ YEL } #{ ( base_gcc + base_ruby ) . join ' ' } " ,
151
174
"#{ PACMAN } -S #{ args } #{ pkgs } "
0 commit comments