source: trunk/dports/textproc/kakarot/Portfile

Last change on this file was 115214, checked in by hum@…, 4 years ago

cabocha, kakarot: add patch to build on Mavericks; see #41810.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 3.4 KB
Line 
1# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
2# $Id: Portfile 115214 2013-12-28 11:50:51Z ryandesign@macports.org $
3
4PortSystem          1.0
5PortGroup           github 1.0
6
7github.setup        yu-hatva kakarot c0c690cb45264446c7c0b3a2c32008a5888e4cee
8version             0.2
9revision            1
10
11categories          textproc japanese
12maintainers         hum openmaintainer
13
14description         a Japanese dependency parser to search the entire tree
15
16long_description    ${name} is ${description}.
17
18platforms           darwin
19license             {GPL BSD Permissive}
20
21# kakarot is based on CaboCha.
22set cabocha_version 0.64
23set cabocha_distname cabocha-${cabocha_version}
24distfiles-append    ${cabocha_distname}${extract.suffix}:cabocha
25dist_subdir         cabocha
26master_sites-append googlecode:cabocha:cabocha
27
28checksums           ${distname}${extract.suffix} \
29                    rmd160  b10df477e9b8d161bc6f1e78c0f94770216b6ae4 \
30                    sha256  48659fa55d0e2fc3b709042bc128d7e9e40e76323a6b40be607ca023a61dd5d6 \
31                    ${cabocha_distname}${extract.suffix} \
32                    rmd160  b6e0a3f7cb4829e26b8b86ca2e2ab6131ab22a12 \
33                    sha256  034b5540b36e12dea9b41c37252784b85abbb9f831c4a0ec6de8dc74b52a04d8
34
35depends_lib         port:crfpp \
36                    port:libiconv \
37                    port:mecab-base \
38                    port:mecab-utf8
39
40worksrcdir          ${cabocha_distname}
41
42set cabocha_srcpath ${worksrcpath}/src
43set kakarot_srcpath ${workpath}/${github.author}-${github.project}-[string range ${github.version} 0 6]
44
45post-extract {
46    foreach f {kakarot.h postkak.h} {
47        copy ${kakarot_srcpath}/${f} ${cabocha_srcpath}
48    }
49}
50
51patchfiles          patch-configure.diff \
52                    patch-src_postkak.h.diff \
53                    patch-src_utils.cpp.diff
54 
55post-patch {
56    system -W ${cabocha_srcpath} "patch < ${kakarot_srcpath}/patchfile"
57    reinplace "s|@prefix@|${prefix}|g" ${cabocha_srcpath}/postkak.h
58}
59
60configure.args      --with-charset=UTF8
61
62build.args          LIBS="-liconv -lcrfpp -lmecab"
63
64set kakarot_bin     ${prefix}/bin/kakarot
65set kakarot_lib     ${prefix}/lib/libkakarot.dylib
66set kakarotrc       ${prefix}/etc/kakarotrc
67
68post-destroot {
69    # rename binary, library and resource files.
70    move ${destroot}${prefix}/bin/cabocha            ${destroot}${kakarot_bin}
71    move ${destroot}${prefix}/lib/libcabocha.4.dylib ${destroot}${kakarot_lib}
72    move ${destroot}${prefix}/lib/cabocha            ${destroot}${prefix}/lib/kakarot
73    move ${destroot}${prefix}/etc/cabocharc          ${destroot}${kakarotrc}
74    reinplace "s|lib/cabocha|lib/kakarot|g"          ${destroot}${kakarotrc}
75    system "install_name_tool -id ${kakarot_lib} ${destroot}${kakarot_lib}"
76    foreach path [list ${kakarot_bin} ${kakarot_lib}] {
77        system "install_name_tool -change ${prefix}/lib/libcabocha.4.dylib ${kakarot_lib} ${destroot}${path}"
78    }
79    # delete other cabocha files.
80    foreach path {bin/cabocha-config include lib/libcabocha.a lib/libcabocha.la lib/libcabocha.dylib libexec share} {
81        delete ${destroot}${prefix}/${path}
82    }
83    # install a resource file for v0.2.
84    xinstall -m 644 ${kakarot_srcpath}/kakeval.txt   ${destroot}${prefix}/lib/kakarot
85    # install an additional document.
86    set docdir ${prefix}/share/doc/kakarot
87    xinstall -d ${destroot}${docdir}
88    xinstall -m 644 ${kakarot_srcpath}/README.txt    ${destroot}${docdir}
89}
90
91livecheck.type      none
Note: See TracBrowser for help on using the repository browser.