Skip to content

Commit aa15221

Browse files
authored
create_gcc_pkg.rb - use gcc-14 instead of gcc-15 (#22)
1 parent 96aec49 commit aa15221

File tree

1 file changed

+25
-2
lines changed

1 file changed

+25
-2
lines changed

create_gcc_pkg.rb

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,20 @@ def add_ri2_key
5555
exec_check "Sign RI2 Key", "bash.exe -c \"pacman-key --lsign-key #{key}\"", false
5656
end
5757

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+
5872
def openssl_downgrade
5973
add_ri2_key
6074

@@ -123,9 +137,16 @@ def openssl_copy_cert_files
123137
end
124138

125139
def install_gcc
140+
141+
@gcc = '14.2.0-3'
142+
126143
args = '--noconfirm --noprogressbar --needed'
144+
127145
# 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+
129150
base_ruby = PKG_NAME.end_with?('-3.0') ?
130151
%w[gdbm gmp libffi libyaml openssl ragel readline] :
131152
%w[gdbm gmp libffi libyaml openssl ragel readline]
@@ -142,10 +163,12 @@ def install_gcc
142163
# Note that OpenSSL may need to be ignored
143164
if PKG_NAME.end_with?('-3.0')
144165
pacman_syuu
145-
else
166+
else
146167
pacman_syuu
147168
end
148169

170+
gcc_downgrade if @gcc
171+
149172
exec_check "Updating the following #{PKG_PRE[0..-2]} packages:#{RST}\n" \
150173
"#{YEL}#{(base_gcc + base_ruby).join ' '}",
151174
"#{PACMAN} -S #{args} #{pkgs}"

0 commit comments

Comments
 (0)