SUMMARY="Experimental range library for C++11/14/17"
DESCRIPTION="Ranges are an extension of the Standard Template Library that \
makes its iterators and algorithms more powerful by making them composable. \
Unlike other range-like solutions which seek to do away with iterators, in \
range-v3 ranges are an abstration layer on top of iterators.

Range-v3 is built on three pillars: Views, Actions, and Algorithms. \
The algorithms are the same as those with which you are already familiar \
in the STL, except that in range-v3 all the algorithms have overloads that \
take ranges in addition to the overloads that take iterators. Views are \
composable adaptations of ranges where the adaptation happens lazily as the \
view is iterated. And an action is an eager application of an algorithm to a \
container that mutates the container in-place and returns it for further processing."
HOMEPAGE="https://github.com/ericniebler/range-v3"
COPYRIGHT="2021 Eric Niebler"
LICENSE="Boost v1.0"
REVISION="1"
SOURCE_URI="https://github.com/ericniebler/range-v3/archive/$portVersion.tar.gz"
CHECKSUM_SHA256="376376615dbba43d3bef75aa590931431ecb49eb36d07bb726a19f680c75e20c"
SOURCE_DIR="range-v3-$portVersion"
PATCHES="range_v3-$portVersion.patchset"

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

PROVIDES="
	range_v3$secondaryArchSuffix = $portVersion
	devel:range_v3$secondaryArchSuffix = $portVersion
	"
REQUIRES="
	haiku$secondaryArchSuffix
	"

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	"
BUILD_PREREQUIRES="
	cmd:cmake
	cmd:gcc$secondaryArchSuffix
	cmd:ld$secondaryArchSuffix
	cmd:make
	cmd:pkg_config$secondaryArchSuffix
	"

BUILD()
{
	mkdir -p build
	cd build
	cmake .. $cmakeDirArgs \
        -DCMAKE_BUILD_TYPE=Release \
		-DRANGE_V3_TESTS=OFF \
		-DRANGE_V3_EXAMPLES=OFF \
		-DRANGES_MODULES=ON \
		-DRANGE_V3_PERF=OFF
	make $jobArgs
}

INSTALL()
{
	cd build
	make install
	sed -i 's,\/include,/'${relativeIncludeDir}',g' \
		$libDir/cmake/range-v3/range-v3-targets.cmake
}
