Files
Joshua Root 00add8495d textproc/*: set github.tarball_from explicitly
In preparation for changing the default.
2025-01-30 08:12:16 +11:00

92 lines
3.5 KiB
Tcl

# -*- 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
PortSystem 1.0
PortGroup github 1.0
github.setup yu-hatva kakarot c0c690cb45264446c7c0b3a2c32008a5888e4cee
# Change github.tarball_from to 'releases' or 'archive' next update
github.tarball_from tarball
version 0.2
revision 1
categories textproc japanese
maintainers nomaintainer
description a Japanese dependency parser to search the entire tree
long_description ${name} is {*}${description}.
license {GPL BSD Permissive}
# kakarot is based on CaboCha.
set cabocha_version 0.64
set cabocha_distname cabocha-${cabocha_version}
distfiles-append ${cabocha_distname}${extract.suffix}:cabocha
dist_subdir cabocha
master_sites-append googlecode:cabocha:cabocha
checksums ${distname}${extract.suffix} \
rmd160 b10df477e9b8d161bc6f1e78c0f94770216b6ae4 \
sha256 48659fa55d0e2fc3b709042bc128d7e9e40e76323a6b40be607ca023a61dd5d6 \
${cabocha_distname}${extract.suffix} \
rmd160 b6e0a3f7cb4829e26b8b86ca2e2ab6131ab22a12 \
sha256 034b5540b36e12dea9b41c37252784b85abbb9f831c4a0ec6de8dc74b52a04d8
depends_lib port:crfpp \
port:libiconv \
port:mecab-base \
port:mecab-utf8
worksrcdir ${cabocha_distname}
set cabocha_srcpath ${worksrcpath}/src
set kakarot_srcpath ${workpath}/${github.author}-${github.project}-[string range ${github.version} 0 6]
post-extract {
foreach f {kakarot.h postkak.h} {
copy ${kakarot_srcpath}/${f} ${cabocha_srcpath}
}
}
patchfiles patch-configure.diff \
patch-src_postkak.h.diff \
patch-src_utils.cpp.diff
post-patch {
system -W ${cabocha_srcpath} "patch < ${kakarot_srcpath}/patchfile"
reinplace "s|@prefix@|${prefix}|g" ${cabocha_srcpath}/postkak.h
}
configure.args --with-charset=UTF8
build.args LIBS="-liconv -lcrfpp -lmecab"
set kakarot_bin ${prefix}/bin/kakarot
set kakarot_lib ${prefix}/lib/libkakarot.dylib
set kakarotrc ${prefix}/etc/kakarotrc
post-destroot {
# rename binary, library and resource files.
move ${destroot}${prefix}/bin/cabocha ${destroot}${kakarot_bin}
move ${destroot}${prefix}/lib/libcabocha.4.dylib ${destroot}${kakarot_lib}
move ${destroot}${prefix}/lib/cabocha ${destroot}${prefix}/lib/kakarot
move ${destroot}${prefix}/etc/cabocharc ${destroot}${kakarotrc}
reinplace "s|lib/cabocha|lib/kakarot|g" ${destroot}${kakarotrc}
system "install_name_tool -id ${kakarot_lib} ${destroot}${kakarot_lib}"
foreach path [list ${kakarot_bin} ${kakarot_lib}] {
system "install_name_tool -change ${prefix}/lib/libcabocha.4.dylib ${kakarot_lib} ${destroot}${path}"
}
# delete other cabocha files.
foreach path {bin/cabocha-config include lib/libcabocha.a lib/libcabocha.la lib/libcabocha.dylib libexec share} {
delete ${destroot}${prefix}/${path}
}
# install a resource file for v0.2.
xinstall -m 644 ${kakarot_srcpath}/kakeval.txt ${destroot}${prefix}/lib/kakarot
# install an additional document.
set docdir ${prefix}/share/doc/kakarot
xinstall -d ${destroot}${docdir}
xinstall -m 644 ${kakarot_srcpath}/README.txt ${destroot}${docdir}
}
livecheck.type none