SUMMARY="(streaming) protocol decoding library"
DESCRIPTION="The sigrok project aims at creating a portable, cross-platform
signal analysis software suite that supports various device types (such as \
logic analyzers, oscilloscopes, multimeters, and more).

libsigrokdecode is a shared library written in C which provides the basic API \
for (streaming) protocol decoding functionality.

The protocol decoders are written in Python (>= 3.0)."
HOMEPAGE="https://sigrok.org/wiki/Libsigrokdecode"
COPYRIGHT="2014-2020 sigrok contributors"
LICENSE="GNU GPL v3"
REVISION="3"
SOURCE_URI="http://sigrok.org/download/source/libsigrokdecode/libsigrokdecode-$portVersion.tar.gz"
CHECKSUM_SHA256="c50814aa6743cd8c4e88c84a0cdd8889d883c3be122289be90c63d7d67883fc0"

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

libVersion="4.2.1"
libVersionCompat="$libVersion compat >= ${libVersion%%.*}"

PROVIDES="
	libsigrokdecode$secondaryArchSuffix = $portVersion
	lib:libsigrokdecode$secondaryArchSuffix = $libVersionCompat
	"
REQUIRES="
	haiku$secondaryArchSuffix
	lib:libglib_2.0$secondaryArchSuffix
	lib:libpython3.7m$secondaryArchSuffix
	lib:libintl$secondaryArchSuffix
	"

PROVIDES_devel="
	libsigrokdecode${secondaryArchSuffix}_devel = $portVersion
	devel:libsigrokdecode$secondaryArchSuffix = $libVersionCompat
	"
REQUIRES_devel="
	libsigrokdecode$secondaryArchSuffix == $portVersion base
	"

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	devel:libglib_2.0$secondaryArchSuffix
	devel:libpython3.7m$secondaryArchSuffix
	"
BUILD_PREREQUIRES="
	cmd:awk
	cmd:gcc$secondaryArchSuffix
	cmd:make
	cmd:pkg_config$secondaryArchSuffix
	"

BUILD()
{
	runConfigure ./configure
	make $jobArgs
}

INSTALL()
{
	make install

	prepareInstalledDevelLib libsigrokdecode
	fixPkgconfig

	packageEntries devel $developDir
}

TEST()
{
	make check
}
