forked from Lytol/Mongo.jl
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #29 from felipenoris/fn/refactoring
Fn/refactoring
- Loading branch information
Showing
13 changed files
with
145 additions
and
122 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,9 @@ | ||
*.cov | ||
*.jl.cov | ||
*.jl.*.cov | ||
*.jl.mem | ||
/deps/build.log | ||
/deps/deps.jl | ||
/deps/usr/ | ||
/docs/build/ | ||
/docs/site/ | ||
/docs/out.xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
julia 0.5 | ||
LibBSON 0.2.8 | ||
BinDeps 0.4 | ||
Compat 0.9 | ||
@osx Homebrew | ||
julia 0.6 0.7 | ||
LibBSON | ||
BinaryProvider |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,40 @@ | ||
using BinDeps | ||
|
||
@BinDeps.setup | ||
using BinaryProvider # requires BinaryProvider 0.3.0 or later | ||
|
||
libmongoc = library_dependency( | ||
"libmongoc", | ||
aliases = ["libmongoc", "libmongoc-1.0"] | ||
) | ||
# 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, String["libmongoc"], :libmongoc), | ||
] | ||
|
||
provides(Sources, Dict( | ||
URI("http://github.com/mongodb/mongo-c-driver/releases/download/1.0.0/mongo-c-driver-1.0.0.tar.gz") => libmongoc | ||
)) | ||
# Download binaries from hosted location | ||
bin_prefix = "https://github.com/felipenoris/mongo-c-driver-builder/releases/download/v1.9.5" | ||
|
||
provides( | ||
BuildProcess, | ||
Autotools(libtarget = "libmongoc-1.0.la"), | ||
libmongoc, | ||
os = :Unix | ||
) | ||
|
||
@static if is_apple() | ||
using Homebrew | ||
provides(Homebrew.HB, Dict("mongo-c-driver" => libmongoc)) | ||
# Listing of files generated by BinaryBuilder: | ||
download_info = Dict( | ||
Linux(:aarch64, :glibc) => ("$bin_prefix/libmongoc.v1.9.5.aarch64-linux-gnu.tar.gz", "3bcad8b9004e7ca498db6ef58e7c12819b47b316b1bbfc30c017968d6a086c94"), | ||
Linux(:armv7l, :glibc, :eabihf) => ("$bin_prefix/libmongoc.v1.9.5.arm-linux-gnueabihf.tar.gz", "5c329679e4206a10c43a4b447c29e1fe9601ad4023d48c805ebaa4cc75ec1e06"), | ||
Linux(:powerpc64le, :glibc) => ("$bin_prefix/libmongoc.v1.9.5.powerpc64le-linux-gnu.tar.gz", "9f786c54e33986eddf2132b2ea35f967416246e4d5e098ee468d8cc2e98e7111"), | ||
MacOS(:x86_64) => ("$bin_prefix/libmongoc.v1.9.5.x86_64-apple-darwin14.tar.gz", "465a4628d18f0485772e79214ec916af0c934eea5534e0d2ebac9b6e78e2f3a0"), | ||
Linux(:x86_64, :glibc) => ("$bin_prefix/libmongoc.v1.9.5.x86_64-linux-gnu.tar.gz", "3b9a4464c2eac6b7a98dd295b42f3a7793238d11b9e9f6ce5b4e8b3b0859aa86"), | ||
FreeBSD(:x86_64) => ("$bin_prefix/libmongoc.v1.9.5.x86_64-unknown-freebsd11.1.tar.gz", "d4737348d786f094710dc7e94ca6e9363252c2d002a9c502aaab85a77177c1d4"), | ||
) | ||
|
||
# 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) | ||
# Download and install binaries | ||
install(url, tarball_hash; prefix=prefix, force=true, verbose=verbose) | ||
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 | ||
|
||
@BinDeps.install Dict(:libmongoc => :libmongoc) | ||
# Write out a deps.jl file that will contain mappings for our products | ||
write_deps_file(joinpath(@__DIR__, "deps.jl"), products, verbose=verbose) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.