aboutsummaryrefslogtreecommitdiffstats
path: root/irc/weechat/Makefile
blob: 80026f3a4483d75e833e553a164501755e6af89b (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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
# Created by: clement
# $FreeBSD$

PORTNAME=   weechat
PORTVERSION=    0.4.3
CATEGORIES= irc
MASTER_SITES=   http://weechat.org/files/src/
DISTFILES=  ${DISTNAME}${EXTRACT_SUFX}

MAINTAINER= jase@FreeBSD.org
COMMENT=    A lightweight and user friendly ncurses based IRC client

LICENSE=    GPLv3

CONFLICTS=  weechat-devel-0.*

USE_LDCONFIG=   yes
USES=       cmake iconv ncurses
CMAKE_ARGS+=    -DENABLE_GUILE=no
CFLAGS+=    -I${LOCALBASE}/include -L${LOCALBASE}/lib

LIB_DEPENDS+=   libcurl.so:${PORTSDIR}/ftp/curl \
        libgcrypt.so:${PORTSDIR}/security/libgcrypt

OPTIONS_DEFINE= RUBY PYTHON PERL TCL LUA CHARSET BACKTRACE ASPELL \
        GNUTLS NLS ICON MANPAGES DOCS
OPTIONS_DEFAULT=RUBY PYTHON PERL TCL LUA CHARSET BACKTRACE ASPELL \
        GNUTLS ICON MANPAGES

BACKTRACE_DESC= Provide crash backtraces
CHARSET_DESC=   Charset conversion support
LUA_DESC=   Lua scripting support
PERL_DESC=  Perl scripting support
PYTHON_DESC=    Python scripting support
RUBY_DESC=  Ruby scripting support
TCL_DESC=   Tcl scripting support
ICON_DESC=  Desktop icon

.include <bsd.port.options.mk>

.if ${PORT_OPTIONS:MCHARSET}
PLIST_SUB+= CHARSET=""
.else
CMAKE_ARGS+=    -DENABLE_CHARSET=no
PLIST_SUB+= CHARSET="@comment "
.endif

.if ${PORT_OPTIONS:MNLS}
USES+=      gettext
PLIST_SUB+= NLS=""
.else
CMAKE_ARGS+=    -DENABLE_NLS=no
PLIST_SUB+= NLS="@comment "
.endif

.if ${PORT_OPTIONS:MASPELL}
BUILD_DEPENDS+= aspell:${PORTSDIR}/textproc/aspell
PLIST_SUB+= ASPELL=""
.else
CMAKE_ARGS+=    -DENABLE_ASPELL=no
PLIST_SUB+= ASPELL="@comment "
.endif

.if ${PORT_OPTIONS:MPYTHON}
USE_PYTHON= 2
CMAKE_ARGS+=    -DBSD_PYTHON_CMD=${PYTHON_CMD} \
        -DBSD_PYTHON_VER=${PYTHON_VERSION}
PLIST_SUB+= PYTHON=""
.else
CMAKE_ARGS+=    -DENABLE_PYTHON=no
PLIST_SUB+= PYTHON="@comment "
.endif

.if ${PORT_OPTIONS:MRUBY}
USE_RUBY=   yes
CMAKE_ARGS+=    -DBSD_RUBY_CMD=${RUBY} \
        -DBSD_RUBY_VER=${RUBY_NAME}
PLIST_SUB+= RUBY=""
.else
CMAKE_ARGS+=    -DENABLE_RUBY=no
PLIST_SUB+= RUBY="@comment "
.endif

.if ${PORT_OPTIONS:MGNUTLS}
USES+=      pkgconfig
LIB_DEPENDS+=   gnutls:${PORTSDIR}/security/gnutls
.else
CMAKE_ARGS+=    -DENABLE_GNUTLS=no
.endif

.if ${PORT_OPTIONS:MPERL}
USES+=      perl5
PLIST_SUB+= PERL=""
.else
CMAKE_ARGS+=    -DENABLE_PERL=no
PLIST_SUB+= PERL="@comment "
.endif

.if ${PORT_OPTIONS:MTCL}
USE_TCL=    85+
.include "${PORTSDIR}/Mk/bsd.tcl.mk"
CMAKE_ARGS+=    -DBSD_TCL_VER=${TCL_VER} \
        -DBSD_TCL_LIBDIR=${LOCALBASE}/lib \
        -DBSD_TCL_INCDIR=${TCL_INCLUDEDIR}
PLIST_SUB+= TCL=""
.else
CMAKE_ARGS+=    -DENABLE_TCL=no
PLIST_SUB+= TCL="@comment "
.endif

.if ${PORT_OPTIONS:MLUA}
USE_LUA=    5.1+
CMAKE_ARGS+=    -DBSD_LUA_LIBDIR=${LUA_LIBDIR} \
        -DBSD_LUA_INCDIR=${LUA_INCDIR}
PLIST_SUB+= LUA=""
.else
CMAKE_ARGS+=    -DENABLE_LUA=no
PLIST_SUB+= LUA="@comment "
.endif

.if ${PORT_OPTIONS:MDOCS}
PLIST_SUB+= DOCS=""
.if !defined(MAINTAINER_MODE)
MASTER_SITES+=  ${MASTER_SITE_LOCAL:S/$/:doc/}
MASTER_SITE_SUBDIR+=    jase/weechat/:doc
DISTFILES+= ${DISTNAME}-docs.txz:doc
.endif
.else
PLIST_SUB+= DOCS="@comment "
.endif

.if ${PORT_OPTIONS:MMANPAGES}
PLIST_SUB+= MANPAGES=""
.if !defined(MAINTAINER_MODE)
MASTER_SITES+=  ${MASTER_SITE_LOCAL:S/$/:man/}
MASTER_SITE_SUBDIR+=    jase/weechat/:man
DISTFILES+= ${DISTNAME}-manpages.txz:man
.endif
.else
PLIST_SUB+= MANPAGES="@comment "
.endif

.if ${PORT_OPTIONS:MBACKTRACE}
LIB_DEPENDS+=   execinfo:${PORTSDIR}/devel/libexecinfo
.endif

.if ${PORT_OPTIONS:MICON}
PLIST_SUB+= ICON=""
.else
PLIST_SUB+= ICON="@comment "
.endif

.if defined(MAINTAINER_MODE)
BUILD_DEPENDS+= xsltproc:${PORTSDIR}/textproc/libxslt \
        docbook-xsl>=0:${PORTSDIR}/textproc/docbook-xsl \
        asciidoc:${PORTSDIR}/textproc/asciidoc \
        source-highlight>=3.1.5:${PORTSDIR}/textproc/source-highlight
CMAKE_ARGS+=    -DENABLE_MAN=yes -DMANDIR=${MANPREFIX}/man -DENABLE_DOC=yes
.else
CMAKE_ARGS+=    -DENABLE_MAN=no -DENABLE_DOC=no
.endif

post-patch:
    @${REINPLACE_CMD} -e 's|$${LIBDIR}/../pkgconfig|$${CMAKE_INSTALL_PREFIX}/libdata/pkgconfig|' ${WRKSRC}/CMakeLists.txt
    @${REINPLACE_CMD} -e 's|INSTALL|#INSTALL|' ${WRKSRC}/doc/CMakeLists.txt
.for f in src/CMakeLists.txt src/core/CMakeLists.txt cmake/*.cmake
    @${REINPLACE_CMD} -e 's|/usr/local|${LOCALBASE}|' ${WRKSRC}/${f}
.endfor
.if empty(PORT_OPTIONS:MBACKTRACE)
    @${REINPLACE_CMD} -e '/IF.*FreeBSD/,/ENDIF.*FreeBSD/d' ${WRKSRC}/src/core/CMakeLists.txt
.endif
.if empty(PORT_OPTIONS:MICON)
    @${REINPLACE_CMD} -e '/^# icon$$/,/^$$/d' ${WRKSRC}/CMakeLists.txt
.endif

post-install:
.if ${PORT_OPTIONS:MMANPAGES} && !defined(MAINTAINER_MODE)
    ${INSTALL_MAN} ${WRKDIR}/manpages/weechat.1 ${STAGEDIR}${PREFIX}/man/man1
.for f in de fr it ja pl
    @${MKDIR} ${STAGEDIR}${PREFIX}/man/${f}/man1
    ${INSTALL_MAN} ${WRKDIR}/manpages/${f}/weechat.1 ${STAGEDIR}${PREFIX}/man/${f}/man1
.endfor
.endif
.if ${PORT_OPTIONS:MDOCS} && !defined(MAINTAINER_MODE)
    @${MKDIR} ${STAGEDIR}${DOCSDIR}
    ${INSTALL_DATA} ${WRKDIR}/docs/* ${STAGEDIR}${DOCSDIR}/
.endif
    ${LN} -sf ${PREFIX}/bin/weechat ${STAGEDIR}${PREFIX}/bin/weechat-curses

.include <bsd.port.mk>