SUMMARY="A viewer supporting PDF and DJVU files"
DESCRIPTION="DocumentViewer is a viewer that supports PDF and DJVU files."
HOMEPAGE="https://github.com/HaikuArchives/DocumentViewer"
COPYRIGHT="2010-2018 Haiku, Inc"
LICENSE="MIT"
REVISION="15"
srcGitRev="314dee24ec8361720cb6ec7420e272c98054895a"
SOURCE_URI="$HOMEPAGE/archive/$srcGitRev.tar.gz"
CHECKSUM_SHA256="b073db6a0157e76bc36b3036fb4c5fbe6639a6fec094e309eb3d8a1b12bd2854"
SOURCE_DIR="DocumentViewer-$srcGitRev"

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

PROVIDES="
	documentviewer$secondaryArchSuffix = $portVersion
	app:DocumentViewer = $portVersion
	"
REQUIRES="
	haiku$secondaryArchSuffix
	lib:libdjvulibre$secondaryArchSuffix
	lib:libfreetype$secondaryArchSuffix
	lib:libjbig2dec$secondaryArchSuffix
	lib:libjpeg$secondaryArchSuffix
	lib:libmupdf$secondaryArchSuffix
	lib:libopenjp2$secondaryArchSuffix
	lib:libz$secondaryArchSuffix
	"

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	devel:libdjvulibre$secondaryArchSuffix
	devel:libfreetype$secondaryArchSuffix
	devel:libjbig2dec$secondaryArchSuffix
	devel:libjpeg$secondaryArchSuffix
	devel:libmupdf$secondaryArchSuffix
	devel:libopenjp2$secondaryArchSuffix
	devel:libz$secondaryArchSuffix
	"
BUILD_PREREQUIRES="
	makefile_engine
	cmd:find
	cmd:g++$secondaryArchSuffix
	cmd:make
	"

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

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