@@ -38,14 +38,26 @@ class << self
3838 [ 'mingw64' , 'mingw-w64-x86_64-' ]
3939 when 'mingw32'
4040 [ 'mingw32' , 'mingw-w64-i686-' ]
41+ when 'clangarm64'
42+ [ 'clangarm64' , 'mingw-w64-clang-aarch64-' ]
4143 else
42- STDOUT . syswrite "Invalid package type, must be ucrt64, mingw64, or mingw32 \n "
44+ STDOUT . syswrite "Invalid package type, must be ucrt64, mingw64, mingw32, or clangarm64 \n "
4345 exit 1
4446 end
4547
4648 MSYS2_PKG = "#{ MSYS2_ROOT } /#{ PKG_DIR } "
47-
48- SSL_1_DLLS = %w[ bin/libcrypto-1_1-x64.dll bin/libssl-1_1-x64.dll ]
49+
50+ SSL_1_DLLS = if PKG_DIR == 'clangarm64'
51+ %w[ bin/libcrypto-1_1.dll bin/libssl-1_1.dll ]
52+ else
53+ %w[ bin/libcrypto-1_1-x64.dll bin/libssl-1_1-x64.dll ]
54+ end
55+
56+ SSL_3_SAVE_FILES = if PKG_DIR == 'clangarm64'
57+ %w[ bin/libcrypto-3.dll bin/libssl-3.dll etc/ssl/openssl.cnf ]
58+ else
59+ %w[ bin/libcrypto-3-x64.dll bin/libssl-3-x64.dll etc/ssl/openssl.cnf ]
60+ end
4961
5062 def add_ri2_key
5163 # appveyor ri2 package signing key
@@ -99,11 +111,9 @@ def openssl_upgrade
99111 pkg_name = "openssl-3.0.7-1-any.pkg.tar.zst"
100112 pkg = "https://github.com/oneclick/rubyinstaller2-packages/releases/download/ci.ri2/#{ PKG_PRE } #{ pkg_name } "
101113 pkg_sig = "#{ pkg } .sig"
102- old_dlls = %w[ libcrypto-1_1-x64.dll libssl-1_1-x64.dll ]
103- dll_root = "#{ MSYS2_ROOT } /#{ PKG_DIR } /bin"
104114
105115 # save previous dll files so we can copy back into folder
106- old_dlls . each { |fn | FileUtils . cp "#{ dll_root } /#{ fn } " , "." }
116+ SSL_1_DLLS . each { |fn | FileUtils . cp "#{ MSYS2_PKG } /#{ fn } " , "." }
107117
108118 download pkg , "./#{ PKG_PRE } #{ pkg_name } "
109119 download pkg_sig , "./#{ PKG_PRE } #{ pkg_name } .sig"
@@ -112,11 +122,7 @@ def openssl_upgrade
112122 exec_check "Install OpenSSL Upgrade" , "pacman.exe -Udd --noconfirm --noprogressbar #{ PKG_PRE } #{ pkg_name } "
113123
114124 # copy previous dlls back into MSYS2 folder
115- old_dlls . each do |fn |
116- unless File . exist? "#{ dll_root } /#{ fn } "
117- FileUtils . cp fn , "#{ dll_root } /#{ fn } "
118- end
119- end
125+ SSL_1_DLLS . each { |fn | FileUtils . cp_r File . basename ( fn ) , "#{ MSYS2_PKG } /#{ fn } " }
120126 end
121127
122128 # Below files are part of the 'ca-certificates' package, they are not
@@ -264,6 +270,10 @@ def run
264270 STDOUT . syswrite "\n #{ GRN } ** Creating and Uploading #{ PKG_DIR } gcc tools 7z **#{ RST } \n \n "
265271 end
266272
273+ exec_check "Remove all uninstalled packages" , "#{ BASH } -c \" paccache -r -f -u -k0\" "
274+ exec_check "Keep the newest for all other packages" , "#{ BASH } -c \" paccache -r -f -k1\" "
275+ exec_check "Remove all cached packages" , "#{ PACMAN } -Scc --noconfirm"
276+
267277 copy_to_temp
268278
269279 clean_package
0 commit comments