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

# source: james
TARBALL=netsurf-all-${PKGVER}.tar.gz
MD5SUM=f5b2ea34c85775941ab3c2144783d396
SRC_URL=http://download.netsurf-browser.org/netsurf/releases/source-full/$TARBALL
BUNDLE=

SLACKREQ='gtk2 librsvg expat libpng openssl libjpeg-turbo' # build-time only: libidn 
SLACKDESC="netsurf: netsurf $PKGVER (Fast and lightweight web browser)
netsurf: 
netsurf: Small as a mouse, fast as a cheetah and available for free. NetSurf 
netsurf: is a multi-platform web browser for RISC OS, UNIX-like platforms 
netsurf: (including Linux), Mac OS X, and more. Whether you want to check your 
netsurf: webmail, read the news or post to discussion forums, NetSurf is your 
netsurf: lightweight gateway to the world wide web. Actively developed, 
netsurf: NetSurf is continually evolving and improving.  
netsurf: Note: Netsurf does not support Flash.
netsurf: 
netsurf: http://www.netsurf-browser.org/
"

### default pkg_download
### default pkg_prepare
### default pkg_package
### build
pkg_build() {
	cd /tmp/netsurf*

	# our pkg-config can't operate with a blank PKG_CONFIG_PATH
	sed -i -e "/PKG_CONFIG_PATH/ s|$|:${PKG_CONFIG_PATH}|" Makefile &&

	cat << "EOF" > netsurf/Makefile.config &&
# gstreamer doesn't work because of changes in glib 2.30+
# override NETSURF_USE_VIDEO := YES
EOF

	make PREFIX=/usr && make PREFIX=/usr install &&
	pkg_build_slackdesc &&
	rm -rf /root/.ccache &&

	# copy icon and desktop files
	mkdir -p /usr/share/applications &&
	install -m644 netsurf/frontends/gtk/res/netsurf-gtk.desktop /usr/share/applications &&
	sed -i -e 's|netsurf.png|/usr/share/netsurf/netsurf.xpm|; s|netsurf-gtk|netsurf| 
	           s|Categories=.*|Categories=X-Internet|' \
	           /usr/share/applications/netsurf-gtk.desktop
}
