source: trunk/dports/audio/julius/Portfile

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

julius: update to the latest dictation kit for v4.3.1; add patch for run-dnn.sh to use Terminal.app instead of xterm.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 4.8 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 116675 2014-02-02 15:16:51Z ryandesign@macports.org $
3
4PortSystem          1.0
5
6name                julius
7version             4.3.1
8revision            1
9categories          audio japanese
10platforms           darwin
11maintainers         hum openmaintainer
12license             BSD
13
14description         Large Vocabulary Continuous Speech Recognition (LVCSR) Engine
15
16long_description    Julius is an open-source high-performance large vocabulary \
17                    continuous speech recognition (LVCSR) decoder software for \
18                    speech-related researchers and developers. \
19                    Based on word N-gram and triphone context-dependent HMM, \
20                    it can perform almost real-time decoding on most current \
21                    PCs with small amount of memory.
22
23homepage            http://julius.sourceforge.jp/
24master_sites        sourceforge_jp:julius/60273/
25checksums           ${distname}${extract.suffix} \
26                    rmd160  6c43a6f7ecf650b80c98c7f51f1869a874dc4222 \
27                    sha256  4bf77c7b91f4bb0686c375c70bd4f2077e7de7db44f60716af9f3660f65a6253
28
29patchfiles          patch-configure.diff \
30                    patch-Makefile.in.diff
31
32depends_lib         port:libiconv \
33                    port:zlib
34
35# Note: '--enable-words-int' should be declared ahead of '--with-mictype'.
36variant words_int description {Use integer for word ID to extend vocabulary limit} {
37    configure.pre_args-append  --enable-words-int
38}
39
40if {${os.platform} eq "darwin" && ${os.major} >= 10} {
41    depends_lib-append      port:portaudio
42    configure.args-append   --with-mictype=portaudio
43}
44
45destroot.target-append  install.man
46destroot.destdir        prefix=${destroot}${prefix}
47
48set docdir ${prefix}/share/doc/${name}
49
50post-destroot {
51    xinstall -d ${destroot}${docdir}
52    xinstall -m 644 -W ${worksrcpath} \
53        00readme-ja.txt \
54        00readme.txt \
55        ChangeLog \
56        LICENSE.txt \
57        Release-ja.txt \
58        Release.txt \
59        Sample.jconf \
60        ${destroot}${docdir}
61}
62
63default_variants    +kit
64
65set kit_name        dictation-kit
66set kit_version     v${version}
67set dictation_kit   ${kit_name}-${kit_version}-osx
68set kit_distfile    ${dictation_kit}-0130.tgz
69
70variant kit description {Add dictation kit} {
71    distfiles-append    ${kit_distfile}:kit
72    master_sites-append sourceforge_jp:julius/60416/:kit
73    checksums-append    ${kit_distfile} \
74                        rmd160  2db607e470a8f2516a9cd0b9a1b8925523b62e9d \
75                        sha256  2ff46d1bd4d8e7690bd568d2973978081460e661085f6b4c2a0a630234a911c1
76
77    post-patch {
78        system -W ${workpath}/${dictation_kit} "patch < ${filespath}/patch-run-dnn.sh.diff"
79    }
80
81    post-destroot {
82        # copy model files.
83        set libdir ${prefix}/lib/${name}
84        xinstall -d ${destroot}${libdir}
85        copy ${workpath}/${dictation_kit}/model ${destroot}${libdir}
86        # copy configuration files and set paths.
87        foreach f {am-dnn.jconf am-gmm.jconf dnnclient.conf main.jconf} {
88            xinstall -m 644 ${workpath}/${dictation_kit}/${f} ${destroot}${libdir}
89            reinplace -locale C "s| model/| ${libdir}/model/|g" ${destroot}${libdir}/${f}
90        }
91        # copy executable files and set paths.
92        set libexecdir ${prefix}/libexec/${name}
93        xinstall -d ${destroot}${libexecdir}
94        foreach f {run-dnn.sh run-gmm.sh run.sh} {
95            xinstall -m 755 ${workpath}/${dictation_kit}/${f} ${destroot}${libexecdir}
96            reinplace -locale C "s|\\./bin/|${prefix}/bin/|g" ${destroot}${libexecdir}/${f}
97            reinplace -locale C "s| model/| ${libdir}/model/|g" ${destroot}${libexecdir}/${f}
98            reinplace -locale C -E "s| (\[^\[:space:\]\]+\\.j?conf)| ${libdir}/\\1|g" \
99                ${destroot}${libexecdir}/${f}
100        }
101        xinstall -m 744 -W ${workpath}/${dictation_kit}/bin \
102            dnnclient-gpu.py \
103            dnnclient.py \
104            ${destroot}${prefix}/bin
105        copy ${workpath}/${dictation_kit}/bin/scoring ${destroot}${libexecdir}
106        # copy additioanl documents of the dictation kit.
107        set kit_docdir ${prefix}/share/doc/${name}/${kit_name}
108        xinstall -d ${destroot}${kit_docdir}
109        xinstall -m 644 -W ${workpath}/${dictation_kit} \
110            00readme.txt \
111            HOWTO-dnn.txt \
112            HOWTO.txt \
113            LICENSE.txt \
114            TROUBLE.txt \
115            ${destroot}${kit_docdir}
116        # copy manuals.
117        copy ${workpath}/${dictation_kit}/doc/manuals    ${destroot}${docdir}
118        copy ${workpath}/${dictation_kit}/doc/manuals-ja ${destroot}${docdir}
119    }
120}
121
122livecheck.type      regex
123livecheck.url       http://sourceforge.jp/projects/${name}/releases/rss
124livecheck.regex     <title>${name}.* - (\[0-9.a-z\-\]+)</title>
Note: See TracBrowser for help on using the repository browser.