aboutsummaryrefslogtreecommitdiffstats
path: root/textproc/libtranslate/Makefile
blob: 5e1604e2abc24df6a11162048d236f51243d70e3 (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
# Created by: Jean-Yves Lefort <jylefort@brutele.be>
# $FreeBSD$

PORTNAME=       libtranslate
PORTVERSION=        0.99
PORTREVISION=       6
CATEGORIES=     textproc
MASTER_SITES=       ${MASTER_SITE_SAVANNAH}
MASTER_SITE_SUBDIR= ${PORTNAME}
DISTFILES=      ${PORTNAME}-${PORTVERSION}${EXTRACT_SUFX} # May append to this

PATCHFILES=     libtranslate-0.99-services.diff libtranslate-0.99-postmarker.diff
PATCH_SITES=        ${MASTER_SITES}
PATCH_SITE_SUBDIR=  ${MASTER_SITE_SUBDIR}
PATCH_DIST_STRIP=   -p1

MAINTAINER=     ports@FreeBSD.org
COMMENT=        A natural language translation library

USES=           gmake pathfix pkgconfig
USE_GNOME=      glib20 intlhack
GNU_CONFIGURE=      yes
USE_LDCONFIG=       yes
CPPFLAGS+=      -I${LOCALBASE}/include
LDFLAGS+=       -L${LOCALBASE}/lib
CONFIGURE_ARGS=     --with-html-dir=${PREFIX}/share/doc

OPTIONS_DEFINE= GENERIC TALKFILTERS
OPTIONS_DEFAULT=    GENERIC TALKFILTERS
GENERIC_DESC=   generic module
TALKFILTERS_DESC=   talkfilters module

MAN1=           translate.1

NO_STAGE=   yes
post-patch::
    @${REINPLACE_CMD} -e 's|echo aout|echo elf|'    \
        -e 's|libsoup-2.2|libsoup-2.4|g' ${WRKSRC}/configure

.include <bsd.port.options.mk>

.if ${PORT_OPTIONS:MGENERIC}
PLIST_SUB+=     GENERIC=""
USE_GNOME+=     libxml2
LIB_DEPENDS+=       soup-2.4:${PORTSDIR}/devel/libsoup
MAN5+=          services.xml.5
CPPFLAGS+=      -DHAVE_LIBSOUP24
DISTFILES+=     libtranslate-0.99-libsoup24.diff
EXTRACT_ONLY=       ${DISTFILES:M*tar.*}
# This patching needs to happen AFTER the stock patches were applied:
post-patch::
    ${SED} s,SOUP_MESSAGE_RESPONSE_,trans_SOUP_MESSAGE_RESPONSE_,g  \
        ${DISTDIR}/libtranslate-0.99-libsoup24.diff \
        | ${PATCH} -d ${WRKSRC} -p1
.else
CONFIGURE_ARGS+=    --disable-generic
PLIST_SUB+=     GENERIC="@comment "
.endif

.if ${PORT_OPTIONS:MTALKFILTERS}
PLIST_SUB+=     TALKFILTERS=""
LIB_DEPENDS+=       talkfilters:${PORTSDIR}/misc/talkfilters
.else
CONFIGURE_ARGS+=    --disable-talkfilters
PLIST_SUB+=     TALKFILTERS="@comment "
.endif

.include <bsd.port.mk>