-
Notifications
You must be signed in to change notification settings - Fork 17
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 JuliaGeometry/master
use binarybuilder/provider cross compilation
- Loading branch information
Showing
11 changed files
with
115 additions
and
5,374 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 |
---|---|---|
|
@@ -11,3 +11,5 @@ test/config | |
*.exp | ||
*.o | ||
*.so | ||
deps/usr | ||
deps/deps.jl |
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,30 +1,24 @@ | ||
# Documentation: http://docs.travis-ci.com/user/languages/julia/ | ||
language: julia | ||
os: | ||
- linux | ||
- osx | ||
env: | ||
- CXX=g++-4.8 | ||
addons: | ||
apt: | ||
sources: | ||
- ubuntu-toolchain-r-test | ||
packages: | ||
- g++-4.8 | ||
sudo: required | ||
install: | ||
- | | ||
if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then | ||
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 20 | ||
g++ --version | ||
fi | ||
|
||
julia: | ||
- 0.5 | ||
- 0.6 | ||
- nightly | ||
- 0.7 | ||
|
||
matrix: | ||
allow_failures: | ||
- julia: 0.7 | ||
|
||
notifications: | ||
email: false | ||
# uncomment the following lines to override the default test script | ||
#script: | ||
# - if [[ -a .git/shallow ]]; then git fetch --unshallow; fi | ||
# - julia -e 'Pkg.clone(pwd()); Pkg.build("Clipper"); Pkg.test("Clipper"; coverage=true)' | ||
sudo: false | ||
======= | ||
git: | ||
depth: 99999999 | ||
## uncomment the following lines to allow failures on nightly julia | ||
## (tests will run but not make your overall status red) | ||
matrix: | ||
allow_failures: | ||
- julia: nightly |
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,2 +1,2 @@ | ||
@windows WinRPM | ||
julia 0.5 | ||
julia 0.6 | ||
BinaryProvider |
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,40 +1,46 @@ | ||
#! /usr/bin/env julia | ||
using BinaryProvider # requires BinaryProvider 0.3.0 or later | ||
|
||
path = joinpath(dirname(@__FILE__), "..", "src") | ||
# 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["cclipper"], :cclipper), | ||
] | ||
|
||
if is_windows() | ||
# if success(`where cl.exe`) | ||
# info("Compiling with cl.exe") | ||
# run(`cl.exe /D_USRDLL /D_WINDLL /EHsc /Fo$(path) $(path)cclipper.cpp $(path)clipper.cpp /MT /link /DLL /OUT:$(path)cclipper.dll`) | ||
# else | ||
import WinRPM | ||
info("Compiling with WinRPM gcc-c++") | ||
WinRPM.install("gcc-c++"; yes = true) | ||
WinRPM.install("gcc"; yes = true) | ||
WinRPM.install("headers"; yes = true) | ||
WinRPM.install("winpthreads-devel"; yes = true) | ||
# Download binaries from hosted location | ||
bin_prefix = "https://github.com/SimonDanisch/ClipperBuilder/releases/download/v1.0.0" | ||
|
||
gpp = Pkg.dir("WinRPM","deps","usr","x86_64-w64-mingw32","sys-root","mingw","bin","g++") | ||
RPMbindir = Pkg.dir("WinRPM","deps","usr","x86_64-w64-mingw32","sys-root","mingw","bin") | ||
incdir = Pkg.dir("WinRPM","deps","usr","x86_64-w64-mingw32","sys-root","mingw","include") | ||
# Listing of files generated by BinaryBuilder: | ||
download_info = Dict( | ||
Linux(:aarch64, :glibc) => ("$bin_prefix/Clipper.v1.0.0.aarch64-linux-gnu.tar.gz", "8257bdcb54563f2effbd1ea484be39437e245a01bd1badb93706625599019581"), | ||
Linux(:aarch64, :musl) => ("$bin_prefix/Clipper.v1.0.0.aarch64-linux-musl.tar.gz", "2967e0e6a400053f01fcaf6ea3c214342c346c627ef1d11343088d8dae8211d2"), | ||
Linux(:armv7l, :glibc, :eabihf) => ("$bin_prefix/Clipper.v1.0.0.arm-linux-gnueabihf.tar.gz", "a03c2e0455af89eeefcd4f5ca22ed72db47ee5718c7b815a347221ab2692da2a"), | ||
Linux(:armv7l, :musl, :eabihf) => ("$bin_prefix/Clipper.v1.0.0.arm-linux-musleabihf.tar.gz", "49d14834c9817e4d877bd6facd33bf242f394e82af5a6c711c063e4aa225131e"), | ||
Linux(:i686, :glibc) => ("$bin_prefix/Clipper.v1.0.0.i686-linux-gnu.tar.gz", "8bbdf10ba64b039d5172b5362f3048fec329b048c21e385a2c8feea78fc62c11"), | ||
Linux(:i686, :musl) => ("$bin_prefix/Clipper.v1.0.0.i686-linux-musl.tar.gz", "bf1e3a62bbf6cc8ea871b242d89dfa12477313a7ad990c1a930f83e18dd075f5"), | ||
Windows(:i686) => ("$bin_prefix/Clipper.v1.0.0.i686-w64-mingw32.tar.gz", "320ac5a275f33943421df9123e74344c59eeb20bc0c89de73501a83924be1453"), | ||
Linux(:powerpc64le, :glibc) => ("$bin_prefix/Clipper.v1.0.0.powerpc64le-linux-gnu.tar.gz", "ee312d90ceb0ec87092a502014d1d3e56d735186fa728c3cc77088145d6f9ce9"), | ||
MacOS(:x86_64) => ("$bin_prefix/Clipper.v1.0.0.x86_64-apple-darwin14.tar.gz", "0ddc80a5a9d8be456facc92fadddde6755d1aa9d5d9cea8095f69dcc6adec1ba"), | ||
Linux(:x86_64, :glibc) => ("$bin_prefix/Clipper.v1.0.0.x86_64-linux-gnu.tar.gz", "0883bcac9afb68d2ffb822453727ad9fe309a088f9192dd13c26654100d39c57"), | ||
Linux(:x86_64, :musl) => ("$bin_prefix/Clipper.v1.0.0.x86_64-linux-musl.tar.gz", "fd61e7319a79d6a9d32d1c7ad72302d313ca20756472a21a7bae8c41e942d01a"), | ||
FreeBSD(:x86_64) => ("$bin_prefix/Clipper.v1.0.0.x86_64-unknown-freebsd11.1.tar.gz", "39a010ff1d9007641524c276ca9c58ddf68a9f9b4bde98b6fda84950593d385a"), | ||
Windows(:x86_64) => ("$bin_prefix/Clipper.v1.0.0.x86_64-w64-mingw32.tar.gz", "214b2ab0646e2b7fc33376480823a19481a88200a4463a240bb2a747b593a3fd"), | ||
) | ||
|
||
push!(Base.Libdl.DL_LOAD_PATH, RPMbindir) | ||
ENV["PATH"] = ENV["PATH"] * ";" * RPMbindir | ||
if success(`$gpp --version`) | ||
cd(path) do | ||
run(`$gpp -c -fPIC -std=c++11 clipper.cpp cclipper.cpp -I $incdir`) | ||
run(`$gpp -shared -o cclipper.dll clipper.o cclipper.o`) | ||
end | ||
else | ||
error("no windows c++ compiler (cl.exe) found, and WinRPM with g++ is failing as well.") | ||
end | ||
# end | ||
end | ||
|
||
if is_unix() | ||
cd(path) do | ||
# Note: on Mac OS X, g++ is aliased to clang++. | ||
run(`g++ -c -fPIC -std=c++11 clipper.cpp cclipper.cpp`) | ||
run(`g++ -shared -o cclipper.so clipper.o cclipper.o`) | ||
# 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) |
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.