### this file is sourced not run

ZIPGIT=03f5d36b44b7c4cc5cc3bb94658cd6607672e6d3.zip # GitHub SHA
MD5GIT= # not used
TARBALL=libxkbcommon-0.6.1.tar.gz # pick your local name
MD5SUM=e69539ad07e7d44a89aac4e9d61344ac
SRC_URL=https://github.com/xkbcommon/libxkbcommon/archive/$ZIPGIT

BUNDLE=
SLACKREQ= 
SLACKDESC='libxkbcommon: libxkbcommon 0.6.1 20160420 (keyboard support library)  
libxkbcommon:  
libxkbcommon: libxkbcommon is a keyboard keymap compiler and support library which
libxkbcommon: processes a reduced subset of keymaps as defined by the XKB (X Keyboard
libxkbcommon: Extension) specification. It also contains a module for handling Compose
libxkbcommon: and dead keys.
libxkbcommon: 
libxkbcommon: 
libxkbcommon: 
libxkbcommon: 
libxkbcommon: https://github.com/xkbcommon/libxkbcommon/ 
'

#PKG_NOBUILD=yes # don't run the build-step (don't enter chroot)
#PKG_NOSTRIP=yes # don't strip binaries
#PKG_NOMAKEPKG=yes # don't run makepkg, supposedly pkg_package will do actual packaging

# $1-src-dir $2-tarball $SRC_URL
# return 0=good, anything else=bad
# download github commit $ZIPGIT and convert it to $TARBALL
pkg_download() {
	local repo=${TARBALL%%-*}
	local topdir=${repo}-${ZIPGIT%.*}
	local tarballbase=${TARBALL%.*} # delete .txz|.tgz|.gx|.gz
	tarballbase=${tarballbase%.tar} # for .tar.gz and .tar.tz
	echo downloading $ZIPGIT
	wget --no-check-certificate -O $1/$ZIPGIT "$SRC_URL" &&
	rm -fr $1/${topdir} $1/${tarballbase} &&
	unzip -q $1/$ZIPGIT -d $1 &&
	mv $1/${topdir} $1/${tarballbase}
	GZIP=-n tar -caf $1/$2 -C $1 ${tarballbase} || return 1
	rm -rf $1/${ZIPGIT} $1/${topdir} $1/${tarballbase}
	return 0
}


### default pkg_prepare
### default pkg_package
### build
pkg_build() {
	cd /tmp/libxkbcommon*
	./autogen.sh && automake &&
	pkg_build_autoconf &&
	pkg_build_slackdesc &&
	rm -rf /var/cache/ldconfig
}
