# Contributor: Francois Boulogne <fboulogne at april dot org>
# Maintainer: Gaetan Bisson <bisson@archlinux.org>

pkgname=subsurface
_pkgname=Subsurface
pkgver=4.9.3
pkgrel=1
pkgdesc='Divelog program'
url='https://subsurface-divelog.org/'
license=('GPL2')
arch=('x86_64')
makedepends=('cmake' 'asciidoc' 'qt5-tools')
depends=('libzip' 'libxml2' 'libxslt' 'sqlite' 'libusb' 'libgit2'
         'subsurface-libdc' 'qt5-svg' 'qt5-location'
         'qt5-connectivity' 'qt5-webkit' 'grantlee' 'googlemaps')
source=("https://subsurface-divelog.org/downloads/${_pkgname}-${pkgver}.tgz")
sha256sums=('8e35ae13d0ca703da412ebef2e21ddc59cc63a0d7a1da6143654375c20b105b8')

# qt5-webkit still used for: printing, manual, facebook

build() {
	cd "${srcdir}/${_pkgname}-${pkgver}"
	install -d build
	cd build
	cmake \
		-DCMAKE_BUILD_TYPE=Release \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DLIBDIVECOMPUTER_INCLUDE_DIR=/usr/include/libdivecomputer \
		..
	make
}

package() {
	cd "${srcdir}/${_pkgname}-${pkgver}"
	cd build
	make DESTDIR="${pkgdir}" install
}
