SUMMARY="Tools for Amstrad/Schneider CPC software development"
DESCRIPTION="This is a collection of various tools for cross development for \
Amstrad CPC machines. The goal is to provide a fast and automated \"modify, \
build, run\" development cycle in line with the UNIX way of doing things.

Some graphical tools are also provided, with a focus on debugging, analyzing, \
reverse engineering and experimentations."
HOMEPAGE="https://github.com/cpcsdk/cpctools"
COPYRIGHT="
	2005 Thierry Jouin
	2008-2015 Romain Giot, Adrien Destugues, Quentin Carlier, Mauricio Muñoz Lucero
"
LICENSE="
	MIT
	GNU GPL v2
"
REVISION="2"
ARCHITECTURES="x86_gcc2"

SOURCE_URI="git+https://github.com/cpcsdk/cpctools.git#ac9ebe65c7eb49bc1175050d4a6d912bbf5856f5"

PROVIDES="
	cpctools = $portVersion
	cmd:aft2
	cmd:cpcDSK
	cmd:cpcfs
	cmd:createSnapshot
	cmd:damsConverter
	cmd:dataDBGenerator
	cmd:dataLinker
	cmd:png2crtc
	cmd:raw2crtc
	lib:libcpc
"

REQUIRES="
	haiku
	lib:libdsk
	lib:libpng
	lib:libz
"

BUILD_REQUIRES="
	haiku_devel
	devel:libdsk
	devel:libpng
	devel:libz
"

BUILD_PREREQUIRES="
	cmd:cmake
	cmd:gcc
	cmd:make
"

BUILD()
{
	mkdir -p cpctools.build
	pushd cpctools.build
		cmake ../cpctools $cmakeDirArgs
		make $jobArgs
	popd
	cd gfx2crtc
	make $jobArgs
}

INSTALL()
{
	pushd cpctools.build
		make install
	popd
	cp gfx2crtc/{png2crtc,raw2crtc} $binDir

	rm -rf $prefix/docs
}
