Skip to content

Commit

Permalink
libcxxwrap_julia: switch to libjulia (#1948)
Browse files Browse the repository at this point in the history
Also drop the restriction to the cxx11 ABI and add more platforms, and
allow building multiple versions of this targeting different Julia versions.

Co-authored-by: Bart Janssens <bart@bartjanssens.org>
Co-authored-by: Benjamin Lorenz <benlorenz@users.noreply.github.com>

Co-authored-by: Bart Janssens <bart@bartjanssens.org>
Co-authored-by: Benjamin Lorenz <benlorenz@users.noreply.github.com>
  • Loading branch information
3 people authored Nov 13, 2020
1 parent aa1cdd5 commit ee3126a
Showing 1 changed file with 25 additions and 15 deletions.
40 changes: 25 additions & 15 deletions L/libcxxwrap_julia/build_tarballs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,39 +2,49 @@
# `julia build_tarballs.jl --help` to see a usage message.
using BinaryBuilder, Pkg

julia_version = v"1.3.1"

name = "libcxxwrap_julia"
version = v"0.8.0"
version = v"0.8.2"

const is_yggdrasil = haskey(ENV, "BUILD_BUILDNUMBER")
git_repo = is_yggdrasil ? "https://github.com/JuliaInterop/libcxxwrap-julia.git" : joinpath(ENV["HOME"], "src/julia/libcxxwrap-julia/")
unpack_target = is_yggdrasil ? "" : "libcxxwrap-julia"

# Collection of sources required to complete build
sources = [
GitSource(git_repo, "30997d732f6a317348a05b4ccb777dfbcc483525", unpack_target=unpack_target),
GitSource(git_repo, "2bba0c81ea00d58d3321540a0526098aa9eb3c8b", unpack_target=unpack_target),
]

# Bash recipe for building across all platforms
script = raw"""
mkdir build
cd build
cmake -DJulia_PREFIX=$prefix -DCMAKE_INSTALL_PREFIX=$prefix -DCMAKE_FIND_ROOT_PATH=$prefix -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TARGET_TOOLCHAIN} -DCMAKE_BUILD_TYPE=Release ../libcxxwrap-julia/
cmake \
-DJulia_PREFIX=$prefix \
-DCMAKE_INSTALL_PREFIX=$prefix \
-DCMAKE_FIND_ROOT_PATH=$prefix \
-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TARGET_TOOLCHAIN} \
-DCMAKE_BUILD_TYPE=Release \
../libcxxwrap-julia/
VERBOSE=ON cmake --build . --config Release --target install -- -j${nproc}
install_license $WORKSPACE/srcdir/libcxxwrap-julia*/LICENSE.md
"""

# These are the platforms we will build for by default, unless further
# platforms are passed in on the command line
platforms = [
Platform("x86_64", "freebsd"; cxxstring_abi = "cxx11"),
Platform("armv7l", "linux"; libc="glibc", cxxstring_abi = "cxx11"),
Platform("aarch64", "linux"; libc="glibc", cxxstring_abi = "cxx11"),
Platform("x86_64", "linux"; libc="glibc", cxxstring_abi = "cxx11"),
Platform("i686", "linux"; libc="glibc", cxxstring_abi = "cxx11"),
Platform("x86_64", "macos"; cxxstring_abi = "cxx11"),
Platform("x86_64", "windows"; cxxstring_abi = "cxx11"),
Platform("i686", "windows"; cxxstring_abi = "cxx11"),
]
platforms = supported_platforms()

# skip i686 musl builds (not supported by libjulia_jll)
filter!(p -> !(Sys.islinux(p) && libc(p) == "musl" && arch(p) == "i686"), platforms)

# skip PowerPC builds in Julia 1.3 (not supported by libjulia_jll)
if julia_version < v"1.4"
filter!(p -> !(Sys.islinux(p) && arch(p) == "powerpc64le"), platforms)
end

platforms = expand_cxxstring_abis(platforms)

# The products that we will ensure are always built
products = [
Expand All @@ -44,8 +54,8 @@ products = [

# Dependencies that must be installed before this package can be built
dependencies = [
BuildDependency(PackageSpec(name="Julia_jll",version=v"1.4.1"))
BuildDependency(PackageSpec(name="libjulia_jll", version=julia_version))
]

# Build the tarballs, and possibly a `build.jl` as well.
build_tarballs(ARGS, name, version, sources, script, platforms, products, dependencies; preferred_gcc_version = v"7")
build_tarballs(ARGS, name, version, sources, script, platforms, products, dependencies; preferred_gcc_version = v"7", julia_compat = "~$(julia_version.major).$(julia_version.minor)")

0 comments on commit ee3126a

Please sign in to comment.