# Copyright 1999-2010 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ EAPI=2 inherit eutils DESCRIPTION="NetSurf is a free, open source web browser. It is written in C, has its own layout and rendering engine entirely written from scratch. It is small and capable of handling many of the web standards in use today." HOMEPAGE="http://www.netsurf-browser.org" SRC_URI="http://www.netsurf-browser.org/downloads/releases/${P}-src.tar.gz" LICENSE="GPL2" SLOT="0" KEYWORDS="~x86 ~amd64" IUSE="bmp fbcon freetype gif mng pdf svgtiny" LANGS="en de fr it nl" for L in ${LANGS}; do IUSE="${IUSE} linguas_${L/-/_}" done DEPEND="dev-libs/libxml2 net-misc/curl media-libs/lcms net-libs/hubbub net-libs/libcss net-libs/libwapcaplet bmp? ( net-libs/libnsbmp ) fbcon? ( net-libs/libnsfb ) freetype? ( media-libs/freetype:2 media-fonts/dejavu ) gif? ( net-libs/libnsgif ) mng? ( media-libs/libmng ) pdf? ( >=media-libs/libharu-2.2 ) svgtiny? ( net-libs/libsvgtiny )" RDEPEND="${DEPEND}" src_prepare() { cd ${WORKDIR}/${PN} if use bmp; then echo "override NETSURF_USE_BMP := YES" >> Makefile.config else echo "override NETSURF_USE_BMP := NO" >> Makefile.config fi if use freetype; then echo "override NETSURF_FB_FONTLIB := freetype" >> Makefile.config epatch "${FILESDIR}/fix-font-path.patch" else echo "override NETSURF_FB_FONTLIB := internal" >> Makefile.config fi if use gif; then echo "override NETSURF_USE_GIF := YES" >> Makefile.config else echo "override NETSURF_USE_GIF := NO" >> Makefile.config fi if use mng; then echo "override NETSURF_USE_MNG := YES" >> Makefile.config else echo "override NETSURF_USE_MNG := NO" >> Makefile.config fi if use pdf; then echo "override NETSURF_USE_HARU_PDF := YES" >> Makefile.config else echo "override NETSURF_USE_HARU_PDF := NO" >> Makefile.config fi if use svgtiny; then echo "override NETSURF_USE_NSSVG := YES" >> Makefile.config echo "override NETSURF_USE_RSVG := NO" >> Makefile.config else echo "override NETSURF_USE_NSSVG := NO" >> Makefile.config echo "override NETSURF_USE_RSVG := YES" >> Makefile.config fi } src_compile() { RISCRES="${WORKDIR}/${PN}/!NetSurf/Resources" GTKRES="${WORKDIR}/${PN}/gtk/res" FBRES="${WORKDIR}/${PN}/framebuffer/res" cd ${WORKDIR}/${PN} emake || die "emake failed" cd ${GTKRES} for i in *.glade do gzip -9v $i mv $i.gz $i done find ${GTKRES}/ -type l -exec rm '{}' \; mv ${RISCRES}/AdBlock,f79 ${GTKRES}/adblock.css mv ${RISCRES}/Aliases ${GTKRES}/ mv ${RISCRES}/ca-bundle ${GTKRES}/ca-bundle.txt mv ${RISCRES}/CSS,f79 ${GTKRES}/default.css mv ${RISCRES}/Quirks,f79 ${GTKRES}/quirks.css mv ${WORKDIR}/${PN}/\!NetSurf/Docs/about ${GTKRES}/docs/ cp ${RISCRES}/en/Messages ${GTKRES}/C/ for L in ${LANGS}; do if use linguas_${L/-/_}; then mv ${RISCRES}/${L}/Messages ${GTKRES}/${L}/ else rm ${GTKRES}/${L}/ -r fi done cd ${WORKDIR}/${PN} if use fbcon ; then emake TARGET="framebuffer" || die "emake TARGET=\"framebuffer\" failed"; fi find ${FBRES}/ -type l -exec rm '{}' \; } src_install() { insopts -m755 -o root -g root dodir /usr/share/netsurf/gtk/res insinto /usr/share/netsurf/gtk/res doins -r ${WORKDIR}/${PN}/gtk/res/* || die "install failed" insinto /usr/share/netsurf doins ${WORKDIR}/${PN}/nsgtk doins ${FILESDIR}/netsurf dosym /usr/share/netsurf/netsurf /usr/bin/netsurf if use fbcon ; then dodir /usr/share/netsurf/framebuffer/res insinto /usr/share/netsurf/framebuffer/res doins -r ${WORKDIR}/${PN}/framebuffer/res/* || die "framebuffer resources install failed" insinto /usr/share/netsurf doins ${WORKDIR}/${PN}/nsfb dosym /usr/share/netsurf/gtk/res/throbber /usr/share/netsurf/framebuffer/res/ dosym /usr/share/netsurf/gtk/res/default.css /usr/share/netsurf/framebuffer/res/ dosym /usr/share/netsurf/gtk/res/quirks.css /usr/share/netsurf/framebuffer/res/ dosym /usr/share/netsurf/gtk/res/Aliases /usr/share/netsurf/framebuffer/res/ dosym /usr/share/netsurf/gtk/res/en/Messages /usr/share/netsurf/framebuffer/res/messages fi insinto /usr/share/pixmaps doins ${WORKDIR}/${PN}/gtk/res/netsurf.xpm make_desktop_entry netsurf "NetSurf" "netsurf" "Network;WebBrowser" }