OSDN Git Service

196866ddd3eb0772da9e827d4e3d99e9375768cd
[splhack/MacPorts.git] / editors / vim-app / files / kaoriya
1 # apply KaoriYa's patches and enable migemo
2 # see http://2xup.org/log/2006/09/13-0220
3 #     http://kimuraw.txt-nifty.com/d/2006/11/vim_portfile.html
4 set kaoriya_patch   vim72-20090321-kaoriya-w32j.exe
5 set kaoriya_path    ${worksrcpath}/vim72-kaoriya-w32j
6
7 #depends_lib-append  lib:libmigemo:cmigemo
8 master_sites-append http://www.kaoriya.net/dist/:kaoriya
9 distfiles-append    ${kaoriya_patch}:kaoriya
10 checksums-append    ${kaoriya_patch} md5 8c59bb9cb13d43548ca729097ccbb245
11 depends_build-append bin:7za:p7zip
12 post-patch {
13     system "7za x ${distpath}/${kaoriya_patch}"
14     if {[variant_isset cocoa]} {
15         file delete ${kaoriya_path}/patches/0016-transparency_option.diff
16     }
17     system "cat ${kaoriya_path}/patches/*| patch -p0"
18     system "cat ${portpath}/${filesdir}/patch-fileio.c| patch -p0"
19     system "cat ${portpath}/${filesdir}/vimrc >> ${kaoriya_path}/vimrc"
20     system "cat ${portpath}/${filesdir}/gvimrc >> ${kaoriya_path}/gvimrc"
21 }
22
23 pre-configure {
24     system "cd src; make autoconf"
25 }
26 configure.args-append --enable-migemo
27
28 variant aqua conflicts cocoa {
29     configure.args-append --enable-gui=carbon
30     post-patch {
31         # http://iplab.naist.jp/member/mio-su/dist/vim/inline0.2.diff
32         # http://wiki.macvim.org/wiki/VimPatches/Transparency
33         foreach file {configure.in gui_mac.c gvimrc mbyte.c option.c syntax.c vim.h} {
34             system "cat ${portpath}/${filesdir}/patch-${file}| patch -p0"
35         }
36     }
37 }
38
39 variant cocoa conflicts aqua {
40     configure.args-append --enable-gui=cocoa
41     post-patch {
42         system "gnutar xvfj ${filespath}/vim-cocoa-mac-20081128.tbz2 -C ${worksrcpath}/src/"
43         system "cat ${portpath}/${filesdir}/patch-vim-cocoa-20081128 | patch -p1"
44         foreach file {configure.in Makefile gui_mac.m gvimrc mbyte.c option.c option-cocoa.c syntax.c vim.h vimrc} {
45             system "cat ${portpath}/${filesdir}/patch-${file}| patch -p0"
46         }
47     }
48     pre-build {
49         system "cd ${worksrcpath}/src/mac/PSMTabBarControl; xcodebuild"
50     }
51 }
52
53 if {![variant_isset aqua] && ![variant_isset cocoa]} {default_variants +aqua}
54
55 post-destroot {
56     set runtimePath \
57         "${destroot}${applications_dir}/Vim.app/Contents/Resources/vim/runtime"
58     xinstall -m 644 ${kaoriya_path}/vimrc ${kaoriya_path}/gvimrc \
59         ${destroot}${applications_dir}/Vim.app/Contents/Resources/vim
60     xinstall -d ${runtimePath}/lang/ja/LC_MESSAGES
61     set scripts { \
62         encode_japan.vim \
63         keymap/azik_cp932.vim \
64         keymap/japanese_cp932.vim \
65         keymap/tcode_cp932.vim \
66         keymap/tutcode_cp932.vim \
67         lang/ja/LC_MESSAGES/vim.mo \
68         plugin/autodate.vim \
69         plugin/cmdex.vim \
70         plugin/dicwin.vim \
71         plugin/format.vim \
72         plugin/hz_ja.vim \
73         plugin/scrnmode.vim \
74         plugin/verifyenc.vim \
75     }
76     system "gnutar -C ${kaoriya_path}/runtime/ -cf - ${scripts} | \
77         gnutar -C ${runtimePath} -xvf -"
78     foreach f ${scripts} {
79         file attributes ${runtimePath}/${f} -permissions 0644
80     }
81     file copy ${prefix}/share/migemo/tools/migemo.vim \
82         ${runtimePath}/plugin/migemo.vim
83     reinplace "s|dict/migemo-dict|dict/\".\\&encoding.\"/migemo-dict|" \
84         ${runtimePath}/plugin/migemo.vim
85     file mkdir ${runtimePath}/dict
86     set dicts {migemo-dict han2zen.dat hira2kata.dat roma2hira.dat zen2han.dat}
87     foreach encodePath [glob ${prefix}/share/migemo/*] {
88         set encode [file tail $encodePath]
89         if {${encode} != "tools"} {
90             file mkdir ${runtimePath}/dict/${encode}
91             foreach dict ${dicts} {
92                 file link -hard ${runtimePath}/dict/${encode}/${dict} \
93                     ${encodePath}/${dict}
94             }
95         }
96     }
97 }