Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions A/asio/build_tarballs.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Note that this script can accept some limited command-line arguments, run
# `julia build_tarballs.jl --help` to see a usage message.
using BinaryBuilder, Pkg

name = "asio"
version = v"1.36.0"

# Collection of sources required to complete build
sources = [
GitSource("https://github.com/chriskohlhoff/asio.git", "231cb29bab30f82712fcd54faaea42424cc6e710"),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I didn't realize it was just shipping headers so it might not be a good fit for Yggdrasil.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if this realy only ships headers, and the headers are identical across all platforms, I guess it could be turned into a JLL with platforms = [AnyPlatform()] (i.e. a single artefact is created and used on all platforms).

@giordano any thoughts on this?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, if this is a platform-independent headers-only package, then it should be AnyPlatform

]

# Bash recipe for building across all platforms
script = raw"""
cd $WORKSPACE/srcdir
cd asio/asio
if [[ ${target} == *-w64-mingw32 ]]; then
# Header-only: on Windows skip build (examples use POSIX-only asio::posix::stream_descriptor) and install headers manually
mkdir -p ${includedir}
cp include/asio.hpp ${includedir}/
cp -r include/asio ${includedir}/
else
./autogen.sh
./configure --prefix=${prefix} --build=${MACHTYPE} --host=${target}
make -j${nproc}
make install
fi
"""

# These are the platforms we will build for by default, unless further
# platforms are passed in on the command line
all_platforms = supported_platforms()

# The products that we will ensure are always built (header-only: export main header so downstreams can discover include/)
products = Product[
FileProduct("include/asio.hpp", :asio_hpp),
]

# Dependencies that must be installed before this package can be built
dependencies = []

# Build the tarballs, and possibly a `build.jl` as well.
# GCC v4 is missing `std::align`
build_tarballs(
ARGS, name, version, sources, script, all_platforms, products, dependencies;
julia_compat="1.6",
preferred_gcc_version=v"5",
)