aboutsummaryrefslogtreecommitdiffstats
path: root/lang/icon/Makefile
blob: 539a06888db9b47952abc77c9e21cc3d6087ff0a (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
# Created by: Thomas Gellekum <tg@FreeBSD.org>
# $FreeBSD$

PORTNAME=   icon
PORTVERSION=    9.5.1
CATEGORIES= lang
MASTER_SITES=   http://www.cs.arizona.edu/icon/ftp/packages/unix/
DISTNAME=   ${PORTNAME}-v${PORTVERSION:S/.//g}src
EXTRACT_SUFX=   .tgz

MAINTAINER= ports@FreeBSD.org
COMMENT=    The Icon programming language

USE_GCC=    any
ALL_TARGET= All
MAKE_JOBS_UNSAFE=   yes
ARCH_NAME=  bsd
ICONDIR=    ${PREFIX}/lib/${PORTNAME}

BINS=       icont iconx
BINXS=      colrbook colrpick fontpick palette vib wevents xgamma

OPTIONS_DEFINE= DOCS X11

.include <bsd.port.options.mk>

.if empty(PORT_OPTIONS:MX11)
CONFIG_CMD= Configure
PLIST_SUB=  WITHOUT_X11="@comment "
.else
USE_XORG=   x11 xpm
CFLAGS+=    -I${LOCALBASE}/include
CONFIG_CMD= X-Configure
PLIST_SUB=  WITHOUT_X11=
.endif

post-patch:
    @${REINPLACE_CMD} -e "s|^CC.*|CC=${CC}|g ; \
         s|^CFLAGS.*|CFLAGS=${CFLAGS}|g ; \
         s|/usr/X11R6|${LOCALBASE}|g ; \
         s|-lpthread|${PTHREAD_LIBS}| ; \
         s|^XLIBS.*|XLIBS=-L${LOCALBASE}/lib -lX11|g" \
        ${WRKSRC}/config/${ARCH_NAME}/Makedefs
    @${REINPLACE_CMD} -e 's|/opt/icon|${ICONDIR}|g' ${WRKSRC}/ipl/BuildBin
    @${REINPLACE_CMD} -e 's|ld -Bshareable|\$$CC -shared|g ; \
         s|-lc||g' ${WRKSRC}/ipl/cfuncs/mklib.sh

do-configure:
    @(cd ${WRKSRC}; ${SETENV} ${MAKE_ENV} ${MAKE} ${MAKE_FLAGS} \
        ${MAKEFILE} ${MAKE_ARGS} ${CONFIG_CMD} name=${ARCH_NAME})

do-install:
    ${INSTALL_MAN} ${WRKSRC}/man/man1/icon.1 ${STAGEDIR}${MANPREFIX}/man/man1
    ${INSTALL_MAN} ${WRKSRC}/man/man1/icont.1 ${STAGEDIR}${MANPREFIX}/man/man1
    @${MKDIR} ${STAGEDIR}${ICONDIR}/bin
.for file in ${BINS}
    ${INSTALL_PROGRAM} ${WRKSRC}/bin/${file} ${STAGEDIR}${ICONDIR}/bin/${file}
.endfor
.for file in icont iconx
    @${LN} -sf ${ICONDIR}/bin/${file} ${STAGEDIR}${PREFIX}/bin/${file}
.endfor
    @${LN} -sf ${ICONDIR}/bin/icont ${STAGEDIR}${PREFIX}/bin/icon
    @${MKDIR} ${STAGEDIR}${ICONDIR}/lib
    cd ${WRKSRC}/lib; ${INSTALL_DATA} *.* ${STAGEDIR}${ICONDIR}/lib
.if ${PORT_OPTIONS:MX11}
.for file in ${BINXS}
    ${INSTALL_SCRIPT} ${WRKSRC}/bin/${file} ${STAGEDIR}${ICONDIR}/bin/${file}
.endfor
    @${LN} -sf ${ICONDIR}/bin/vib ${STAGEDIR}${PREFIX}/bin/vib
.endif
    @${MKDIR} ${STAGEDIR}${DOCSDIR}
    cd ${WRKSRC}/doc; ${INSTALL_DATA} *.* ${STAGEDIR}${DOCSDIR}

.if defined(MAINTAINER_MODE)
test:   install
    (cd ${WRKSRC}; ${SETENV} ${MAKE_ENV} ${MAKE} ${MAKE_FLAGS} \
        ${MAKEFILE} ${MAKE_ARGS} Test)
.endif

.include <bsd.port.mk>