SUMMARY="A viewer supporting PDF and DJVU files"
DESCRIPTION="DocumentViewer is a viewer that supports PDF and DJVU files."
LICENSE="MIT"
COPYRIGHT="2010-2014 Haiku, Inc"
HOMEPAGE="http://github.com/HaikuArchives/DocumentViewer"
SOURCE_URI="git://github.com/HaikuArchives/DocumentViewer#4313980"
REVISION="7"
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="
	documentviewer$secondaryArchSuffix = $portVersion
	app:DocumentViewer = $portVersion
	"

REQUIRES="
	haiku$secondaryArchSuffix
	lib:libdjvulibre$secondaryArchSuffix
	lib:libfreetype$secondaryArchSuffix
	lib:libz$secondaryArchSuffix
	lib:libmupdf$secondaryArchSuffix
	lib:libjpeg$secondaryArchSuffix
	lib:libopenjp2$secondaryArchSuffix
	lib:libjbig2dec$secondaryArchSuffix
	"

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	devel:libdjvulibre$secondaryArchSuffix
	devel:libmupdf$secondaryArchSuffix
	devel:libfreetype$secondaryArchSuffix
	devel:libz$secondaryArchSuffix
	devel:libjpeg$secondaryArchSuffix
	devel:libopenjp2$secondaryArchSuffix
	devel:libjbig2dec$secondaryArchSuffix
	"

BUILD_PREREQUIRES="
	cmd:find
	cmd:g++$secondaryArchSuffix
	cmd:make
	makefile_engine
	"

BUILD()
{
	cd application
	make $jobArgs OBJ_DIR=objects
}

INSTALL()
{
	mkdir -p $appsDir
	cp application/objects/DocumentViewer $appsDir
	addAppDeskbarSymlink $appsDir/DocumentViewer
}
