Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use ArchiveSource to download binaries. Also use GCC 10. #5

Merged
merged 2 commits into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +0,0 @@
[submodule "cpp/pypowsybl"]
path = cpp/pypowsybl
url = https://github.com/powsybl/pypowsybl.git
40 changes: 25 additions & 15 deletions build_local.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,41 @@ using BinaryBuilder, Pkg

name = "Powsybl"
version = v"0.1.0"
sources = [
DirectorySource("./cpp", target="cpp")
]

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
pypowsybl_version = v"1.7.0"

sources = [
DirectorySource("./cpp", target="cpp"),
GitSource("https://github.com/powsybl/pypowsybl.git", "cd5fea41bbfb2897fd71a6e63b2d07a465055699", "cpp"),
ArchiveSource("https://github.com/powsybl/pypowsybl/releases/download/v$(pypowsybl_version)/binaries-v$(pypowsybl_version)-windows.zip",
"82d3cee44992dcceaee7549f17351155e91c9eb2bdce97b1cf6c0107155991e8",
"powsybl-java-windows"),
ArchiveSource("https://github.com/powsybl/pypowsybl/releases/download/v$(pypowsybl_version)/binaries-v$(pypowsybl_version)-linux.zip",
"8832e1ff432e97807dc6dfddb4b001dd2c3c05a7411fc3748c8af3854a3b448c",
"powsybl-java-linux"),
ArchiveSource("https://github.com/powsybl/pypowsybl/releases/download/v$(pypowsybl_version)/binaries-v$(pypowsybl_version)-darwin.zip",
"d541eb07a334d9272b167cb30f7d846ff109db49ac61a9776593c1aface18324",
"powsybl-java-darwin")
]


script = raw"""
cd $WORKSPACE/srcdir

# Get binary for powsybl-java, generated with GraalVm
unzip cpp/powsybl-java.zip -d $prefix
if [[ "${target}" == *-mingw* ]]; then
cp -r powsybl-java-windows/* ${prefix}
fi
if [[ "${target}" == *-linux-* ]]; then
cp -r powsybl-java-linux/* ${prefix}
fi
if [[ "${target}" == *-apple-* ]]; then
cp -r powsybl-java-darwin/* ${prefix}
fi

# Build powsybl-cpp API
cd $WORKSPACE/srcdir/cpp/ && mkdir build && cd build
Expand All @@ -52,4 +62,4 @@ dependencies = [
]

build_tarballs(ARGS, name, version, sources, script, [platform], products, dependencies;
preferred_gcc_version=v"12", julia_compat="1.6")
preferred_gcc_version=v"10", julia_compat="1.6")
1 change: 0 additions & 1 deletion cpp/pypowsybl
Submodule pypowsybl deleted from cd5fea
Loading