Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
helgee committed Feb 2, 2018
2 parents f3f9e2d + 619af86 commit 2b84a83
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 2,037 deletions.
4 changes: 2 additions & 2 deletions REQUIRE
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
julia 0.6-
BinDeps 0.4.5
julia 0.6
BinaryProvider
6 changes: 4 additions & 2 deletions deps/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ include(src.cmake)
if(WIN32)
include(GenerateExportHeader)
endif()
include(GNUInstallDirs)

set(CMAKE_C_FLAGS "-O2 -DNON_UNIX_STDIO")

Expand All @@ -27,6 +28,7 @@ endif()

INSTALL(
TARGETS cspice
RUNTIME DESTINATION lib
LIBRARY DESTINATION lib
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
)
46 changes: 28 additions & 18 deletions deps/build.jl
Original file line number Diff line number Diff line change
@@ -1,25 +1,35 @@
using BinDeps
using BinaryProvider

@BinDeps.setup
# This is where all binaries will get installed
const prefix = Prefix(!isempty(ARGS) ? ARGS[1] : joinpath(@__DIR__,"usr"))

cspice = library_dependency("libcspice")
provides(Sources, URI("https://naif.jpl.nasa.gov/pub/naif/toolkit/C/MacIntel_OSX_AppleC_64bit/packages/cspice.tar.Z"), cspice, os=:Darwin)
provides(Sources, URI("https://naif.jpl.nasa.gov/pub/naif/toolkit/C/PC_Linux_GCC_$(Sys.WORD_SIZE)bit/packages/cspice.tar.Z"), cspice, os=:Linux)
libcspice = LibraryProduct(prefix, "libcspice")

provides(Binaries, URI("https://github.com/helgee/SPICE.jl/releases/download/N0065/libcspice$(Sys.WORD_SIZE).zip"), cspice, os=:Windows)
products = [libcspice]

prefix = joinpath(BinDeps.depsdir(cspice), "usr")
build = joinpath(BinDeps.depsdir(cspice), "build")
# Download binaries from hosted location
bin_prefix = "https://github.com/JuliaAstro/SPICEBuilder/releases/download/N0066"

provides(SimpleBuild, (@build_steps begin
GetSources(cspice)
CreateDirectory(build)
@build_steps begin
ChangeDirectory(build)
`cmake -DCMAKE_INSTALL_PREFIX=$prefix ..`
`cmake --build .`
`cmake --build . --target install`
# Listing of files generated by BinaryBuilder:
download_info = Dict(
BinaryProvider.Linux(:aarch64, :glibc) => ("$bin_prefix/cspice.aarch64-linux-gnu.tar.gz", "c99e1caca42d47650e832e47d9206e4667f548cbad1b863aaa03387b9cd93723"),
BinaryProvider.Linux(:armv7l, :glibc) => ("$bin_prefix/cspice.arm-linux-gnueabihf.tar.gz", "4454057c1fa433d375a0d7148403741a4d7cf40e1e7065bd0d5a0ad329a69cba"),
BinaryProvider.Linux(:i686, :glibc) => ("$bin_prefix/cspice.i686-linux-gnu.tar.gz", "5a8bbf8f307fb96e60c2089edf94e209e7af3db604e10f9f934ee1298455f220"),
BinaryProvider.Windows(:i686) => ("$bin_prefix/cspice.i686-w64-mingw32.tar.gz", "4706e18e1f8d41aa99a2e73f5e283eb0344ee7ccff1b59999c101810cba2b492"),
BinaryProvider.Linux(:powerpc64le, :glibc) => ("$bin_prefix/cspice.powerpc64le-linux-gnu.tar.gz", "72597db2801735c5786690edc5a5cc25af5e218e91dd740d4c2f777ad41000c1"),
BinaryProvider.MacOS() => ("$bin_prefix/cspice.x86_64-apple-darwin14.tar.gz", "d1f9e1c9e17c94669d0f5f5e9a353c3deb74cd4adc6cf74e204c54dd267b27a5"),
BinaryProvider.Linux(:x86_64, :glibc) => ("$bin_prefix/cspice.x86_64-linux-gnu.tar.gz", "0991482dab3eee10d56ac75e4eba6b1fdacd18532f554f31ab321b5d664b9827"),
BinaryProvider.Windows(:x86_64) => ("$bin_prefix/cspice.x86_64-w64-mingw32.tar.gz", "fb27fe7616b72c71fba1e74fec4ddd25d09fd5ef5c11df0d0fc9f5ddef7a9152"),
)
if platform_key() in keys(download_info)
# First, check to see if we're all satisfied
if any(!satisfied(p; verbose=true) for p in products)
# Download and install binaries
url, tarball_hash = download_info[platform_key()]
install(url, tarball_hash; prefix=prefix, force=true, verbose=true)
end
end), cspice, os=:Unix)

@BinDeps.install Dict(:libcspice => :libcspice)
@write_deps_file libcspice
else
error("Your platform $(Sys.MACHINE) is not supported by this package!")
end
12 changes: 0 additions & 12 deletions deps/windows/CMakeLists.txt

This file was deleted.

Loading

0 comments on commit 2b84a83

Please sign in to comment.