SUMMARY="The graphing calculator for functions, geometry, algebra, calculus, statistics"
DESCRIPTION="GeoGebra is dynamic mathematics software for all levels of education that 
brings together geometry, algebra, spreadsheets, graphing, statistics and calculus in 
one easy-to-use package.
GeoGebra is a rapidly expanding community of millions of users
located in just about every country.
GeoGebra has become the leading provider of dynamic mathematics software, supporting
science, technology, engineering and mathematics (STEM) education and innovations in
teaching and learning worldwide."
HOMEPAGE="https://www.geogebra.org"
COPYRIGHT="2017 International GeoGebra Institute"
LICENSE="GNU GPL v3"
REVISION="2"
SOURCE_URI="https://download.geogebra.org/installers/4.4/GeoGebra-Linux-Portable-$portVersion.tar.bz2"
CHECKSUM_SHA256="c75f28883ca2761664947e81433da00d534070126678672ed275d21af12fad7d"
SOURCE_DIR="GeoGebra-Linux-Portable-$portVersion"
ADDITIONAL_FILES="geogebra.rdef"

ARCHITECTURES="any"
DISABLE_SOURCE_PACKAGE="yes"

PROVIDES="
	geogebra = $portVersion
	app:GeoGebra = $portVersion
	"
REQUIRES="
	haiku
	cmd:java
	"

BUILD_REQUIRES="
	haiku_devel
	"
BUILD_PREREQUIRES="
	cmd:sed
	"

BUILD()
{
	cp -f $portDir/additional-files/geogebra.rdef $sourceDir
	rc geogebra.rdef
}

INSTALL()
{
	mkdir -p $appsDir
	cp -r geogebra $appsDir/GeoGebra
	sed -i '/# GG_SHOWSPLASH/a GG_SHOWSPLASH=true' $appsDir/GeoGebra/geogebra
	sed -i '/# GG_VERSIONCHECKALLOW/a GG_VERSIONCHECKALLOW=false' $appsDir/GeoGebra/geogebra
	sed -i '/# GG_CONFIG_PATH/a mkdir $GG_CONFIG_PATH' $appsDir/GeoGebra/geogebra
	sed -i '/# GG_CONFIG_PATH/a GG_CONFIG_PATH="/boot/home/config/settings/GeoGebra"' $appsDir/GeoGebra/geogebra
	resattr -o $appsDir/GeoGebra/geogebra geogebra.rsrc
	addAppDeskbarSymlink "$appsDir/GeoGebra/geogebra" "GeoGebra"
}
