#Packager: Dimitris Tzemos <dijemos~at~gmail~dot~com>

pkgname=tolua++
pkgver=1.0.93
pkgrel=1dj
source=("http://ponce.cc/slackware/sources/repo/tolua++-1.0.93.tar.bz2")
sourcetemplate="http://people.salixos.org/djemos/salix/openbox/$pkgname/"
docs=("COPYRIGHT" "INSTALL" "README*" "doc/*")
url="http://www.codenix.com/~tolua/"

slackdesc=\
(
#|-----handy-ruler------------------------------------------------------|
"tolua++ (tool to integrate C/C++ code with Lua)"
"Tolua++ is an extended version of tolua, a tool to integrate C/C++"
"code with Lua. tolua++ includes new features oriented to c++ such as:"
"  * Support for std::string as a basic type (this can be turned off"
"    by a command line option)."
"  * Support for class templates"
""
"Homeapge: http://www.codenix.com/~tolua/"
)


build() {

	cd $SRC/$pkgname-$pkgver

	# Fix lib64 install directory and fix version info.
	sed -i "s|'/lib'|'/lib${LIBDIRSUFFIX}'|g" SConstruct
	sed -i "s|\"${prgname}-1.0.92\"|\"${prgname}-${pkgver}\"|" include/tolua++.h

	# Custom build parameters.
cat >> custom.py << EOF
LIBS = ['lua', 'dl', 'm']
LIBPATH = ['/lib${LIBDIRSUFFIX}', '/usr/lib${LIBDIRSUFFIX}']
EOF

	scons install \
	CCFLAGS="-I/usr/include $SLKCFLAGS -ansi -Wall" \
	prefix="$PKG/usr" \
	shared="TRUE"
}
