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

# source: james
# have to use tarball, git contains submodule
#PKGVER=
#TARBALL=
#MD5SUM=
#SRC_URL=
#BUNDLE=

# git-master tarball
#PKGVER=0.8.8.2020.10
#MD5SUM=e52efff63c10140837fe07d7759b54c0
#hash=f8ef7e04b50a02a75f2fc68efbf80fb21580b675
#hash7=${hash#???????}; hash7=${hash%$hash7}
#TARBALL=xboxdrv-$PKGVER-$hash7.tar.bz2
#SRC_URL=https://gitlab.com/xboxdrv/xboxdrv/-/archive/$hash/xboxdrv-$hash.tar.bz2

# pre-packaged git checkout - because it requires submodules
PKGVER=0.8.8.2020.10
MD5SUM=195947a01823637ebf7ed92efe67b555
TARBALL=xboxdrv-2020.10.tar.bz2
SRC_URL=http://distro.ibiblio.org/fatdog/source/900/$TARBALL

SLACKREQ='libusb eudev libdbus-glib fmtlib gtk3'
SLACKDESC="xboxdrv: xboxdrv $PKGVER (Xbox/Xbox360 gamepad driver)
xboxdrv: 
xboxdrv: This is a Xbox/Xbox360 gamepad driver for Linux that works in 
xboxdrv: userspace. It is an alternative to the xpad kernel driver. It also 
xboxdrv: supports Thrustmaster Dual Power 3 gamepad, including rumble. Unlike 
xboxdrv: the xpad kernel driver, xboxdrv provides a wide varity of 
xboxdrv: configuration options, ability to simulate keyboard and mouse events, 
xboxdrv: remap buttons and axes, apply autofire, invert axis, tweak axis 
xboxdrv: sensitivity, emulate throttle and rudder controls and send macros.
xboxdrv: 
xboxdrv: https://xboxdrv.gitlab.io/
"

### default pkg_download
### default pkg_prepare
### default pkg_package
### build
pkg_build() {
	pkg_build_cmake &&
	pkg_build_slackdesc &&

	# we don't want these
	rm -rf /usr/$LIBDIR/libargparser.a /usr/include/argparser &&

	# install examples
	cd .. &&
	mkdir -p /usr/share/xboxdrv &&
	cp -a examples runxboxdrv /usr/share/xboxdrv &&

	# dbus config
	mkdir -p /etc/dbus-1/system.d &&
	install -m644 data/org.seul.Xboxdrv.conf /etc/dbus-1/system.d
}
