SUMMARY="Custom widget library"
DESCRIPTION="
libsanta has some useful custom widgets (color picker, column \
list view, scroll view etc.)
NOT recommended for new apps! Use Haiku's Layout Manager instead. \
The recipe exists only for legacy BeOS apps.
"
HOMEPAGE="https://github.com/HaikuArchives/SantasGiftBag"
COPYRIGHT="briant@timelinevista.com"
LICENSE="libsanta"
SRC_URI="git+https://github.com/HaikuArchives/SantasGiftBag#4b62541"
REVISION="2"
ARCHITECTURES="x86_gcc2 x86 ?x86_64"
SECONDARY_ARCHITECTURES="x86_gcc2 x86"

PROVIDES="
	libsanta$secondaryArchSuffix = $portVersion
	lib:libsanta$secondaryArchSuffix = $portVersion
	"
	
REQUIRES="
	haiku$secondaryArchSuffix >= $haikuVersion
	"
	
BUILD_REQUIRES="
	haiku${secondaryArchSuffix}_devel >= $haikuVersion
	"
BUILD_PREREQUIRES="
	makefile_engine
	cmd:gcc$secondaryArchSuffix
	cmd:ld$secondaryArchSuffix
	cmd:make
	cmd:mkdepend
	"

BUILD()
{
	make TYPE=STATIC \
		OBJ_DIR=obj-static \
		BUILDHOME=`finddir B_SYSTEM_DEVELOP_DIRECTORY`
	
	make TYPE=SHARED \
		OBJ_DIR=obj-shared \
		BUILDHOME=`finddir B_SYSTEM_DEVELOP_DIRECTORY`
}

INSTALL()
{
	mkdir -p $developLibDir $developDocDir $includeDir/santa $libDir
	
	cp -R Documentation/* $developDocDir
	
	cd obj-static
	cp libsanta.a $developLibDir
	
	cd ../obj-shared
	cp libsanta $libDir/libsanta.so.3.0.0

	ln -s $libDir/libsanta.so.3.0.0 $libDir/libsanta.so.3
	ln -s $libDir/libsanta.so.3.0.0 $libDir/libsanta.so
	
	cd ..
	
	# Copy header files to $includeDir
	
	cp ./BetterScrollView/BetterScrollView.h \
	   ./Colors.h \
	   ./ColumnListView/CLVColumn.h \
	   ./ColumnListView/CLVColumnLabelView.h \
	   ./ColumnListView/CLVEasyItem.h \
	   ./ColumnListView/CLVListItem.h \
	   ./ColumnListView/ColumnListView.h \
	   ./Cursors/Cursors.h \
	   ./NewStrings/NewStrings.h \
	   ./PrefilledBitmap/PrefilledBitmap.h \
	   ./ScrollViewCorner/ScrollViewCorner.h  $includeDir/santa
	
	symlinkRelative -s $libDir/libsanta.so.3.0.0 $developLibDir
	
	packageEntries devel \
		$developLibDir \
		$developDocDir \
		$includeDir
}

# ----- devel package -------------------------------------------------------

PROVIDES_devel="
	libsanta${secondaryArchSuffix}_devel = $portVersion
	devel:libsanta$secondaryArchSuffix = $portVersion
	"
REQUIRES_devel="
	libsanta$secondaryArchSuffix == $portVersion base
	"
