aboutsummaryrefslogtreecommitdiffstats
path: root/devel/tcllib/Makefile
blob: 19099a7ba9fc615a6796ea67785eb67cf6e1356b (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
# New ports collection makefile for:    tcllib
# Date created:             27 Apr 2000
# Whom:                 Mikhail Teterin <mi@aldan.algebra.com>
#
# $FreeBSD$
#

PORTNAME=   tcllib
PORTVERSION=    1.14
PORTREVISION=   1
CATEGORIES= devel tcl
MASTER_SITES=   SF

MAINTAINER= tcltk@FreeBSD.org
COMMENT=    A collection of utility modules for Tcl

USE_TCL_BUILD=  84+
USE_TCL_RUN=    ${USE_TCL_BUILD}

USE_BZIP2=  yes
GNU_CONFIGURE=  yes
ALL_TARGET= all
MAKE_ENV+=  LANG=C

.include <bsd.port.pre.mk>
.include "Makefile.man"

CONFIGURE_ENV+= ac_cv_path_tclsh="${TCLSH}"

post-patch:
    #
    # Ensure, the detailed output of vendors' self-tests is
    # available in addition to the pretty progress report:
    #
    ${REINPLACE_CMD} -e 's,test run,test run -l testlog,' \
        -e 's,$$(libdir)/@PACKAGE@@VERSION@,$$(libdir)/@PACKAGE@,' \
        ${WRKSRC}/Makefile.in
    ${FIND} ${WRKSRC}/apps -type f ! -name "*.man" | ${XARGS} \
       ${REINPLACE_CMD} -e 's,exec tclsh,exec ${TCLSH},'
    #
    # patch(1) adds a newline at eof, so we need to remove it here
    #
    ${AWK} 'NR > 1 { print h } { h = $$0 } END { ORS = ""; print h }' \
       ${WRKSRC}/modules/doctools/tests/text/04 > ${WRKSRC}/modules/doctools/tests/text/04.new
    ${MV} ${WRKSRC}/modules/doctools/tests/text/04.new ${WRKSRC}/modules/doctools/tests/text/04

    # try(n) is part of Tcl core since 8.6
.if ${TCL_VER:S/.//} < 86
MANN+=      try.n
.else
    ${MV} ${WRKSRC}/modules/try/try.man ${WRKSRC}/modules/try/try.man.noinstall
.endif


RUNTEST=    ${SETENV} LANG=C DISPLAY= ${MAKE} -C ${WRKSRC} test
MYID    !=  ${ID} -u
.if ${MYID} == 0
RUNTEST:=   ${SU_CMD:S/root/-m nobody/} "${RUNTEST}"
pre-build:
    #
    # Preparing to run the tests as `nobody'
    #
    ${FIND} ${WRKSRC} -type d -o -name jpeg.test | ${XARGS} ${CHOWN} nobody
.endif

test:
    @if ! ${RUNTEST};   \
    then    \
        ${AWK} '$$NF == "FAILED" { echo = 1 }   \
            echo { if ($$NF == "start") echo = 0; else print }' \
                ${WRKSRC}/testlog.log;  \
        ${CAT} ${WRKSRC}/testlog.failures;  \
        ${UNAME} -a;    \
        ${ECHO_MSG} Please, analyze and report the test failures;   \
        ${ECHO_MSG} Be sure to use the latest available microversion;   \
        ${ECHO_MSG} of TCL-${TCL_VER}, however.;    \
    fi

#post-build:    test

.include <bsd.port.post.mk>