aboutsummaryrefslogtreecommitdiffstats
path: root/chinese/librime/Makefile
blob: ad214722b75700fafbbd5b225734f1a138857978 (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
# Created by: Zhihao Yuan <lichray@gmail.com>
# $FreeBSD$

PORTNAME=   librime
PORTVERSION=    0.9.7
CATEGORIES= chinese textproc
MASTER_SITES=   GOOGLE_CODE
DISTFILES=  ${DISTNAME}${EXTRACT_SUFX} brise-${DATA_VER}.tar.gz

MAINTAINER= lichray@gmail.com
COMMENT=    Rime Input Method Engine

LICENSE=    GPLv3

LIB_DEPENDS=    boost_thread:${PORTSDIR}/devel/boost-libs \
        glog:${PORTSDIR}/devel/glog \
        kyotocabinet:${PORTSDIR}/databases/kyotocabinet \
        opencc:${PORTSDIR}/chinese/opencc \
        yaml-cpp:${PORTSDIR}/devel/yaml-cpp

USES=       cmake pkgconfig
USE_GETTEXT=    yes
USE_LDCONFIG=   yes
USE_XORG=   xproto
USE_PERL5_BUILD=    yes
LDFLAGS+=   -lintl

PLIST_SUB=  VER=${PORTVERSION}

post-patch:     .SILENT
    ${FIND} ${WRKSRC} \( -name '*.cc' -or -name '*.h' \) \
        -exec ${PERL} -i -pe '$$. == 1 && s/^\xef\xbb\xbf//;' '{}' \;

post-build:
    @echo "building rime data."
    @${MKDIR} ${DATASRC}
    @(cd ${WRKDIR}/brise; ${CP} \
    default.yaml essay.kct supplement/*.yaml preset/*.yaml ${DATASRC})
    ${WRKSRC}/bin/rime_deployer --build ${DATASRC}

post-install:
    ${MKDIR} ${DATADIR}/data
    ${INSTALL_DATA} ${DATASRC}/*.kct ${DATASRC}/*.bin ${DATADIR}/data/

PROJECTHOST=    rimeime
DATA_VER=   0.16
WRKSRC=     ${WRKDIR}/${PORTNAME}
DATASRC=    ${WRKDIR}/tmp
DATADIR=    ${PREFIX}/share/rime

.include <bsd.port.mk>