SUMMARY="A port of KGhostview for X11/KDE"
DESCRIPTION="This is technically a port of KGhostview for X11/KDE. However \
I had to rewrite most of it, so only the basic architecture and the \
ps-parser remain as in the original. Thanks to Tim Theisen and Mark Donohoe \
for the original works. I'd also like to thank Jake Hamby, whose port of \
Ghostscript and helpful advice made this port possible.."
HOMEPAGE="https://github.com/HaikuArchives/BGhostView"
COPYRIGHT="1999 Andreas Raquet"
LICENSE="GNU GPL v2"
REVISION="2"
srcGitRev="bad8d39a1834ca4ada44c56a412b0556363b5b0e"
SOURCE_URI="https://github.com/HaikuArchives/BGhostView/archive/$srcGitRev.tar.gz"
CHECKSUM_SHA256="5383b43134b324d13d15d4851010925c572fb5db330bb6d296210d415e796e6f"
SOURCE_FILENAME="bghostview-$srcGitRev.tar.gz"
SOURCE_DIR="BGhostView-$srcGitRev/src"
PATCHES="bghostview-$portVersion.patchset"

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

PROVIDES="
	bghostview$secondaryArchSuffix = $portVersion
	app:BGhostview = $portVersion
	"
REQUIRES="
	haiku$secondaryArchSuffix
	lib:libgs$secondaryArchSuffix >= 9
	lib:libprefs$secondaryArchSuffix
	"

BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel
	devel:libgs$secondaryArchSuffix >= 9
	devel:libprefs$secondaryArchSuffix
	"
BUILD_PREREQUIRES="
	makefile_engine
	cmd:gcc$secondaryArchSuffix
	cmd:make
	cmd:pkg_config$secondaryArchSuffix
	"

defineDebugInfoPackage bghostview$secondaryArchSuffix \
	$appsDir/BGhostview

BUILD()
{
	make $jobArgs OBJ_DIR=objects
}

INSTALL()
{
	mkdir -p $appsDir
	cp -a objects/BGhostview $appsDir
	addAppDeskbarSymlink $appsDir/BGhostview
}
