PortAudio.jl/deps/build.jl

41 lines
2.3 KiB
Julia
Raw Normal View History

using BinaryProvider # requires BinaryProvider 0.3.0 or later
# Parse some basic command-line arguments
const verbose = "--verbose" in ARGS
const prefix = Prefix(get([a for a in ARGS if a != "--verbose"], 1, joinpath(@__DIR__, "usr")))
products = [
LibraryProduct(prefix, ["libportaudio"], :libportaudio),
]
# Download binaries from hosted location
bin_prefix = "https://github.com/jpsamaroo/PortAudioBuilder/releases/download/v19.6.0"
# Listing of files generated by BinaryBuilder:
download_info = Dict(
2019-09-11 14:23:13 +02:00
Windows(:i686) => ("$bin_prefix/libportaudio.v19.6.0.i686-w64-mingw32.tar.gz", "0d38fd434c21e8cd8a45193d50cc66c35d920ed0f4bf7d5682a3ad7819b9eb01"),
Linux(:powerpc64le, libc=:glibc) => ("$bin_prefix/libportaudio.v19.6.0.powerpc64le-linux-gnu.tar.gz", "4050d5b887f2afa5891d1b4e5f55bf1f5f140c97b7c9fe4140f495263d594c37"),
MacOS(:x86_64) => ("$bin_prefix/libportaudio.v19.6.0.x86_64-apple-darwin14.tar.gz", "1c20a2884bd73e5827508a47d0794b845040569739326b2b37eaa1d9bcb2a7a0"),
Linux(:x86_64, libc=:glibc) => ("$bin_prefix/libportaudio.v19.6.0.x86_64-linux-gnu.tar.gz", "bfb31ffd54fa48802f9af31ecbbae07506baaee52880e6d458a192ea0d6d6a21"),
2019-09-11 14:23:13 +02:00
Windows(:x86_64) => ("$bin_prefix/libportaudio.v19.6.0.x86_64-w64-mingw32.tar.gz", "e373f78eebe7b08a3e07c72a579209f305232281d0ff7c8b07ad48ffb1711259"),
)
# Install unsatisfied or updated dependencies:
unsatisfied = any(!satisfied(p; verbose=verbose) for p in products)
dl_info = choose_download(download_info, platform_key_abi())
if dl_info === nothing && unsatisfied
# If we don't have a 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 (\"$(Sys.MACHINE)\", parsed as \"$(triplet(platform_key_abi()))\") is not supported by this package!")
2014-09-04 15:18:03 +02:00
end
# If we have a download, and we are unsatisfied (or the version we're
# trying to install is not itself installed) then load it up!
if unsatisfied || !isinstalled(dl_info...; prefix=prefix)
# Download and install binaries
install(dl_info...; prefix=prefix, force=true, verbose=verbose)
end
# Write out a deps.jl file that will contain mappings for our products
write_deps_file(joinpath(@__DIR__, "deps.jl"), products, verbose=verbose)