SUMMARY="IUP is a multi-platform toolkit for building graphical user interfaces."
HOMEPAGE="http://www.tecgraf.puc-rio.br/iup/"
SRC_URI="http://downloads.sourceforge.net/project/iup/3.8/Docs%20and%20Sources/iup-3.8_Sources.zip" # The tar.gz has permission problems.
CHECKSUM_MD5="b14469c2dd46af3e1bb1ecc8dc216061"
REVISION="1"
ARCHITECTURES="x86_gcc2"
SECONDARY_ARCHITECTURES="x86"
PROVIDES="
	iup$secondaryArchSuffix = $portVersion
	lib:libiup$secondaryArchSuffix = $portVersion
	lib:libiup_mglplot$secondaryArchSuffix = $portVersion
	lib:libiup_pplot$secondaryArchSuffix = $portVersion
	lib:libiupcd$secondaryArchSuffix = $portVersion
	lib:libiupcontrols$secondaryArchSuffix = $portVersion 
	lib:libiupgl$secondaryArchSuffix = $portVersion
	lib:libiupim$secondaryArchSuffix = $portVersion
	lib:libiupimglib$secondaryArchSuffix = $portVersion
	lib:libiuplua51$secondaryArchSuffix = $portVersion
	lib:libiuplua52$secondaryArchSuffix = $portVersion
	lib:libiuplua_mglplot51$secondaryArchSuffix = $portVersion
	lib:libiuplua_mglplot52$secondaryArchSuffix = $portVersion
	lib:libiuplua_pplot51$secondaryArchSuffix = $portVersion
	lib:libiuplua_pplot52$secondaryArchSuffix = $portVersion
	lib:libiupluacd51$secondaryArchSuffix = $portVersion
	lib:libiupluacd52$secondaryArchSuffix = $portVersion
	lib:libiupluacontrols51$secondaryArchSuffix = $portVersion
	lib:libiupluacontrols52$secondaryArchSuffix = $portVersion
	lib:libiupluagl51$secondaryArchSuffix = $portVersion
	lib:libiupluagl52$secondaryArchSuffix = $portVersion
	lib:libiupluaim51$secondaryArchSuffix = $portVersion
	lib:libiupluaim52$secondaryArchSuffix = $portVersion
	lib:libiupluaimglib51$secondaryArchSuffix = $portVersion
	lib:libiupluaimglib52$secondaryArchSuffix = $portVersion
	lib:libiupluatuio51$secondaryArchSuffix = $portVersion
	lib:libiupluatuio52$secondaryArchSuffix = $portVersion
	lib:libiuptuio$secondaryArchSuffix = $portVersion
	lib:libiupweb$secondaryArchSuffix = $portVersion
	"
REQUIRES="
	haiku$secondaryArchSuffix >= $haikuVersion
	lib:liblua$secondaryArchSuffix
	lib:libcd$secondaryArchSuffix >= 5.6
	lib:libim$secondaryArchSuffix >= 3.8
	lib:libfreetype$secondaryArchSuffix
	lib:libGLU$secondaryArchSuffix
	lib:libz$secondaryArchSuffix
"

BUILD_REQUIRES="
	devel:libcd$secondaryArchSuffix
	devel:libfontconfig$secondaryArchSuffix
	devel:libfreetype$secondaryArchSuffix
	devel:libGLU$secondaryArchSuffix
	devel:libim$secondaryArchSuffix
	devel:liblua$secondaryArchSuffix
	devel:libxml2$secondaryArchSuffix
	devel:libz$secondaryArchSuffix
"

BUILD_PREREQUIRES="
	haiku${secondaryArchSuffix}_devel >= $haikuVersion
	cmd:gcc$secondaryArchSuffix
	cmd:as$secondaryArchSuffix
	cmd:make
	cmd:which
	cmd:yacc
"

