aboutsummaryrefslogtreecommitdiff
path: root/www/netsurf/Makefile
blob: 9df5ae91f1daefaae41f5415f684126a2d5abd3f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# Created by: Andrew Pantyukhin <infofarmer@FreeBSD.org>
# $FreeBSD$

PORTNAME=	netsurf
PORTVERSION=	3.6
PORTREVISION=	1
CATEGORIES=	www
MASTER_SITES=	http://download.netsurf-browser.org/netsurf/releases/source/
DISTNAME=	${PORTNAME}-${PORTVERSION}-src

MAINTAINER=	ports@FreeBSD.org
COMMENT=	Lightweight web browser

LICENSE=	GPLv2 MIT
LICENSE_COMB=	multi

BUILD_DEPENDS=	duk:lang/duktape \
		nsgenbind:devel/nsgenbind \
		p5-HTML-Parser>=3.72:www/p5-HTML-Parser
LIB_DEPENDS=	libcurl.so:ftp/curl \
		libpng.so:graphics/png \
		libnsutils.so:devel/libnsutils \
		libutf8proc.so:textproc/libutf8proc \
		libnsgif.so:graphics/libnsgif \
		libnsbmp.so:graphics/libnsbmp \
		libdom.so:www/libdom \
		libcss.so:textproc/libcss \
		libparserutils.so:devel/libparserutils \
		libwapcaplet.so:textproc/libwapcaplet \
		libhubbub.so:www/libhubbub \
		libexpat.so:textproc/expat2 \
		libnspsl.so:dns/libnspsl
RUN_DEPENDS=	duk:lang/duktape \
		${LOCALBASE}/share/certs/ca-root-nss.crt:security/ca_root_nss

ALL_TARGET=	#empty
LDFLAGS+=	-L${OPENSSLLIB} -lssl -lcrypto ${ICONV_LIB}
CFLAGS+=	-I${OPENSSLINC}
MAKE_ARGS=	HOST_CC="${CC}" CC="${CC}" CCOPT="" HOST="${OPSYS}" \
		TARGET="gtk3" \
		WARNFLAGS="" Q="" OPTCFLAGS="${CFLAGS}"
MAKE_ENV+=	COMPONENT_TYPE="lib-shared" \
		FLEX="${LOCALBASE}/bin/flex"
USES=		bison desktop-file-utils gettext-runtime gmake iconv jpeg \
		localbase pkgconfig shebangfix ssl
USE_GNOME=	glib20 gtk30 cairo librsvg2

WRKSRC=		${WRKDIR}/${DISTNAME:S/-src//}

SHEBANG_FILES=	utils/split-messages.pl
perl_CMD=	${SETENV} perl

OPTIONS_DEFINE=	GSTREAMER
OPTIONS_EXCLUDE=	GSTREAMER
GSTREAMER_USE=		GSTREAMER=yes, good

.include <bsd.port.pre.mk>

post-patch:
	@${REINPLACE_CMD} '/CFLAGS/d' \
		${WRKSRC}//Makefile.defaults
	@${REINPLACE_CMD} 's| -O2||' \
		${WRKSRC}/frontends/gtk/Makefile.defaults
	@${REINPLACE_CMD} -e 's|%%PREFIX%%|${PREFIX}|' \
		${WRKSRC}/frontends/gtk/gui.c

do-configure:
	@${CP} ${FILESDIR}/Makefile.config  ${WRKSRC}
.if empty(ICONV_LIB)
	@${REINPLACE_CMD} '/NETSURF_USE_LIBICONV_PLUG/ s|NO|YES|' \
		${WRKSRC}/Makefile.config
.endif
.if ${PORT_OPTIONS:MGSTREAMER}
	@${REINPLACE_CMD} '/NETSURF_USE_VIDEO/ s|NO|YES|' \
		${WRKSRC}/Makefile.config
.endif

post-install:
	cd ${STAGEDIR}${PREFIX}/bin && ${LN} -sf netsurf-gtk3 \
		netsurf-gtk
.for d in applications pixmaps
	${MKDIR} ${STAGEDIR}${PREFIX}/share/${d}
.endfor
	${INSTALL_DATA} ${WRKSRC}/frontends/gtk/res/netsurf-gtk.desktop \
		${STAGEDIR}${PREFIX}/share/applications
	${INSTALL_DATA} ${WRKSRC}/frontends/gtk/res/netsurf.xpm \
		${STAGEDIR}${PREFIX}/share/pixmaps

.include <bsd.port.post.mk>