aboutsummaryrefslogtreecommitdiffstats
path: root/graphics/xfig/Makefile
blob: c06dcea4859d885254127b9cfb8ac5b10fa6bf98 (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
# Created by: roberto
# $FreeBSD$

PORTNAME=   xfig
PORTVERSION=    3.2.5b
PORTREVISION=   1
CATEGORIES= graphics
MASTER_SITES=   SF/mcj/mcj-source/
DISTNAME=   ${PORTNAME}.${PORTVERSION}.full

MAINTAINER= mjl@luckie.org.nz
COMMENT=    A drawing program for X11

LIB_DEPENDS=    jpeg.11:${PORTSDIR}/graphics/jpeg \
        png15:${PORTSDIR}/graphics/png \
        Xaw3d.8:${PORTSDIR}/x11-toolkits/Xaw3d
RUN_DEPENDS=    fig2dev:${PORTSDIR}/print/transfig

CONFLICTS=  xfig-[12].* xfig-3.1* xfig-3.2.[1234]*

WRKSRC=     ${WRKDIR}/${PORTNAME}.${PORTVERSION}

USE_IMAKE=  yes
USE_XORG=   ice sm x11 xaw xext xi xmu xpm xt
MAN1=       xfig.1
MANCOMPRESSED=  yes
USE_GCC=    any

MAKE_ENV+=  DOCSDIR=${DOCSDIR} CHMOD=${CHMOD} TAR=${TAR}
MAKE_ARGS+= INSTALLFLAGS="${COPY}" \
        INSTPGMFLAGS="${STRIP} ${_BINOWNGRP} -m ${BINMODE}" \
        INSTDATFLAGS="${_SHROWNGRP} -m ${SHAREMODE}" \
        INSTMANFLAGS="${_MANOWNGRP} -m ${MANMODE}"

OPTIONS_DEFINE= GHOSTSCRIPT I18N DOCS
OPTIONS_DEFAULT=    GHOSTSCRIPT I18N
I18N_DESC=  I18N support and Japanese docs

.include <bsd.port.options.mk>

.if ${PORT_OPTIONS:MDOCS}
INSTALL_TARGET= install install.libs install.html
.endif

.if ! ${PORT_OPTIONS:MI18N} || ! ${PORT_OPTIONS:MDOCS}
PLIST_SUB+= JPORTDOCS="@comment "
.else
PLIST_SUB=  JPORTDOCS=""
.endif

.if ${PORT_OPTIONS:MI18N}
USES+=  gettext
.endif

post-extract:
    @cd ${WRKSRC}/Doc && ${FIND} -s . -type d -print0 | ${XARGS} -0 ${CHMOD} a+rx
    @cd ${WRKSRC}/Doc && ${FIND} . -type f -print0 | ${XARGS} -0 ${CHMOD} a-x+r
    @${CHMOD} a+rx ${WRKSRC}/Libraries
    @cd ${WRKSRC}/Libraries && ${FIND} -s . -type d -print0 | ${XARGS} -0 ${CHMOD} a+rx
    @cd ${WRKSRC}/Libraries && ${FIND} . -type f -print0 | ${XARGS} -0 ${CHMOD} a-x+r
    @${CP} ${WRKSRC}/Doc/xfig.man ${WRKSRC}

post-patch:
.if ! ${PORT_OPTIONS:MGHOSTSCRIPT}
.if ! ${PORT_OPTIONS:MI18N}
    @${REINPLACE_CMD} -e 's|-DGSBIT ||g' ${WRKSRC}/Imakefile
.else
    @${REINPLACE_CMD} -e '/^XCOMM #define I18N/s|XCOMM ||' \
        -e 's|-DGSBIT ||g' ${WRKSRC}/Imakefile
.endif
.elif ${PORT_OPTIONS:MI18N}
    @${REINPLACE_CMD} -e '/^XCOMM #define I18N/s|XCOMM ||' ${WRKSRC}/Imakefile
.endif

.include <bsd.port.mk>