aboutsummaryrefslogtreecommitdiffstats
path: root/devel/doxygen/Makefile
blob: 93c1ed32bcb0cb5dadd2c2f1f7026847a26edddc (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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
# New ports collection makefile for:    doxygen
# Date created:     20 March 1998
# Whom:         Joep Grooten <joep@di.nl>
#
# $FreeBSD$
#

PORTNAME=   doxygen
PORTVERSION=    1.8.0
PORTREVISION=   1
CATEGORIES= devel
MASTER_SITES=   ftp://ftp.stack.nl/pub/users/dimitri/ \
        http://ftp.stack.nl/pub/users/dimitri/
EXTRACT_SUFX=   .src.tar.gz

MAINTAINER= cyberbotx@cyberbotx.com
COMMENT=    A documentation system for C, C++ and other languages

LICENSE=    GPLv2
LICENSE_FILE=   ${WRKSRC}/LICENSE

BUILD_DEPENDS=  tmake:${PORTSDIR}/devel/tmake
LIB_DEPENDS=    png15:${PORTSDIR}/graphics/png

USE_BISON=  build
USE_ICONV=  yes
ALL_TARGET= all
USE_PERL5=  yes
HAS_CONFIGURE=  yes
USE_GMAKE=  yes
QT_NONSTANDARD= yes # non-standard configure arguments
CONFIGURE_ARGS= --prefix ${PREFIX} --perl ${PERL} --make ${GMAKE} \
        --install "${INSTALL}"
MAKE_JOBS_UNSAFE=   yes
REINPLACE_ARGS= -i ''

EXTRACT_AFTER_ARGS=|${TAR} -xpf - \
        --exclude '*/libmd5'    \
        --exclude '*/libpng'    \
        --exclude '*/tmake'

PLIST=      ${WRKDIR}/plist
TMPDOCDEST= ${WRKDIR}/tmpdocdest

PLIST_FILES=    bin/doxygen

OPTIONS=    DOXYWIZARD "Enable doxywizard" on \
        LATEX "Enable LaTeX support" on

.include <bsd.port.options.mk>

.if !defined(NOPORTDOCS)
ALL_TARGET+=    docs
USE_PYTHON_BUILD=   yes
BUILD_DEPENDS+= dot:${PORTSDIR}/graphics/graphviz

.if !defined(WITHOUT_LATEX)
ALL_TARGET+=    pdf
BUILD_DEPENDS+= dvips:${PORTSDIR}/print/dvipsk-tetex \
        latex:${PORTSDIR}/print/teTeX
USE_GHOSTSCRIPT_BUILD=  yes
MAKE_ARGS+= HAVE_LATEX=yes
.endif # !defined(WITHOUT_LATEX)
.endif # !defined(NOPORTDOCS)

.if !defined(WITHOUT_DOXYWIZARD)
USE_QT4=    corelib gui xml qmake_build moc_build rcc_build

# Need this in env for build
QTDIR?=     ${QT_PREFIX}
CONFIGURE_ENV=  QTDIR="${QTDIR}"
CONFIGURE_ARGS+=--with-doxywizard
.endif # !defined(WITHOUT_DOXYWIZARD)

.if ${MACHINE_ARCH:L} == alpha
CONFIGURE_ARGS+=    --enable-langs no
.endif

.if !defined(WITHOUT_DOXYWIZARD)
PLIST_FILES+=   bin/doxywizard
.endif # !defined(WITHOUT_DOXYWIZARD)

pre-configure:
    @cd ${WRKSRC};for pro in src/*.pro.in addon/doxywizard/doxywizard.pro.in;do \
        ${ECHO} "unix:LIBS += -liconv" >> $$pro; done
    @${CHMOD} +x ${WRKSRC}/configure

post-configure:
    @${REINPLACE_CMD} -e 's|TMAKE *=.*|TMAKE=${LOCALBASE}/bin/tmake|' \
        -e 's|TMAKEPATH *=.*|TMAKEPATH=${LOCALBASE}/share/tmake/freebsd-g++|' \
            ${WRKSRC}/Makefile ${WRKSRC}/*/Makefile \
            ${WRKSRC}/addon/doxywizard/Makefile

post-build:
    cd ${BUILD_WRKSRC}/examples; \
    ${SETENV} ${MAKE_ENV} ${GMAKE} ${MAKE_FLAGS} Makefile ${MAKE_ARGS} all

pre-install:
    ${RM} -rf ${TMPDOCDEST} ${PLIST}
    ${TOUCH} ${PLIST}
.if !defined(NOPORTDOCS)
    ${MKDIR} ${TMPDOCDEST}/doxygen
    ${RM} -f ${WRKSRC}/examples/diagrams/html/*.md5 \
         ${WRKSRC}/examples/diagrams/html/*.map
    ${TAR} -C ${WRKSRC} --exclude '*/_*' -cf - html \
        | ${TAR} -C ${TMPDOCDEST}/doxygen --unlink -xf -
    ${TAR} -C ${WRKSRC} --exclude '*/Makefile*' --exclude '*.dot' \
        -cf - examples \
        | ${TAR} -C ${TMPDOCDEST}/doxygen --unlink -xf -
.if !defined(WITHOUT_LATEX)
    ${INSTALL_DATA} ${WRKSRC}/latex/doxygen_manual.dvi \
            ${WRKSRC}/latex/doxygen_manual.pdf \
            ${WRKSRC}/latex/doxygen_manual.ps \
            ${WRKSRC}/latex/archoverview.eps \
            ${WRKSRC}/latex/doxygen_logo.eps \
            ${TMPDOCDEST}/doxygen
.endif # !defined(WITHOUT_LATEX)
    @cd ${TMPDOCDEST} \
    && ${FIND} -s * -type f -o -type l \
        | ${SED} -e 's|^|share/doc/|'>> ${PLIST} \
    && ${FIND} -d * -type d \
        | ${SED} -e 's|^|@dirrm share/doc/|' >> ${PLIST}
.endif # !defined(NOPORTDOCS)

do-install:
    ${INSTALL_PROGRAM} ${WRKSRC}/bin/doxygen ${PREFIX}/bin/
.if !defined(WITHOUT_DOXYWIZARD)
    ${INSTALL_PROGRAM} ${WRKSRC}/bin/doxywizard ${PREFIX}/bin/
.endif # !defined(WITHOUT_DOXYWIZARD)
.if !defined(NOPORTDOCS)
    ${MKDIR} ${PREFIX}/share/doc/doxygen
    ${TAR} -C ${TMPDOCDEST} -cf - doxygen \
        | ${TAR} -C ${PREFIX}/share/doc --unlink -xf -
.endif # !defined(NOPORTDOCS)

.include <bsd.port.mk>