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

# source: james
TARBALL=xpra-$PKGVER.tar.xz
MD5SUM=67ae262de9c7175c14d2a1fb24dad1a1
SRC_URL=https://www.xpra.org/src/$TARBALL
BUNDLE=

SLACKREQ='python xorg-server xf86-video-dummy python-pygtk 
python-lz4 python-rencode python-pillow python-netifaces' # cython compile-time only
SLACKDESC="xpra2: xpra2 $PKGVER (X Persistent Remote Access)  
xpra2:  
xpra2: Xpra gives you \"persistent remote applications\" for X. That is, unlike 
xpra2: normal X applications, applications run with xpra are \"persistent\" - you 
xpra2: can run them remotely, and they don't die if your connection does. You 
xpra2: can detach them, and reattach them later - even from another computer - 
xpra2: with no loss of state. 
xpra2: 
xpra2: xpra2 (0.11.3 onwards) is not compatible with xpra (pre-0.11.3 versions).
xpra2: 
xpra2: http://www.xpra.org
"

### default pkg_download
### default pkg_prepare
### default pkg_package
### build
pkg_build() {
	! [ -e /usr/bin/env ] && ln -sf /tools/bin/env /usr/bin

	cd /tmp/xpra*/

	# FTBFS x265 changes its definition
	sed -i -e '/NAL_UNIT_CODED_SLICE_TLA_R/d' xpra/codecs/enc_x265/encoder.pyx &&
	
	# build and install
	python setup.py install --without-strict --without-enc_ffmpeg && # ffmpeg changes too much
	rm -f /usr/bin/env &&
	pkg_build_slackdesc &&

	# install other stuff
	mkdir -p /usr/share/pixmaps &&
	cp /usr/share/icons/xpra.png /usr/share/pixmaps &&

	# install cert and /etc/default/xpra - this makes the built-in service works
	install -m644 /tmp/pkg/ssl-cert.pem /etc/xpra &&
	mkdir -p /etc/default &&
	install -m644 /tmp/pkg/xpra-default /etc/default/xpra
}
