SUMMARY="Disassembler Library for x86 and x86-64"
DESCRIPTION="Udis86 is an easy-to-use, minimalistic disassembler library \
(libudis86) for the x86 class of instruction set architectures. It has a \
convenient interface for use in the analysis and instrumentation of binary code."
HOMEPAGE="http://udis86.sourceforge.net/"
COPYRIGHT="2002-2012, Vivek Thampi"
LICENSE="BSD (2-clause)"
REVISION="2"
SOURCE_URI="https://github.com/vmt/udis86/archive/v$portVersion.tar.gz"
CHECKSUM_SHA256="43567f7e12168943c5b5ffb3d3f5b7a33cb36328f8938a993458f3ded0ba5779"
SOURCE_FILENAME="udis86-$portVersion.tar.gz"
PATCHES="udis86-$portVersion.patchset"

ARCHITECTURES="all ?x86"

PROVIDES="
	udis86 = $portVersion
	cmd:udcli
	devel:libudis86
	"
REQUIRES="
	haiku
	"

BUILD_PREREQUIRES="
	haiku_devel
	cmd:aclocal
	cmd:autoconf
	cmd:gcc
	cmd:libtoolize
	cmd:make
	cmd:python
	cmd:sh
	cmd:yasm
	"

defineDebugInfoPackage udis86 \
	"$binDir"/udcli

BUILD()
{
	libtoolize --force --copy --install
	sh autogen.sh
	runConfigure ./configure
	make $jobArgs
}

INSTALL()
{
	make install
	rm -f "$libDir"/libudis86.la

	prepareInstalledDevelLib libudis86
}

TEST()
{
	make check
}
