aboutsummaryrefslogtreecommitdiff
path: root/graphics/mupdf/Makefile
blob: 9d99463e642f2ddec3784ecd57316cbc2cfde4d2 (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
# Created by: Martin Dieringer <martin.dieringer@gmx.de>
# $FreeBSD$

PORTNAME=	mupdf
PORTVERSION=	1.2
PORTEPOCH=	1
CATEGORIES=	graphics
MASTER_SITES=	GOOGLE_CODE \
		http://www.mupdf.com/download/
EXTRACT_SUFX=	-source.zip

MAINTAINER=	lichray@gmail.com
COMMENT=	Lightweight PDF viewer and toolkit

LICENSE=	AGPLv3

LIB_DEPENDS=	freetype:${PORTSDIR}/print/freetype2 \
		jpeg:${PORTSDIR}/graphics/jpeg \
		jbig2dec:${PORTSDIR}/graphics/jbig2dec \
		openjpeg:${PORTSDIR}/graphics/openjpeg

USE_GMAKE=	yes
MAKE_ARGS+=	build=release prefix=${PREFIX} verbose=1 mandir=${PREFIX}/man \
		XCFLAGS=-I${LOCALBASE}/include
USES=		pkgconfig
USE_XORG=	x11 xext
MAN1=		mupdf.1 mutool.1 mudraw.1

MAKE_JOBS_SAFE=	yes
WRKSRC=		${WRKDIR}/${PORTNAME}-${PORTVERSION}-source

OPTIONS_DEFINE=	SCROLL JS
OPTIONS_DEFAULT=SCROLL

SCROLL_DESC=	Build with scroll hacks
JS_DESC=	JavaScript support (V8 engine)

.include <bsd.port.options.mk>

.if ${CC:T:Mclang} == "clang"
CFLAGS+=	-no-integrated-as
.elif ${ARCH} == "amd64" || ${ARCH} == "i386"
CFLAGS+=	-mfpmath=sse
.endif

.if ${PORT_OPTIONS:MSCROLL}
EXTRA_PATCHES+=	${FILESDIR}/scroll_hack-apps_pdfapp.c
.endif

.if ${PORT_OPTIONS:MJS}
LIB_DEPENDS+=	v8:${PORTSDIR}/lang/v8
MAKE_ARGS+=	V8_PRESENT=1 V8LIBS=-lv8
.endif

post-patch:	.SILENT
	${REINPLACE_CMD} \
		-e '/install:/,/^$$/ { /-d/d; }' \
		-e '/install.*bindir)$$/s/install/$$(BSD_INSTALL_PROGRAM)/' \
		-e '/install.*libdir)$$/s/install/$$(BSD_INSTALL_DATA)/' \
		-e '/install.*incdir)$$/s/install/$$(BSD_INSTALL_DATA)/' \
		-e '/install.*man1$$/s/install/$$(BSD_INSTALL_MAN)/' \
		${WRKSRC}/Makefile
	${REINPLACE_CMD} -e 's/-pipe -O2 //' \
		-e 's|/usr/local|${LOCALBASE}|' \
		${WRKSRC}/Makerules
	${RM} -r ${WRKSRC}/thirdparty/*

.include <bsd.port.mk>