Skip to content

Commit

Permalink
Merge pull request #1 from giordano/bb3
Browse files Browse the repository at this point in the history
new 'form' of build.jl
  • Loading branch information
lobingera authored Aug 30, 2019
2 parents 351f80b + 0e7d5fe commit 51d48cb
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 286 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ test/test_results
.DS_Store
*~
deps/build.log
deps/build_*.jl
2 changes: 0 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@ uuid = "159f3aea-2a34-519c-b102-8c37f9878175"
version = "0.6.0"

[deps]
BinaryBuilder = "12aac903-9f7c-5d81-afc2-d9565ea332ae"
BinaryProvider = "b99e7846-7c00-51b0-8f62-c81ae34c0232"
Colors = "5ae59095-9a9b-59fe-a467-6f913c188581"
Compat = "34da2185-b29b-5c13-b0c7-acf172513d20"
Graphics = "a2bd30eb-e257-5431-a919-1863eab51364"
Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb"
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"

[compat]
Compat = "≥ 0.52.0"
Expand Down
63 changes: 0 additions & 63 deletions deps/build-229.jl

This file was deleted.

59 changes: 23 additions & 36 deletions deps/build.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,46 +3,33 @@ 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, ["libcairo"], :libcairo),

# These are the two binary objects we care about
products = Product[
LibraryProduct(prefix, "libcairo", :libcairo),
]

# Download binaries from hosted location
bin_prefix = "https://github.com/giordano/Yggdrasil/releases/download/Cairo-v1.14.12"
dependencies = [
"https://github.com/bicycle1885/ZlibBuilder/releases/download/v1.0.4/build_Zlib.v1.2.11.jl",
"https://github.com/JuliaIO/LibpngBuilder/releases/download/v1.0.3/build_libpng.v1.6.37.jl",
"https://github.com/JuliaPackaging/Yggdrasil/releases/download/Pixman-v0.36.0-0/build_Pixman.v0.36.0.jl",
"https://github.com/JuliaPackaging/Yggdrasil/releases/download/Bzip2-v1.0.6-2/build_Bzip2.v1.0.6.jl",
"https://github.com/JuliaGraphics/FreeTypeBuilder/releases/download/v2.9.1-4/build_FreeType2.v2.10.0.jl",
"https://github.com/giordano/Yggdrasil/releases/download/X11-v1.6.8/build_X11.v1.6.8.jl",
"https://github.com/giordano/Yggdrasil/releases/download/Cairo-v1.14.12/build_Cairo.v1.14.12.jl",
]

# Listing of files generated by BinaryBuilder:
download_info = Dict(
Linux(:aarch64, libc=:glibc) => ("$bin_prefix/Cairo.v1.14.12.aarch64-linux-gnu.tar.gz", "f5e3a0f4face5142ce8273d25a614452864034077dd840c50ccfb17322f18adf"),
Linux(:aarch64, libc=:musl) => ("$bin_prefix/Cairo.v1.14.12.aarch64-linux-musl.tar.gz", "f9fcf6750090c3e964c38b06866635163389fdfba0dd4d781e5fb279624b9b3d"),
Linux(:armv7l, libc=:glibc, call_abi=:eabihf) => ("$bin_prefix/Cairo.v1.14.12.arm-linux-gnueabihf.tar.gz", "804ee9f98b26c5a4a26f0ecfe4abaabf5dbf79f4d7c1486e4ceaadd34ac38033"),
Linux(:armv7l, libc=:musl, call_abi=:eabihf) => ("$bin_prefix/Cairo.v1.14.12.arm-linux-musleabihf.tar.gz", "c66e446884509180440f24893b51a39345346ba9cefbf9a8a04ce1de4ed25d98"),
Linux(:i686, libc=:glibc) => ("$bin_prefix/Cairo.v1.14.12.i686-linux-gnu.tar.gz", "d4fafd44b5f1301786fc4ddf63fe71ac9e942891dde7f07efb1ee2d6b28b2c6c"),
Linux(:i686, libc=:musl) => ("$bin_prefix/Cairo.v1.14.12.i686-linux-musl.tar.gz", "1fefd232b6238b2718f8ab73bbbb222eae51dd5c157549fb1749f70243aca77f"),
Windows(:i686) => ("$bin_prefix/Cairo.v1.14.12.i686-w64-mingw32.tar.gz", "1f39115d7c99d102e05edc7eb19db88b4456a4940d3a46ee2151092a6fe862ee"),
Linux(:powerpc64le, libc=:glibc) => ("$bin_prefix/Cairo.v1.14.12.powerpc64le-linux-gnu.tar.gz", "28517b9460af7cdf25c7fd20d88a9277e00261b6c451179fb6db9edb01c7b8bf"),
MacOS(:x86_64) => ("$bin_prefix/Cairo.v1.14.12.x86_64-apple-darwin14.tar.gz", "aa1b2a45191ad3b24745f4a5c9eea18c3ef125d67746a29e677f531c806d9cf9"),
Linux(:x86_64, libc=:glibc) => ("$bin_prefix/Cairo.v1.14.12.x86_64-linux-gnu.tar.gz", "c24b27be757123e795ace83b44d4d1110951e6662d7489817bb36ca98f7d3923"),
Linux(:x86_64, libc=:musl) => ("$bin_prefix/Cairo.v1.14.12.x86_64-linux-musl.tar.gz", "6c286983562052ac5fc6dbc47d30155d97258257c027215f4a1a34ef59ec7e5a"),
FreeBSD(:x86_64) => ("$bin_prefix/Cairo.v1.14.12.x86_64-unknown-freebsd11.1.tar.gz", "6ea14fcf72852c421f81b3acd6b7bb657071a10f484311205862381b746e2135"),
Windows(:x86_64) => ("$bin_prefix/Cairo.v1.14.12.x86_64-w64-mingw32.tar.gz", "4cdfc0c08af8bcce3529ae13ecee6826acc9a25585151c84a7f6bdfb93200281"),
)

# 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
for dependency in dependencies
file = joinpath(@__DIR__, basename(dependency))
isfile(file) || download(dependency, file)
# it's a bit faster to run the build in an anonymous module instead of
# starting a new julia process

# 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)
# Build the dependencies
Mod = @eval module Anon end
Mod.include(file)
end

# Write out a deps.jl file that will contain mappings for our products
write_deps_file(joinpath(@__DIR__, "deps.jl"), products, verbose=verbose)
# Finally, write out a deps.jl file
write_deps_file(joinpath(@__DIR__, "deps.jl"), products)
46 changes: 0 additions & 46 deletions deps/build_FreeType2.v2.9.0.jl

This file was deleted.

46 changes: 0 additions & 46 deletions deps/build_Pixman.v0.34.0.jl

This file was deleted.

46 changes: 0 additions & 46 deletions deps/build_Zlib.v1.2.11.jl

This file was deleted.

Loading

0 comments on commit 51d48cb

Please sign in to comment.