SUMMARY="A fast compressor/decompressor"
DESCRIPTION="Snappy is a compression/decompression library. It does not aim \
for maximum compression, or compatibility with any other compression library;\
 instead, it aims for very high speeds and reasonable compression. For instance,\
compared to the fastest mode of zlib, Snappy is an order of magnitude faster \
for most inputs, but the resulting compressed files are anywhere from 20% to \
100% bigger."
HOMEPAGE="https://code.google.com/p/snappy/"
COPYRIGHT="2005-2014 Google Inc"
LICENSE="BSD (3-clause)"
REVISION="1"
SOURCE_URI="http://mirror.pistoncloud.com/source/snappy-$portVersion.tar.gz"
CHECKSUM_SHA256="f9d8fe1c85494f62dbfa3efe8e73bc23d8dec7a254ff7fe09ec4b0ebfc586af4"

ARCHITECTURES="x86 x86_64"
if [ $effectiveTargetArchitecture != x86_gcc2 ]; then
	# x86_gcc2 is fine as primary target architecture as long as we're building
	# for a different secondary architecture.
	ARCHITECTURES="$ARCHITECTURES x86_gcc2"
else
	ARCHITECTURES="$ARCHITECTURES x86_gcc2"
fi
SECONDARY_ARCHITECTURES="x86"

PROVIDES="
	snappy$secondaryArchSuffix = $portVersion compat >= 1
	lib:libsnappy$secondaryArchSuffix = 1.2.1 compat >= 1
	"
REQUIRES="
	haiku$secondaryArchSuffix
	lib:libstdc++$secondaryArchSuffix
	"

PROVIDES_devel="
	snappy${secondaryArchSuffix}_devel = $portVersion compat >= 1
	devel:libsnappy$secondaryArchSuffix = 1.2.1 compat >= 1
	"

REQUIRES_devel="
	snappy$secondaryArchSuffix == $portVersion base
	"

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	"
BUILD_PREREQUIRES="
	cmd:gcc$secondaryArchSuffix
	cmd:ld$secondaryArchSuffix
	cmd:libtoolize
	cmd:make
	"
	
BUILD()
{
	runConfigure ./configure
	make $jobArgs
}

INSTALL()
{
	make install

	prepareInstalledDevelLibs libsnappy
	packageEntries devel \
		$developDir
}

TEST()
{
	make check
}
