#### this file is sourced not run
PKGVER=2015.03
PKGBUILD=1
PKGARCH=x86_64

# source: james + debian patches (for libpng update)
TARBALL=matchbox-keyboard-2015.03.tar.bz2
MD5SUM=cd97364437193d85ec0557197f412f09 
SRC_URL=http://distro.ibiblio.org/fatdog/source/800/$TARBALL
BUNDLE=

SLACKREQ='libfakekey expat libpng freetype2'
SLACKDESC='matchbox-keyboard: matchbox-keyboard 2015.03 (Virtual keyboard)  
matchbox-keyboard:  
matchbox-keyboard: Matchbox-keyboard is an on-screen 'virtual' or 'software' 
matchbox-keyboard: keyboard, designed for touchscreen devices.  
matchbox-keyboard: 
matchbox-keyboard: This is the fork from 
matchbox-keyboard: https://github.com/xlab/matchbox-keyboard
matchbox-keyboard: 
matchbox-keyboard: If used with matchbox-systray, it is best to use the
matchbox-keyboard: --daemon mode and start it from /etc/xdg/Startup
matchbox-keyboard:
'
SLACKSUG='matchbox-systray'

### default pkg_download
### prepare
pkg_prepare() {
	pkg_prepare_default &&
	cd tmp/matchbox*
	tar -xf $CHROOT_DIR/tmp/pkg/matchbox-keyboard_0.1+svn20080916-9.debian.tar.gz &&
	patch -Np1 -i debian/patches/libpng-fix &&
	patch -Np1 -i $CHROOT_DIR/tmp/pkg/matchbox-keyboard-1.5-james.patch
}

### default pkg_package
### build
pkg_build() {
	CONFFLAGS="$CONFFLAGS --enable-gtk-im"
	cd /tmp/matchbox*
	autoreconf -fi &&
	./configure --prefix=/usr --libdir=/usr/$LIBDIR &&
	sed -i "s|FAKEKEY_LIBS = -L/usr/lib64 -lX11 -lXtst -lfakekey|FAKEKEY_LIBS = -L/usr/lib64 -lX11 -lXtst -lfakekey -lXrender|" src/Makefile &&
	make $MAKEFLAGS &&
	make install &&
	pkg_build_slackdesc &&
	
	# docs
	mkdir -p /usr/share/doc/matchbox-keyboard &&
	cp README.md /usr/share/doc/matchbox-keyboard &&
	install -v -m644 examples/*c /usr/share/doc/matchbox-keyboard	
}
