File tree Expand file tree Collapse file tree 1 file changed +23
-6
lines changed Expand file tree Collapse file tree 1 file changed +23
-6
lines changed Original file line number Diff line number Diff line change @@ -231,12 +231,29 @@ trait CliLaunchers extends SbtModule { self =>
231231 os.copy.over(libPath, destDir / s " ${prefix}sodiumjni. $ext" )
232232 }
233233 private def copyLibsodiumStaticTo (cs : String , destDir : os.Path ): Unit = {
234- val dirRes = os.proc(
235- cs,
236- " get" ,
237- " --archive" ,
238- " https://download.libsodium.org/libsodium/releases/libsodium-1.0.18-stable-msvc.zip"
239- ).call()
234+ val dirRes = {
235+ val stable = os.proc(
236+ cs,
237+ " get" ,
238+ " --archive" ,
239+ s " https://download.libsodium.org/libsodium/releases/libsodium- $libsodiumVersion-stable-msvc.zip "
240+ ).call(check = false )
241+ if (stable.exitCode == 0 ) stable
242+ else {
243+ System .err.println(
244+ s " Failed to download stable libsodium $libsodiumVersion from https://download.libsodium.org/libsodium/releases "
245+ )
246+ System .err.println(
247+ " falling back to https://github.com/jedisct1/libsodium/releases *-RELEASE"
248+ )
249+ os.proc( // fallback to GitHuB *-RELEASE version
250+ cs,
251+ " get" ,
252+ " --archive" ,
253+ s " https://github.com/jedisct1/libsodium/releases/download/ $libsodiumVersion-RELEASE/libsodium- $libsodiumVersion-msvc.zip "
254+ ).call()
255+ }
256+ }
240257 val dir = os.Path (dirRes.out.trim(), os.pwd)
241258 os.copy.over(
242259 dir / " libsodium" / " x64" / " Release" / " v143" / " static" / " libsodium.lib" ,
You can’t perform that action at this time.
0 commit comments