aboutsummaryrefslogtreecommitdiffstats
path: root/devel/newt/Makefile
blob: fb17fc150ff6451f68a3dc6636229e3bbce5341c (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
# $FreeBSD$

PORTNAME=   newt
PORTVERSION=    0.52.17
CATEGORIES= devel
MASTER_SITES=   https://fedorahosted.org/releases/n/e/newt/

MAINTAINER= ports@FreeBSD.org
COMMENT=    Not Eriks Windowing Toolkit: console I/O handling library

LIB_DEPENDS=    libslang.so:${PORTSDIR}/devel/libslang2 \
        libpopt.so:${PORTSDIR}/devel/popt

USES=       gmake
GNU_CONFIGURE=  yes
MAKE_ENV=   PCFLAGS="${CFLAGS}"
USE_LDCONFIG=   yes
MAKE_JOBS_UNSAFE=   yes

CPPFLAGS+=  -I${LOCALBASE}/include
LDFLAGS+=   -L${LOCALBASE}/lib -lcurses

PLIST_SUB=  SOVERSION="${SOVERSION}" \
        VERSION="${PORTVERSION}"

SUB_FILES=  pkgIndex.tcl
SUB_LIST=   VERSION="${PORTVERSION}"

OPTIONS_DEFINE=     NLS TCL
OPTIONS_SUB=        yes

NLS_USES=       gettext
NLS_CONFIGURE_ENABLE=   nls
TCL_USES=       tcl
TCL_CONFIGURE_ENV=  ac_cv_c_tclconfig=${TCL_LIBDIR:Q}
TCL_CONFIGURE_WITH= tcl
TCL_CPPFLAGS=       -I${TCL_INCLUDEDIR:Q}

SOVERSION=  ${PORTVERSION:R:E}

.include <bsd.port.options.mk>

post-patch:
    @${REINPLACE_CMD} -e \
        '/^SONAME/s|=.*|=${SOVERSION}| ; \
         s|-DUSE_INTERP_RESULT||' ${WRKSRC}/configure
    @${REINPLACE_CMD} -e \
        's|@CPP@|@CC@ -E| ; \
         s|-I/usr/include/slang|| ; \
         /^pkgconfigdir/s|=.*|=${PREFIX}/libdata/pkgconfig| ; \
         s| -g | |g ; \
         /make -C/s|^|#| ; \
         /whiptcl.$$(SOEXT)/s|install|${TRUE}|' ${WRKSRC}/Makefile.in

post-install:
    @${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/whiptail
.if ${PORT_OPTIONS:MNLS}
    @(cd ${WRKSRC}/po && ${SETENV} ${MAKE_ENV} ${MAKE_CMD} ${MAKE_FLAGS} \
        ${MAKEFILE} ${MAKE_ARGS} datadir=${STAGEDIR}${PREFIX}/share \
        ${INSTALL_TARGET})
.endif
.if ${PORT_OPTIONS:MTCL}
    @${MKDIR} ${STAGEDIR}${PREFIX}/lib/whip${PORTVERSION}
    (cd ${WRKSRC} && ${INSTALL_LIB} whiptcl.so \
        ${STAGEDIR}${PREFIX}/lib/whip${PORTVERSION})
    (cd ${WRKDIR} && ${INSTALL_DATA} pkgIndex.tcl \
        ${STAGEDIR}${PREFIX}/lib/whip${PORTVERSION})
.endif

.include <bsd.port.mk>