# Contributor: A. Wilcox <awilfox@adelielinux.org>
# Maintainer: A. Wilcox <awilfox@adelielinux.org>
pkgname=tigervnc
pkgver=1.8.0
pkgrel=0
pkgdesc="A high-performance, platform-neutral VNC remote desktop application"
url="http://tigervnc.org/"
arch="all"
license="GPL-2.0"
options="!check"  # No test suite.
depends=""
depends_dev=""
makedepends="cmake fltk-dev libx11-dev zlib-dev gettext-dev libjpeg-turbo-dev
	libxft-dev fontconfig-dev libxfixes-dev libxcursor-dev libxrender-dev
	libxtst-dev linux-pam-dev"
install=""
subpackages="$pkgname-lang $pkgname-doc"
source="tigervnc-$pkgver.tar.gz::https://github.com/TigerVNC/tigervnc/archive/v$pkgver.tar.gz
	libintl-fix.patch"

build() {
	cd "$builddir"
	if [ "$CBUILD" != "$CHOST" ]; then
		CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
	fi
	cmake \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_SHARED_LIBS=True \
		-DCMAKE_BUILD_TYPE=RelWithDebugInfo \
		-DCMAKE_CXX_FLAGS="$CXXFLAGS -std=c++98 -Wno-c++11-compat -Wno-maybe-uninitialized" \
		-DCMAKE_C_FLAGS="$CFLAGS" \
		-Wno-dev \
		${CMAKE_CROSSOPTS}
	make
}

package() {
	cd "$builddir"
	make DESTDIR="$pkgdir" install
}

sha512sums="c066e9781622e342667bf03fd6bbb94ed17b412b07c46764b7b73b2eb308c285e865cf1e901f7d218db05a0486fb3f8877e75da3c939ef0d020247713779327a  tigervnc-1.8.0.tar.gz
ee748bf3dc62b47161b9eb1536c3edf18e30abdc72733d8a0dec0502cb4d7f97c95cbdf89801a4a4be30a1c13aada50568f317956d4d1e5c474c54ef605ffadc  libintl-fix.patch"