Ticket #31553: chasen-1028.diff

File chasen-1028.diff, 1.8 KB (added by takanori@…, 13 years ago)

Like this. What do you think about these changes?

  • chasen-ipadic/Portfile

     
    2424
    2525depends_lib         port:chasen-base
    2626
     27if {[file exists ${prefix}/share/doc/chasen/chasen_dartsclone]} {
     28    default_variants    +dartsclone
     29}
     30
    2731variant dartsclone description {Use darts-clone instead of darts} {}
    2832
    2933supported_archs     noarch
    3034configure.args      --with-chasenrc-path=${destroot}${prefix}/etc/chasen/chasenrc-${dicname}
    3135
     36pre-configure {
     37    if {[variant_isset dartsclone]} {
     38        set dartslib "dartsclone"
     39    } else {
     40        set dartslib "darts"
     41    }
     42    if {![file exists ${prefix}/share/doc/chasen/chasen_${dartslib}]} {
     43        return -code error "The variant you chose is not compatible with the ChaSen you've installed."
     44    }
     45}
     46
    3247use_parallel_build  no
    3348
    3449pre-destroot {
  • chasen-base/Portfile

     
    4646test.target         check
    4747
    4848post-destroot {
    49     file mkdir ${destroot}${prefix}/share/doc/chasen
     49    set docdir ${destroot}${prefix}/share/doc/chasen
     50    file mkdir ${docdir}
    5051    xinstall -m 644 -W ${worksrcpath} \
    5152        AUTHORS COPYING ChangeLog NEWS README doc/manual-j.pdf \
    52         ${destroot}${prefix}/share/doc/chasen
     53        ${docdir}
     54
     55    if {[variant_isset dartsclone]} {
     56        set dartslib "dartsclone"
     57    } else {
     58        set dartslib "darts"
     59    }
     60    # this file indicates which version of chasen is installed
     61    set fh [open [file join ${docdir} chasen_${dartslib}] w 0644]
     62    puts ${fh} "This version of chasen depends on the ${dartslib} library."
     63    close ${fh}
    5364}
    5465
    5566livecheck.type      regex