summaryrefslogtreecommitdiff
path: root/graphics/mupdf/Makefile
blob: 9a96085c89d4543f48d546dd4ae226b4655ac481 (plain)
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
# New ports collection makefile for:	mupdf
# Date created:		2009-08-07
# Whom:			Martin Dieringer <martin.dieringer@gmx.de>
#
# $FreeBSD$

PORTNAME=	mupdf
PORTVERSION=	0.9
PORTREVISION=	1
PORTEPOCH=	1
CATEGORIES=	graphics
MASTER_SITES=	GOOGLE_CODE \
		http://www.mupdf.com/download/
EXTRACT_SUFX=	-source.tar.gz

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

LICENSE=	GPLv3
LICENSE_FILE=	${WRKSRC}/COPYING

LIB_DEPENDS=	freetype.9:${PORTSDIR}/print/freetype2 \
		jpeg.11:${PORTSDIR}/graphics/jpeg \
		jbig2dec.0:${PORTSDIR}/graphics/jbig2dec \
		openjpeg.2:${PORTSDIR}/graphics/openjpeg

USE_GMAKE=	yes
MAKE_ARGS+=	build=release prefix=${PREFIX} verbose=1 mandir=${PREFIX}/man
USE_XORG=	x11 xext
USE_GNOME=	pkgconfig
MAN1=		mupdf.1 mu_pdfclean.1 mu_pdfdraw.1 mu_pdfshow.1

MAKE_JOBS_SAFE=	yes

OPTIONS=	SCROLL	"Build with scroll hacks" on \

.include <bsd.port.options.mk>

.if ${ARCH} == "amd64" || ${ARCH} == "i386"
CFLAGS+=	-mfpmath=sse
.endif

.if defined(WITH_SCROLL)
EXTRA_PATCHES+=	${FILESDIR}/scroll_hack-apps_pdfapp.c
.endif

post-patch:	.SILENT
	${REINPLACE_CMD} \
		-e 's#\(PDF_APPS :=.*/\)#\1mu_#' \
		-e 's#\(XPS_APPS :=.*/\)#\1mu_#' \
		-e 's#\(MUPDF) :.*/\)#\1mu_#' \
		-e 's#\(OUT)/\).*: apps/#\1mu_%.o : apps/#' \
		-e '/install:/,/^$$/ { /-d/d; }' \
		-e '/install.*bindir)$$/s/install/$$(BSD_INSTALL_PROGRAM)/' \
		-e '/install.*libdir)$$/s/install/$$(BSD_INSTALL_LIB)/' \
		-e '/install.*incdir)$$/s/install/$$(BSD_INSTALL_DATA)/' \
		-e '/install.*man1$$/s/install/$$(BSD_INSTALL_MAN)/' \
		${WRKSRC}/Makefile
	${REINPLACE_CMD} -e 's/-O2//' \
		-e 's|/usr/local|${LOCALBASE}|' \
		${WRKSRC}/Makerules

pre-install:	.SILENT
	${FIND} ${WRKSRC} -name pdf\*.1 -exec ${SH} -c 'mv {} $$(dirname {})/mu_$$(basename {})' \;

.include <bsd.port.pre.mk>
.include <bsd.port.post.mk>