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( Windows(:i686) => ("$bin_prefix/libportaudio.v19.6.0.i686-w64-mingw32.tar.gz", "520efc322259b4eb05d41ba8d22f3b744a611b4b1c4ad651fbdd9160f793b4f1"), Linux(:powerpc64le, libc=:glibc) => ("$bin_prefix/libportaudio.v19.6.0.powerpc64le-linux-gnu.tar.gz", "de994973556bd27ac96a02be4ca1f809650de5b4e714492e02bce414cae6f34b"), MacOS(:x86_64) => ("$bin_prefix/libportaudio.v19.6.0.x86_64-apple-darwin14.tar.gz", "406961f35083944e5503dd6a51385c18dfac7969aaa2593e37c1907e353032b7"), Linux(:x86_64, libc=:glibc) => ("$bin_prefix/libportaudio.v19.6.0.x86_64-linux-gnu.tar.gz", "bfb31ffd54fa48802f9af31ecbbae07506baaee52880e6d458a192ea0d6d6a21"), Windows(:x86_64) => ("$bin_prefix/libportaudio.v19.6.0.x86_64-w64-mingw32.tar.gz", "ebd73c312836a1370137335faaa45dee484a50adb183790fa488e7799ebe2299"), ) # 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!") 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)