SOURCE_DIR="iup"
#PATCHES="iup-3.8.patchset"
BUILD()
{
	export LUA52=`finddir B_SYSTEM_DIRECTORY`
	export LUA_LIB=`finddir B_SYSTEM_DEVELOP_DIRECTORY`/lib$secondaryArchSubDir
	export LUA_BIN=/bin$secondaryArchSubDir
	export LUA_SUFFIX= 
	export LUA_INC=`finddir B_SYSTEM_HEADERS_DIRECTORY`
	make
}

INSTALL()
{
	mkdir -p $developLibDir
	mkdir -p $libDir
	mkdir -p $includeDir

	cp lib/Haiku11/* $libDir
	cp include/* $includeDir

	prepareInstalledDevelLibs libiup libiup_mglplot libiup_pplot libiupcd \
		libiupcontrols libiupgl libiupim libiupimglib libiuplua51 libiuplua52 \
		libiuplua_mglplot51 libiuplua_mglplot52 libiuplua_pplot51 \
		libiuplua_pplot52 libiupluacd51 libiupluacd52 libiupluacontrols51 \
		libiupluacontrols52 libiupluagl51 libiupluagl52 libiupluaim51 \
		libiupluaim52 libiupluaimglib51 libiupluaimglib52 libiupluatuio51 \
		libiupluatuio52 libiuptuio libiupweb
		
	packageEntries devel $developDir
}

PROVIDES_devel="
	devel:libiup$secondaryArchSuffix = $portVersion
	devel:libiup_mglplot$secondaryArchSuffix = $portVersion
	devel:libiup_pplot$secondaryArchSuffix = $portVersion
	devel:libiupcd$secondaryArchSuffix = $portVersion
	devel:libiupcontrols$secondaryArchSuffix = $portVersion 
	devel:libiupgl$secondaryArchSuffix = $portVersion
	devel:libiupim$secondaryArchSuffix = $portVersion
	devel:libiupimglib$secondaryArchSuffix = $portVersion
	devel:libiuplua51$secondaryArchSuffix = $portVersion
	devel:libiuplua52$secondaryArchSuffix = $portVersion
	devel:libiuplua_mglplot51$secondaryArchSuffix = $portVersion
	devel:libiuplua_mglplot52$secondaryArchSuffix = $portVersion
	devel:libiuplua_pplot51$secondaryArchSuffix = $portVersion
	devel:libiuplua_pplot52$secondaryArchSuffix = $portVersion
	devel:libiupluacd51$secondaryArchSuffix = $portVersion
	devel:libiupluacd52$secondaryArchSuffix = $portVersion
	devel:libiupluacontrols51$secondaryArchSuffix = $portVersion
	devel:libiupluacontrols52$secondaryArchSuffix = $portVersion
	devel:libiupluagl51$secondaryArchSuffix = $portVersion
	devel:libiupluagl52$secondaryArchSuffix = $portVersion
	devel:libiupluaim51$secondaryArchSuffix = $portVersion
	devel:libiupluaim52$secondaryArchSuffix = $portVersion
	devel:libiupluaimglib51$secondaryArchSuffix = $portVersion
	devel:libiupluaimglib52$secondaryArchSuffix = $portVersion
	devel:libiupluatuio51$secondaryArchSuffix = $portVersion
	devel:libiupluatuio52$secondaryArchSuffix = $portVersion
	devel:libiuptuio$secondaryArchSuffix = $portVersion
	devel:libiupweb$secondaryArchSuffix = $portVersion
"

LICENSE="MIT"
COPYRIGHT="1994-2013 Tecgraf, PUC-Rio."
DESCRIPTION="
IUP is a multi-platform toolkit for building graphical user interfaces. It \
offers APIs in three basic languages: C, Lua and LED.
Its library contains about 100 functions for creating and manipulating dialogs.
IUP's purpose is to allow a program to run in different systems without \
changes - the toolkit provides the application portability. Supported systems \
include: GTK+, Motif and Windows.
IUP uses an abstract layout model based on the boxes-and-glue paradigm from \
the TEX text editor. This model, combined with the dialog-specification \
language (LED) or with the Lua binding (IupLua) makes the dialog creation task \
more flexible and independent from the graphics system's resolution.
"
