|
| 1 | +using BinaryProvider |
| 2 | + |
| 3 | +# Parse some basic command-line arguments |
| 4 | +const verbose = "--verbose" in ARGS |
| 5 | +const prefix = Prefix(get([a for a in ARGS if a != "--verbose"], 1, joinpath(@__DIR__, "usr"))) |
| 6 | +products = Product[ |
| 7 | + LibraryProduct(prefix, String["libmariadb"], :libmariadb), |
| 8 | +] |
| 9 | + |
| 10 | +# Download binaries from hosted location |
| 11 | +bin_prefix = "https://github.com/JuliaDatabases/MySQLBuilder/releases/download/v0.20" |
| 12 | + |
| 13 | +# Listing of files generated by BinaryBuilder: |
| 14 | +download_info = Dict( |
| 15 | + BinaryProvider.Linux(:aarch64, :glibc) => ("$bin_prefix/MySQL.aarch64-linux-gnu.tar.gz", "d64387bb5fcaee52c3f5a826d49a9ed67b21799df44c77e0cb20bead1c72076a"), |
| 16 | + BinaryProvider.Linux(:armv7l, :glibc) => ("$bin_prefix/MySQL.arm-linux-gnueabihf.tar.gz", "413aa31791ddb88f074528fb0dabe5158a5aa72a92008aabbd440392dd3ec8ee"), |
| 17 | + BinaryProvider.Linux(:i686, :glibc) => ("$bin_prefix/MySQL.i686-linux-gnu.tar.gz", "c74e646ed02b91113bef5d51d81dd38600dbb91568679bdfdeebfeb3c455ad9c"), |
| 18 | + BinaryProvider.Linux(:powerpc64le, :glibc) => ("$bin_prefix/MySQL.powerpc64le-linux-gnu.tar.gz", "5c610ecacb736a41b2eba747192bbab95f54ff8a3622412c58308e2951d17dff"), |
| 19 | + BinaryProvider.MacOS() => ("$bin_prefix/MySQL.x86_64-apple-darwin14.tar.gz", "7980bed3b89fbf2f043a64871166df48d3c0b73436af9da0b2cd539a889daee5"), |
| 20 | + BinaryProvider.Linux(:x86_64, :glibc) => ("$bin_prefix/MySQL.x86_64-linux-gnu.tar.gz", "482a1abb9e594af99c7dd43ddf8898ab41192d2686aaf85535993e63ff6aafd5"), |
| 21 | + |
| 22 | + BinaryProvider.Windows(:i686) => ("$bin_prefix/MySQL.i686-w64-mingw32.tar.gz", "8f391c46b412c51298192955840268b296a751a0b07e66ca7951cade27bdf667"), |
| 23 | + BinaryProvider.Windows(:x86_64) => ("$bin_prefix/MySQL.x86_64-w64-mingw32.tar.gz", "f80694f5bb756240fa04965c02c2820005bac9d452045c43f77bbc944236025f"), |
| 24 | +) |
| 25 | + |
| 26 | +# First, check to see if we're all satisfied |
| 27 | +if any(!satisfied(p; verbose=verbose) for p in products) |
| 28 | + if haskey(download_info, platform_key()) |
| 29 | + # Download and install binaries |
| 30 | + url, tarball_hash = download_info[platform_key()] |
| 31 | + install(url, tarball_hash; prefix=prefix, force=true, verbose=verbose) |
| 32 | + else |
| 33 | + # If we don't have a BinaryProvider-compatible .tar.gz to download, complain. |
| 34 | + # Alternatively, you could attempt to install from a separate provider, |
| 35 | + # build from source or something more even more ambitious here. |
| 36 | + error("Your platform $(Sys.MACHINE) is not supported by this package!") |
| 37 | + end |
| 38 | +end |
| 39 | + |
| 40 | +# Write out a deps.jl file that will contain mappings for our products |
| 41 | +write_deps_file(joinpath(@__DIR__, "deps.jl"), products) |
0 commit comments