# Contributor: Sören Tempel <soeren+alpine@soeren-tempel.net>
# Contributor: ScrumpyJack <scrumpyjack@st.ilet.to>
# Maintainer: ScrumpyJack <scrumpyjack@st.ilet.to>
pkgname=netsurf
pkgver=3.7
pkgrel=1
pkgdesc="NetSurf is a free, open source web browser."
url="http://www.netsurf-browser.org"
arch="all"
license="GPL-2.0"
depends=""
depends_dev=""
makedepends="curl-dev libressl-dev doxygen flex bison libwebp-dev lcms2-dev
	libmng-dev gperf libglade-dev gtk+-dev libcurl libpng-dev libidn-dev
	check-dev libidn-dev libharu-dev librsvg-dev libjpeg-turbo-dev"
install=""
subpackages="$pkgname-doc"
source="$pkgname-$pkgver.tar.gz::http://download.netsurf-browser.org/netsurf/releases/source-full/$pkgname-all-$pkgver.tar.gz
	netsurf"

builddir="$srcdir"/$pkgname-all-$pkgver
prepare() {
	default_prepare
	sed 's:-Werror::' -i "$builddir"/libsvgtiny/Makefile
}

build() {
	cd "$builddir"
	make PREFIX=/usr TARGET=gtk
}

package() {
	cd "$builddir"
	make PREFIX=/usr TARGET=gtk DESTDIR="$pkgdir" install

	install -Dm755 "$srcdir/netsurf" "$pkgdir/usr/bin/$pkgname"

	mkdir -p "$pkgdir"/usr/share/man/man1/
	install -Dm644 netsurf/docs/netsurf-gtk.1 "$pkgdir"/usr/share/man/man1/
}

sha512sums="569c5a1bcce35bd69d3679ff5d7edd086238882ad24a9bcbdb51fccc2a950de45946f840aa38afb339c4c290c3070b4d6fe08eb6c912e9403489415beb3d6a91  netsurf-3.7.tar.gz
a22f945720d3bd8fc27396aea973be1e0b6f7a03bbe438fb48faf680882be46b05fc252b5fe8d55cde0cc11f3647f4ac331dcc330f47ae12a93b327f30a9ad2a  netsurf"
