From 69f1a09a7109c33ca48cd65c15f96cb34bfbf3d5 Mon Sep 17 00:00:00 2001 From: Maarten Pronk Date: Mon, 25 May 2020 19:51:53 +0000 Subject: [PATCH] New build system. (#21) * New build system. * Fixed comments by @visr. --- .travis.yml | 2 +- Project.toml | 7 +++---- appveyor.yml | 14 ++++---------- deps/build.jl | 38 -------------------------------------- src/LazIO.jl | 10 +--------- 5 files changed, 9 insertions(+), 62 deletions(-) delete mode 100644 deps/build.jl diff --git a/.travis.yml b/.travis.yml index c7ea17e..248867e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,7 +5,7 @@ os: - osx julia: - - 1.0 + - 1.3 - 1 - nightly diff --git a/Project.toml b/Project.toml index 3c181a1..e614b42 100644 --- a/Project.toml +++ b/Project.toml @@ -1,12 +1,12 @@ name = "LazIO" uuid = "c3605908-9f0f-11e8-0a72-0d361c15a277" authors = ["Maarten Pronk "] -version = "0.1.4" +version = "0.2.0" [deps] -BinaryProvider = "b99e7846-7c00-51b0-8f62-c81ae34c0232" FileIO = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549" FixedPointNumbers = "53c48c17-4a7d-5ca2-90c5-79b7896eea93" +LASzip_jll = "8372b9c3-1e34-5cc3-bfab-1a98e101de11" LasIO = "570499db-eae3-5eb6-bdd5-a5326f375e68" Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb" Parameters = "d96e819e-fc66-5662-9728-84c9c7592b0a" @@ -14,13 +14,12 @@ Tables = "bd369af6-aec1-5ad0-b16a-f7cc5008161c" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [compat] -BinaryProvider = "0.5" FileIO = "1.2" FixedPointNumbers = "0.5, 0.6, 0.7, 0.8" LasIO = "0.3" Parameters = "0.12" Tables = "0.2, 1.0" -julia = "1.0" +julia = "1.3" [extras] Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" diff --git a/appveyor.yml b/appveyor.yml index a0b994f..66aaf27 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,8 +1,8 @@ environment: matrix: - - julia_version: 1.0 - - julia_version: 1 - - julia_version: nightly + - julia_version: 1.3 + - julia_version: 1 + - julia_version: nightly platform: - x64 @@ -10,7 +10,7 @@ platform: matrix: allow_failures: - - julia_version: nightly + - julia_version: nightly branches: only: @@ -33,9 +33,3 @@ build_script: test_script: - echo "%JL_TEST_SCRIPT%" - C:\julia\bin\julia -e "%JL_TEST_SCRIPT%" - -# # Uncomment to support code coverage upload. Should only be enabled for packages -# # which would have coverage gaps without running on Windows -# on_success: -# - echo "%JL_CODECOV_SCRIPT%" -# - C:\julia\bin\julia -e "%JL_CODECOV_SCRIPT%" diff --git a/deps/build.jl b/deps/build.jl deleted file mode 100644 index 074d22a..0000000 --- a/deps/build.jl +++ /dev/null @@ -1,38 +0,0 @@ -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, String["liblaszip"], :liblaszip), -] - -# Download binaries from hosted location -bin_prefix = "https://github.com/evetion/LASzipBuilder/releases/download/v0.2.1" - -# Listing of files generated by BinaryBuilder: -download_info = Dict( - Linux(:i686, :glibc) => ("$bin_prefix/LASzipBuilder.v1.0.0.i686-linux-gnu.tar.gz", "e3fdff3fad8ac7da9296727b5eaf5a2c91003e86c77f513d538776dbcd5364aa"), - Windows(:i686) => ("$bin_prefix/LASzipBuilder.v1.0.0.i686-w64-mingw32.tar.gz", "0ecc9ba50849d732993bd2a713a5fa1d91b50b2904687afe163391cf782a95f3"), - MacOS(:x86_64) => ("$bin_prefix/LASzipBuilder.v1.0.0.x86_64-apple-darwin14.tar.gz", "3a1f0df325702388fee67194485956d29b51315ca3a9a02320fa2bd7e3950666"), - Linux(:x86_64, :glibc) => ("$bin_prefix/LASzipBuilder.v1.0.0.x86_64-linux-gnu.tar.gz", "4d3545b66e5914303d9f71cdf11121dd153733d9828a975934333067e1b1bfbe"), - Windows(:x86_64) => ("$bin_prefix/LASzipBuilder.v1.0.0.x86_64-w64-mingw32.tar.gz", "27af7cfa2776073561b9a8987e1ef4da7f00c6dbc0c7a95db59c14b98f47de83"), -) - -# 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 - -# 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/LazIO.jl b/src/LazIO.jl index fad2f5f..3b8fe91 100644 --- a/src/LazIO.jl +++ b/src/LazIO.jl @@ -4,18 +4,10 @@ using Libdl using FileIO using LasIO using FixedPointNumbers - -# Load in `deps.jl`, complaining if it does not exist -const depsjl_path = joinpath(dirname(@__FILE__), "..", "deps", "deps.jl") -if !isfile(depsjl_path) - error("LazIO not installed properly, run Pkg.build(\"LazIO\"), restart Julia and try again") -end -include(depsjl_path) +using LASzip_jll # Module initialization function function __init__() - # Always check your dependencies from `deps.jl` - check_deps() # temporary _ until LasIO defers this key add_format(format"LAZ_", (), ".laz", [:LazIO]) end