SUMMARY="A set of libraries for the C++ programming language"
DESCRIPTION="
Boost is a set of libraries for the C++ programming language that provide \
support for tasks and structures such as linear algebra, pseudorandom number \
generation, multithreading, image processing, regular expressions, and unit \
testing. It contains over eighty individual libraries.
"
HOMEPAGE="https://www.boost.org/"
COPYRIGHT="1998-2017 Beman Dawes, David Abrahams, Rene Rivera, et al."
LICENSE="Boost v1.0"
REVISION="3"
SOURCE_URI="https://sourceforge.net/projects/boost/files/boost/1.64.0/boost_1_64_0.tar.bz2"
CHECKSUM_SHA256="7bcc5caace97baa948931d712ea5f37038dbb1c5d89b43ad4def4ed7cb683332"
SOURCE_DIR="boost_1_64_0"
PATCHES="boost-$portVersion.patchset"

ARCHITECTURES="all !x86_gcc2"
SECONDARY_ARCHITECTURES="?x86"

libVersion="$portVersion compat >= 1.64.0"

PROVIDES="
	boost164$secondaryArchSuffix = $portVersion
	lib:libboost_atomic$secondaryArchSuffix = $libVersion
	lib:libboost_chrono$secondaryArchSuffix = $libVersion
	lib:libboost_container$secondaryArchSuffix = $libVersion
	lib:libboost_context$secondaryArchSuffix = $libVersion
	lib:libboost_coroutine$secondaryArchSuffix = $libVersion
	lib:libboost_date_time$secondaryArchSuffix = $libVersion
	lib:libboost_filesystem$secondaryArchSuffix = $libVersion
	lib:libboost_graph$secondaryArchSuffix = $libVersion
	lib:libboost_iostreams$secondaryArchSuffix = $libVersion
	lib:libboost_locale$secondaryArchSuffix = $libVersion
	lib:libboost_log$secondaryArchSuffix = $libVersion
	lib:libboost_log_setup$secondaryArchSuffix = $libVersion
	lib:libboost_math_c99$secondaryArchSuffix = $libVersion
	lib:libboost_math_c99f$secondaryArchSuffix = $libVersion
	lib:libboost_math_tr1$secondaryArchSuffix = $libVersion
	lib:libboost_math_tr1f$secondaryArchSuffix = $libVersion
	lib:libboost_prg_exec_monitor$secondaryArchSuffix = $libVersion
	lib:libboost_program_options$secondaryArchSuffix = $libVersion
	lib:libboost_random$secondaryArchSuffix = $libVersion
	lib:libboost_regex$secondaryArchSuffix = $libVersion
	lib:libboost_serialization$secondaryArchSuffix = $libVersion
	lib:libboost_signals$secondaryArchSuffix = $libVersion
	lib:libboost_system$secondaryArchSuffix = $libVersion
	lib:libboost_thread$secondaryArchSuffix = $libVersion
	lib:libboost_timer$secondaryArchSuffix = $libVersion
	lib:libboost_type_erasure$secondaryArchSuffix = $libVersion
	lib:libboost_unit_test_framework$secondaryArchSuffix = $libVersion
	lib:libboost_wave$secondaryArchSuffix = $libVersion
	lib:libboost_wserialization$secondaryArchSuffix = $libVersion
	"
REQUIRES="
	haiku$secondaryArchSuffix
	lib:libbz2$secondaryArchSuffix
	lib:libicudata$secondaryArchSuffix
	lib:libicui18n$secondaryArchSuffix
	lib:libicuuc$secondaryArchSuffix
	lib:libz$secondaryArchSuffix
	"

