SUMMARY="SIMD Vector Class Library for C++"
DESCRIPTION="A library to ease explicit vectorization of C++ code."
HOMEPAGE="https://github.com/VcDevel/Vc"
COPYRIGHT="2006-2016 Arseny Kapoulkine"
LICENSE="GNU LGPL v3"
REVISION="1"
SOURCE_URI="https://github.com/VcDevel/Vc/archive/$portVersion.tar.gz"
CHECKSUM_SHA256="50d3f151e40b0718666935aa71d299d6370fafa67411f0a9e249fbce3e6e3952"
SOURCE_FILENAME="vc-$portVersion.tar.gz"
SOURCE_DIR="Vc-$portVersion"
PATCHES="vc-$portVersion.patchset"

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

PROVIDES="
	vc$secondaryArchSuffix = $portVersion
	devel:libVc$secondaryArchSuffix = $portVersion
	"
REQUIRES="
	haiku$secondaryArchSuffix
	"

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

BUILD()
{
	cmake -B build -S . -DCMAKE_BUILD_TYPE=Release \
		-DCMAKE_INSTALL_PREFIX:PATH=$prefix \
		-DTARGET_ARCHITECTURE=generic
#		-DBUILD_TESTING=ON

	make -C build ${jobArgs}
}

INSTALL()
{
	make -C build install

	# move include dir to correct location
	mkdir -p $(dirname $includeDir)
	mv $prefix/include $includeDir

	mv $prefix/lib $prefix/lib2
	mkdir -p $libDir
	mv $prefix/lib2/* $libDir/
	rmdir $prefix/lib2

	# prepare develop/lib
	prepareInstalledDevelLib libVc
}

TEST()
{
#	cd build_haiku
#	make test
	true #virtest required
}
