diff --git a/build_local.jl b/build_local.jl index ca44cce..cf9691d 100644 --- a/build_local.jl +++ b/build_local.jl @@ -8,20 +8,25 @@ sources = [ julia_versions = [VERSION] +platform = HostPlatform() + +@info string("Downloading pypowsybl java binaries for ", platform.tags["os"]) +if platform.tags["os"] == "linux" + Base.download("https://github.com/powsybl/pypowsybl/releases/download/v1.7.0/binaries-v1.7.0-linux.zip", "cpp/powsybl-java.zip") +elseif platform.tags["os"] == "windows" + Base.download("https://github.com/powsybl/pypowsybl/releases/download/v1.7.0/binaries-v1.7.0-windows.zip", "cpp/powsybl-java.zip") +elseif platform.tags["os"] == "macos" + Base.download("https://github.com/powsybl/pypowsybl/releases/download/v1.7.0/binaries-v1.7.0-darwin.zip", "cpp/powsybl-java.zip") +else + throw("Unsupported platform with os " * platform.tags["os"]) +end + + script = raw""" cd $WORKSPACE/srcdir # Get binary for powsybl-java, generated with GraalVm -if [[ "${target}" == *-mingw* ]]; then - wget https://github.com/powsybl/pypowsybl/releases/download/v1.7.0/binaries-v1.7.0-windows.zip -O powsybl-java.zip -fi -if [[ "${target}" == *-linux-* ]]; then - wget https://github.com/powsybl/pypowsybl/releases/download/v1.7.0/binaries-v1.7.0-linux.zip -O powsybl-java.zip -fi -if [[ "${target}" == *-apple-* ]]; then - wget https://github.com/powsybl/pypowsybl/releases/download/v1.7.0/binaries-v1.7.0-darwin.zip -O powsybl-java.zip -fi -unzip powsybl-java.zip -d $prefix +unzip cpp/powsybl-java.zip -d $prefix # Build powsybl-cpp API cd $WORKSPACE/srcdir/cpp/ && mkdir build && cd build @@ -34,9 +39,6 @@ cmake -DCMAKE_BUILD_TYPE=Release ../cpp/powsybljl-cpp -DJulia_PREFIX=$prefix -DJ cmake --build . --target install --config Release """ -platforms = [HostPlatform()] -@show platforms - products = [ LibraryProduct(["math", "libmath"], :libmath) LibraryProduct(["pypowsybl-java", "libpypowsybl-java"], :libpypowsybl_java) @@ -49,5 +51,5 @@ dependencies = [ Dependency("libjulia_jll") ] -build_tarballs(ARGS, name, version, sources, script, platforms, products, dependencies; +build_tarballs(ARGS, name, version, sources, script, [platform], products, dependencies; preferred_gcc_version=v"12", julia_compat="1.6")