# Contributor: Francesco Colista <fcolista@alpinelinux.org>
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=wt
pkgver=3.3.8
pkgrel=1
pkgdesc="A C++ library and application server for developing and deploying web applications"
url="http://www.webtoolkit.eu"
arch="all"
license="GPL"
depends=""
depends_dev="zlib-dev boost-dev sqlite-dev mesa-dev glu-dev graphicsmagick-dev
	libressl-dev pango-dev sqlite-dev fcgi-dev postgresql-dev qt-dev libharu-dev"
makedepends="$depends_dev cmake boost"
pkgroups="wt"
pkgusers="wt"
options="!check"
subpackages="$pkgname-dev"
source="$pkgname-$pkgver.tar.gz::https://github.com/kdeforche/$pkgname/archive/$pkgver.tar.gz"
builddir="$srcdir"/$pkgname-$pkgver

build() {
	cd "$builddir"
	mkdir -p build && cd build
	CXXFLAGS="-fpermissive" \
	cmake \
	      -DCONNECTOR_HTTP=ON \
	      -DWT_CPP_11_MODE=-std=c++11 \
	      -DWT_WRASTERIMAGE_IMPLEMENTATION=GraphicsMagick \
	      -DCMAKE_INSTALL_PREFIX=/usr \
	      -DWEBUSER=$pkgusers \
	      -DWEBGROUP=$pkggroups \
	      -DRUNDIR="$pkgdir"/var/run/wt \
	      -DUSE_SYSTEM_SQLITE3=ON \
	      -DINSTALL_EXAMPLES=ON \
	      -DBUILD_EXAMPLES=OFF \
	      -DINSTALL_FINDWT_CMAKE_FILE=ON \
	..
	make
}

package() {
	cd "$builddir"/build
	make DESTDIR=$pkgdir install
	rm -rf $pkgdir/usr/cmake
	rm -rf $pkgdir/var/run
}

sha512sums="227bfa888ad53c9a22205d79de0111a286fd1f6a6fa46a1a8fb3795fdae45fc1cc19b95600585310cd10fee57e6355067f073c7ece72e68aa5656b512ec311ad  wt-3.3.8.tar.gz"
