diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2251642 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +Manifest.toml \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index 1c5329c..e6a7259 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,8 +4,7 @@ os: - linux - osx julia: - - 0.7 - - 1.0 + - 1.3 - nightly matrix: allow_failures: diff --git a/Project.toml b/Project.toml new file mode 100644 index 0000000..dcc595b --- /dev/null +++ b/Project.toml @@ -0,0 +1,17 @@ +name = "Snappy" +uuid = "59d4ed8c-697a-5b28-a4c7-fe95c22820f9" +authors = ["Kenta Sato "] +version = "0.4.0" + +[deps] +snappy_jll = "fe1e1685-f7be-5f59-ac9f-4ca204017dfd" + +[compat] +julia = "1.3" + +[extras] +Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" +Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" + +[targets] +test = ["Test", "Random"] diff --git a/REQUIRE b/REQUIRE deleted file mode 100644 index 7a1f688..0000000 --- a/REQUIRE +++ /dev/null @@ -1,2 +0,0 @@ -julia 0.7 -BinaryProvider 0.4.0 diff --git a/appveyor.yml b/appveyor.yml index c2588f1..9abeb59 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,7 +1,6 @@ environment: matrix: - - julia_version: 0.7 - - julia_version: 1 + - julia_version: 1.3 - julia_version: nightly platform: diff --git a/deps/.gitignore b/deps/.gitignore deleted file mode 100644 index 098bf86..0000000 --- a/deps/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -deps.jl -downloads -src -usr -builds -build.log diff --git a/deps/build.jl b/deps/build.jl deleted file mode 100644 index eea9893..0000000 --- a/deps/build.jl +++ /dev/null @@ -1,38 +0,0 @@ -using BinaryProvider - -# This is where all binaries will get installed -const prefix = Prefix(!isempty(ARGS) ? ARGS[1] : joinpath(@__DIR__,"usr")) -libsnappy = LibraryProduct(prefix, "libsnappy", :libsnappy) -products = [libsnappy] - -# Download binaries from hosted location -bin_prefix = "https://github.com/davidanthoff/SnappyBuilder/releases/download/v1.1.7%2Bbuild.1" - -# Listing of files generated by BinaryBuilder: -download_info = Dict( - Linux(:aarch64) => ("$bin_prefix/SnappyBuilder.aarch64-linux-gnu.tar.gz", "8cb4b9af85da7efa20bc4787ea16af4b76123d790590bfd447cbe092f123f2f8"), - Linux(:armv7l) => ("$bin_prefix/SnappyBuilder.arm-linux-gnueabihf.tar.gz", "67469c1ce2391e65c3d9f5f8162f0e14f69ce0e19af0389ad8d77226bf79a922"), - Linux(:i686) => ("$bin_prefix/SnappyBuilder.i686-linux-gnu.tar.gz", "f34512ca97f500cdaeeea19aeb3e3075b3aa2b4342cf3a5a3788c77eb634f0bd"), - Windows(:i686) => ("$bin_prefix/SnappyBuilder.i686-w64-mingw32.tar.gz", "53a28428e5c3d75bef1b2ce90b8af8905177b7dae313c8a859afe24c7c9571dd"), - Linux(:powerpc64le) => ("$bin_prefix/SnappyBuilder.powerpc64le-linux-gnu.tar.gz", "32ecdd9185c2f39e2c95db9e8adb2adf8f251d65c0a8e43c0ee6ec46778045cb"), - MacOS() => ("$bin_prefix/SnappyBuilder.x86_64-apple-darwin14.tar.gz", "8fe643e462799ce141b4d306427f73b2a373651282cdfabcaeb976e705069b7c"), - Linux(:x86_64) => ("$bin_prefix/SnappyBuilder.x86_64-linux-gnu.tar.gz", "9a45685503de0db44068126d67f49e241f9013970ddc560cfd7ba17b411dac8c"), - Windows(:x86_64) => ("$bin_prefix/SnappyBuilder.x86_64-w64-mingw32.tar.gz", "1c13a31c23225b812ee477dffa1fc77d6f501c0a3b65a9920edf5aa4a76f4475"), -) - -# First, check to see if we're all satisfied -if any(!satisfied(p; verbose=true) for p in products) - if haskey(download_info, platform_key()) - # Download and install binaries - url, tarball_hash = download_info[platform_key()] - install(url, tarball_hash; prefix=prefix, force=true, verbose=true) - else - # 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 more even more ambitious here. - error("Your platform $(triplet(platform_key())) is not supported by this package!") - end -end - -# Write out a deps.jl file that will contain mappings for our products -write_deps_file(joinpath(@__DIR__, "deps.jl"), products) diff --git a/src/Snappy.jl b/src/Snappy.jl index f38db56..2ccd3a4 100644 --- a/src/Snappy.jl +++ b/src/Snappy.jl @@ -1,13 +1,7 @@ -__precompile__() - module Snappy # Load libsnappy from our deps.jl -const depsjl_path = joinpath(dirname(@__FILE__), "..", "deps", "deps.jl") -if !isfile(depsjl_path) - error("Snappy not installed properly, run Pkg.build(\"Snappy\"), restart Julia and try again") -end -include(depsjl_path) +using snappy_jll export compress, uncompress @@ -16,10 +10,6 @@ const SnappyOK = Cint(0) const SnappyInvalidInput = Cint(1) const SnappyBufferTooSmall = Cint(2) -function __init__() - check_deps() -end - # High-level Interfaces function compress(input::Vector{UInt8})