Skip to content

Commit

Permalink
Merge pull request #66 from tpapp/tp/fix-platform-key-abi
Browse files Browse the repository at this point in the history
Rewrite build using example in BinaryProvider.jl.
  • Loading branch information
andreasnoack authored Nov 11, 2019
2 parents a8762a5 + 1821c19 commit 729685e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[compat]
BinaryProvider = "0.3.2, 0.4, 0.5"
BinaryProvider = "0.5"
julia = "0.7, 1"

[targets]
Expand Down
28 changes: 14 additions & 14 deletions deps/build.jl
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,20 @@ download_info = Dict(
Windows(:x86_64) => ("$bin_prefix/libRmath.x86_64-w64-mingw32.tar.gz", "12929d34ec0fd3e29c0633410c08396b21989513fcd4d28ed845c3cabf316a19"),
)

# Install unsatisfied or updated dependencies:
unsatisfied = any(!satisfied(p; verbose=verbose) for p in products)
if haskey(download_info, platform_key())
url, tarball_hash = download_info[platform_key()]
if unsatisfied || !isinstalled(url, tarball_hash; prefix=prefix)
# First, check to see if we're all satisfied
if any(!satisfied(p; verbose=verbose) for p in products)
try
# Download and install binaries
install(url, tarball_hash; prefix=prefix, force=true, verbose=verbose)
url, tarball_hash = choose_download(download_info)
install(url, tarball_hash; prefix=prefix, force=true, verbose=true)
catch e
if typeof(e) <: ArgumentError
error("Your platform $(Sys.MACHINE) is not supported by this package!")
else
rethrow(e)
end
end
elseif unsatisfied
# If we don't have a BinaryProvider-compatible .tar.gz to download, complain.
# Alternatively, you could attempt to install from a separate provider,
# build from source or something even more ambitious here.
error("Your platform $(triplet(platform_key())) is not supported by this package!")
end

# Write out a deps.jl file that will contain mappings for our products
write_deps_file(joinpath(@__DIR__, "deps.jl"), products)
# Finally, write out a deps.jl file
write_deps_file(joinpath(@__DIR__, "deps.jl"), products)
end

0 comments on commit 729685e

Please sign in to comment.