diff --git a/subprojects/solver/solver-smtlib/src/main/java/hu/bme/mit/theta/solver/smtlib/impl/cvc5/CVC5SmtLibSolverInstaller.java b/subprojects/solver/solver-smtlib/src/main/java/hu/bme/mit/theta/solver/smtlib/impl/cvc5/CVC5SmtLibSolverInstaller.java index 877b830e53..36089ae986 100644 --- a/subprojects/solver/solver-smtlib/src/main/java/hu/bme/mit/theta/solver/smtlib/impl/cvc5/CVC5SmtLibSolverInstaller.java +++ b/subprojects/solver/solver-smtlib/src/main/java/hu/bme/mit/theta/solver/smtlib/impl/cvc5/CVC5SmtLibSolverInstaller.java @@ -34,7 +34,9 @@ import java.util.List; import static hu.bme.mit.theta.common.OsHelper.Architecture.X64; -import static hu.bme.mit.theta.common.OsHelper.OperatingSystem.*; +import static hu.bme.mit.theta.common.OsHelper.OperatingSystem.LINUX; +import static hu.bme.mit.theta.common.OsHelper.OperatingSystem.MAC; +import static hu.bme.mit.theta.common.OsHelper.OperatingSystem.WINDOWS; public class CVC5SmtLibSolverInstaller extends SmtLibSolverInstaller.Default { private final List versions; @@ -68,6 +70,15 @@ protected void installSolver(final Path installDir, final String version) throws } catch (IOException e) { throw new SmtLibSolverInstallerException(e); } + try ( + final var inputChannel = Channels.newChannel(getLicenseDownloadUrl().openStream()); + final var outputChannel = new FileOutputStream(installDir.resolve("COPYING").toAbsolutePath().toString()).getChannel() + ) { + logger.write(Logger.Level.MAINSTEP, "Starting license download (%s)...\n", getLicenseDownloadUrl().toString()); + outputChannel.transferFrom(inputChannel, 0, Long.MAX_VALUE); + } catch (IOException e) { + throw new SmtLibSolverInstallerException(e); + } logger.write(Logger.Level.MAINSTEP, "Download finished\n"); } @@ -108,6 +119,10 @@ version, getArchString(version) )).toURL(); } + private URL getLicenseDownloadUrl() throws SmtLibSolverInstallerException, MalformedURLException { + return URI.create("https://raw.githubusercontent.com/cvc5/cvc5/main/COPYING").toURL(); + } + private String getArchString(final String version) throws SmtLibSolverInstallerException { final var semVer = SemVer.of(version); String archStr = null;