From 5631c854aaf5fbcf7006b226019b277afbd676e8 Mon Sep 17 00:00:00 2001 From: Helge Eichhorn Date: Mon, 3 Aug 2020 11:41:28 +0200 Subject: [PATCH] Use JLL package (#14) * Use JLL package * Bump version * Bump CI * Drop Cirrus * Remove Libdl dep * Update CI * Update CI --- .cirrus.yml | 17 ----------------- .travis.yml | 7 ++++--- Project.toml | 8 ++++---- appveyor.yml | 2 +- deps/build.jl | 48 ------------------------------------------------ src/SPICE.jl | 9 ++------- 6 files changed, 11 insertions(+), 80 deletions(-) delete mode 100644 .cirrus.yml delete mode 100644 deps/build.jl diff --git a/.cirrus.yml b/.cirrus.yml deleted file mode 100644 index 7cf32ea..0000000 --- a/.cirrus.yml +++ /dev/null @@ -1,17 +0,0 @@ -freebsd_instance: - image: freebsd-12-0-release-amd64 -freebsd_test_task: - env: - matrix: - - JULIA_VERSION: "1.0" - install_script: - - pkg install -y curl - - mkdir -p ~/julia - - curl -s -L --retry 7 "https://julialang-s3.julialang.org/bin/freebsd/x64/${JULIA_VERSION}/julia-${JULIA_VERSION}-latest-freebsd-x86_64.tar.gz" | tar -C ~/julia -x -z --strip-components=1 -f - - - ln -s "${HOME}/julia/bin/julia" /usr/local/bin/julia - - julia --color=yes -e "using InteractiveUtils; versioninfo()" - build_script: - - julia --color=yes -e "using Pkg; Pkg.add(PackageSpec(name=\"SPICE\", path=pwd()))" - - julia --color=yes -e "using Pkg; Pkg.build(\"SPICE\")" - test_script: - - julia --color=yes -e "using Pkg; Pkg.test(\"SPICE\")" diff --git a/.travis.yml b/.travis.yml index abf29ac..f26873b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,9 +2,10 @@ language: julia os: - linux - osx + - freebsd julia: - - 1.0 - - 1.1 + - 1 + - 1.3 - nightly matrix: allow_failures: @@ -22,7 +23,7 @@ after_success: jobs: include: - stage: "Documentation" - julia: 1.0 + julia: 1 os: linux script: - julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.build("SPICE"); Pkg.instantiate()' diff --git a/Project.toml b/Project.toml index 61c56a7..1091b50 100644 --- a/Project.toml +++ b/Project.toml @@ -1,14 +1,14 @@ name = "SPICE" uuid = "5bab7191-041a-5c2e-a744-024b9c3a5062" -version = "0.1.1" +version = "0.2.0" [deps] -BinaryProvider = "b99e7846-7c00-51b0-8f62-c81ae34c0232" -Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb" +CSPICE_jll = "07f52509-e9d9-513c-a20d-3b911885bf96" LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" [compat] -julia = "≥ 0.7.0" +CSPICE_jll = "66" +julia = "1.3" [extras] LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" diff --git a/appveyor.yml b/appveyor.yml index 00c1417..d225044 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,7 +1,7 @@ environment: matrix: - julia_version: 1 - - julia_version: 1.1 + - julia_version: 1.3 - julia_version: nightly platform: diff --git a/deps/build.jl b/deps/build.jl deleted file mode 100644 index 7c6815a..0000000 --- a/deps/build.jl +++ /dev/null @@ -1,48 +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, ["libcspice"], :libcspice), -] - -# Download binaries from hosted location -bin_prefix = "https://github.com/JuliaAstro/SPICEBuilder/releases/download/N0066" - -# Listing of files generated by BinaryBuilder: -download_info = Dict( - Linux(:aarch64, libc=:glibc) => ("$bin_prefix/cspice.v66.0.0.aarch64-linux-gnu.tar.gz", "437c4fc29b01220dd35595bb5df312a57909975deefb007207a55f2bedce416a"), - Linux(:aarch64, libc=:musl) => ("$bin_prefix/cspice.v66.0.0.aarch64-linux-musl.tar.gz", "cb9df212753b417c177d2b030b26b978415ea4088d4a763781df23d145ad8fe3"), - Linux(:armv7l, libc=:glibc, call_abi=:eabihf) => ("$bin_prefix/cspice.v66.0.0.arm-linux-gnueabihf.tar.gz", "f5921972058ec0c49b344980881c03db34cacf9d47d44ae24609db95bb739d05"), - Linux(:armv7l, libc=:musl, call_abi=:eabihf) => ("$bin_prefix/cspice.v66.0.0.arm-linux-musleabihf.tar.gz", "2123aef8b965372b70ff629d3e34318ade82fc7c6209d9f9c78572b528057a1c"), - Linux(:i686, libc=:glibc) => ("$bin_prefix/cspice.v66.0.0.i686-linux-gnu.tar.gz", "b9b5d98aada742aafba8407314abab12507a08ccea25ba704a7aaffa016d0031"), - Linux(:i686, libc=:musl) => ("$bin_prefix/cspice.v66.0.0.i686-linux-musl.tar.gz", "257327d017ea3e68f3351b9b6a31ede0f6880e7caf880c80f3616b3c8c6749f7"), - Windows(:i686) => ("$bin_prefix/cspice.v66.0.0.i686-w64-mingw32.tar.gz", "a0f0d4045d6e6b6899e8259760429716c1a3c2889c980d824d40e22da454efca"), - Linux(:powerpc64le, libc=:glibc) => ("$bin_prefix/cspice.v66.0.0.powerpc64le-linux-gnu.tar.gz", "de8589fe16e44a42b6394da7c1a6b9737c825b37ff3d6cf05ef0bb9bf3494736"), - MacOS(:x86_64) => ("$bin_prefix/cspice.v66.0.0.x86_64-apple-darwin14.tar.gz", "4d003aa29c2e2dae574f7aa58854afa423eaaf0d87693cb79daa485e063116d6"), - Linux(:x86_64, libc=:glibc) => ("$bin_prefix/cspice.v66.0.0.x86_64-linux-gnu.tar.gz", "d5a06aa62f50345063e767b22470a5f44af3ee28d9f2985f528322e188b8839e"), - Linux(:x86_64, libc=:musl) => ("$bin_prefix/cspice.v66.0.0.x86_64-linux-musl.tar.gz", "6e618e7a4e89481d786ea333762afb0c6e88dec2244a37016c0ba2feff0faca2"), - FreeBSD(:x86_64) => ("$bin_prefix/cspice.v66.0.0.x86_64-unknown-freebsd11.1.tar.gz", "a22831018f7fffbfd08fce0ed935009c53bb31fb50276d6eb87fcaf2d105eda5"), - Windows(:x86_64) => ("$bin_prefix/cspice.v66.0.0.x86_64-w64-mingw32.tar.gz", "758d5b08bc9e35c7ad15c062c5275899ed2b6e4ab7b6eb2eaa188b3ccc51a129"), -) - -# 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 - -# 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) -end - -# Write out a deps.jl file that will contain mappings for our products -write_deps_file(joinpath(@__DIR__, "deps.jl"), products, verbose=verbose) diff --git a/src/SPICE.jl b/src/SPICE.jl index a63e88f..3d7c5ca 100644 --- a/src/SPICE.jl +++ b/src/SPICE.jl @@ -1,13 +1,8 @@ module SPICE -export SpiceError +using CSPICE_jll -deps = abspath(joinpath(splitdir(@__FILE__)[1], "..", "deps", "deps.jl")) -if isfile(deps) - include(deps) -else - error("libcspice was not found. Please run 'Pkg.build(\"SPICE\").") -end +export SpiceError function __init__() # Set error handling to return on error