PROVIDES_devel="
	boost164${secondaryArchSuffix}_devel = $portVersion
	devel:libboost_atomic$secondaryArchSuffix = $portVersion
	devel:libboost_chrono$secondaryArchSuffix = $portVersion
	devel:libboost_container$secondaryArchSuffix = $portVersion
	devel:libboost_context$secondaryArchSuffix = $portVersion
	devel:libboost_coroutine$secondaryArchSuffix = $portVersion
	devel:libboost_date_time$secondaryArchSuffix = $portVersion
	devel:libboost_exception$secondaryArchSuffix = $portVersion
	devel:libboost_filesystem$secondaryArchSuffix = $portVersion
	devel:libboost_graph$secondaryArchSuffix = $portVersion
	devel:libboost_iostreams$secondaryArchSuffix = $portVersion
	devel:libboost_locale$secondaryArchSuffix = $portVersion
	devel:libboost_log$secondaryArchSuffix = $portVersion
	devel:libboost_log_setup$secondaryArchSuffix = $portVersion
	devel:libboost_math_c99$secondaryArchSuffix = $portVersion
	devel:libboost_math_c99f$secondaryArchSuffix = $portVersion
	devel:libboost_math_tr1$secondaryArchSuffix = $portVersion
	devel:libboost_math_tr1f$secondaryArchSuffix = $portVersion
	devel:libboost_prg_exec_monitor$secondaryArchSuffix = $portVersion
	devel:libboost_program_options$secondaryArchSuffix = $portVersion
	devel:libboost_random$secondaryArchSuffix = $portVersion
	devel:libboost_regex$secondaryArchSuffix = $portVersion
	devel:libboost_serialization$secondaryArchSuffix = $portVersion
	devel:libboost_signals$secondaryArchSuffix = $portVersion
	devel:libboost_system$secondaryArchSuffix = $portVersion
	devel:libboost_test_exec_monitor$secondaryArchSuffix = $portVersion
	devel:libboost_thread$secondaryArchSuffix = $portVersion
	devel:libboost_timer$secondaryArchSuffix = $portVersion
	devel:libboost_type_erasure$secondaryArchSuffix = $portVersion
	devel:libboost_unit_test_framework$secondaryArchSuffix = $portVersion
	devel:libboost_wave$secondaryArchSuffix = $portVersion
	devel:libboost_wserialization$secondaryArchSuffix = $portVersion
	"
REQUIRES_devel="
	boost164$secondaryArchSuffix == $portVersion
	haiku$secondaryArchSuffix
	"

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	devel:libbz2$secondaryArchSuffix
	devel:libicudata$secondaryArchSuffix
	devel:libicui18n$secondaryArchSuffix
	devel:libicuuc$secondaryArchSuffix
	devel:libz$secondaryArchSuffix
	"
BUILD_PREREQUIRES="
	cmd:gcc$secondaryArchSuffix
	cmd:ld$secondaryArchSuffix
	cmd:sed
	cmd:which
	"

BUILD()
{
	./bootstrap.sh \
		--prefix=$prefix \
		--exec-prefix=$binDir \
		--libdir=$libDir \
		--includedir=$includeDir

	./b2 -q $jobArgs \
		--without-mpi \
		--enable-threads=posix \
		--enable-thread-local-alloc \
		--enable-parallel-mark \
		inlining=on \
		threading=multi \
		variant=release \
		link=static,shared \
		runtime-link=shared \
		--without-python
}

INSTALL()
{
	./b2 -q $jobArgs \
		--without-mpi \
		--enable-threads=posix \
		--enable-thread-local-alloc \
		--enable-parallel-mark \
		inlining=on \
		threading=multi \
		variant=release \
		link=static,shared \
		runtime-link=shared \
		--without-python \
		install

	prepareInstalledDevelLibs libboost_atomic libboost_chrono \
		libboost_container libboost_context libboost_coroutine \
		libboost_date_time libboost_filesystem libboost_iostreams \
		libboost_locale libboost_log libboost_log_setup \
		libboost_math_c99 libboost_math_c99f \
		libboost_math_tr1 libboost_math_tr1f \
		libboost_program_options libboost_random libboost_regex \
		libboost_serialization libboost_signals libboost_system \
		libboost_thread libboost_timer libboost_type_erasure \
		libboost_unit_test_framework \
		libboost_wave libboost_wserialization  \
		libboost_exception libboost_graph \
		libboost_prg_exec_monitor libboost_test_exec_monitor

	packageEntries devel $developDir
}

TEST()
{
	cd status
	../bjam $jobArgs
}
