OSDN Git Service

macvim 20091113
[splhack/MacPorts.git] / editors / macvim / Portfile
1 # $Id$
2 PortSystem      1.0
3
4 name                            macvim
5 version                         20091113
6 revision                        0
7 categories                      editors
8 platforms                       darwin
9 maintainers                     nomaintainer
10 description                     MacVim is a port of the text editor Vim to Mac OS X.
11 long_description        MacVim supports multiple windows with tabbed editing and a host of other features. \
12                                         MacVim brings you the full power of Vim to Mac OS X.
13 homepage                        http://code.google.com/p/macvim-kaoriya/
14
15 set gittag                      ${version}
16 distname                        KaoriYa-${gittag}
17 use_zip                         yes
18 checksums                       ${distname}.zip sha1 \
19                                                 179768d47a4c31267321924073a3b0f767d0bfa1
20 master_sites            \
21         "http://repo.or.cz/w/MacVim/KaoriYa.git?a=snapshot;h=${gittag};sf=zip&"
22 worksrcdir                      KaoriYa/src
23 extract.only            ${distname}.zip
24
25 depends_lib                     port:cmigemo \
26                                         port:gettext \
27                                         port:libiconv \
28                                         port:ncurses
29
30 configure.pre_args      --prefix=${applications_dir}
31 configure.args          --with-features=huge \
32                                         --enable-multibyte \
33                                         --enable-netbeans \
34                                         --with-tlib=ncurses
35 configure.cppflags      -I${prefix}/include
36 configure.ldflags       -L${prefix}/lib
37
38 if {[variant_isset universal]} {
39         set macosx_deployment_target 10.5
40         configure.args-append   --with-macarchs="${universal_archs}" \
41                                                         --with-macsdk="${macosx_deployment_target}"
42 }
43
44 use_parallel_build      yes
45
46 variant perl description {Enable Perl scripting} {
47         configure.args-append   --enable-perlinterp
48         depends_lib-append              bin:perl:perl5.10
49 }
50 variant python description {Enable Python scripting} {
51         configure.args-append   --enable-pythoninterp
52         depends_lib-append              bin:python:python26
53 }
54 variant ruby description {Enable Ruby scripting} {
55         configure.args-append   --enable-rubyinterp
56         depends_lib-append              bin:ruby:ruby
57 }
58 variant tcl description {Enable Tcl scripting} {
59         configure.args-append   --enable-tclinterp
60         depends_lib-append              bin:tclsh:tcl
61 }
62 variant cscope description {Enable source code browsing with cscope} {
63         configure.args-append   --enable-cscope
64 }
65
66 post-patch {
67         reinplace \
68                 "s|^# VIM_APP_DIR=/Applications$|VIM_APP_DIR=${applications_dir}|" \
69                 ${worksrcpath}/MacVim/mvim
70 }
71
72 set appPath "${destroot}${applications_dir}/MacVim.app/Contents"
73 set runtimePath "${appPath}/Resources/vim/runtime"
74
75 destroot {
76         file copy ${worksrcpath}/MacVim/build/Release/MacVim.app ${destroot}${applications_dir}
77         xinstall -m 755 ${worksrcpath}/MacVim/mvim ${destroot}${prefix}/bin
78         xinstall -d 755 ${runtimePath}/lang/ja_JP.UTF-8/LC_MESSAGES
79         xinstall -m 644 ${worksrcpath}/po/ja_JP.UTF-8.mo \
80                 ${runtimePath}/lang/ja_JP.UTF-8/LC_MESSAGES/vim.mo
81         file copy ${prefix}/share/migemo/tools/migemo.vim \
82                 ${runtimePath}/plugin/migemo.vim
83 }
84
85 test.run                        yes
86
87 variant standalone description {Enable standalonize} {
88         depends_lib-append port:vimproc port:clewn
89         configure.env-append    PATH="/usr/bin:${env(PATH)}"
90         configure.cppflags-append       -DDYNAMIC_PERL -DDYNAMIC_PYTHON -DDYNAMIC_RUBY
91         post-configure {
92                 reinplace "s|^PERL_LIBS|#PERL_LIBS|" ${worksrcpath}/auto/config.mk
93                 reinplace "s|^PYTHON_LIBS|#PYTHON_LIBS|" ${worksrcpath}/auto/config.mk
94                 reinplace "s|^RUBY_LIBS|#RUBY_LIBS|" ${worksrcpath}/auto/config.mk
95         }
96         post-destroot {
97                 # ctags
98                 file copy ${prefix}/bin/ctags ${appPath}/MacOS
99
100                 # vimproc
101                 set vimprocPath ${prefix}/share/vimproc/autoload
102                 file copy ${vimprocPath}/proc.so ${runtimePath}/autoload
103                 file copy ${vimprocPath}/proc.vim ${runtimePath}/autoload
104
105                 # clewn
106                 file copy ${prefix}/bin/clewn ${appPath}/MacOS
107                 set clewnPath ${prefix}/share/clewn
108                 file copy ${clewnPath}/.clewn_keys ${runtimePath}
109                 file copy ${clewnPath}/clewn.vim ${runtimePath}
110                 file copy ${clewnPath}/doc/clewn.txt ${runtimePath}/doc
111                 file copy ${clewnPath}/macros/clewn_mappings.vim ${runtimePath}/macros
112                 file copy ${clewnPath}/syntax/gdbvar.vim ${runtimePath}/syntax
113
114                 # dylibs
115                 foreach dylib {intl.8 iconv.2 migemo.1 ncurses.5 readline.6} {
116                         set libname [lindex [split ${dylib} .] 0]
117                         set instname "@executable_path/../Frameworks/lib${libname}.dylib"
118                         set origname "${prefix}/lib/lib${dylib}.dylib"
119                         foreach exec {MacOS/Vim MacOS/clewn} {
120                                 system "install_name_tool \
121                                         -change ${origname} ${instname} ${appPath}/${exec}"
122                         }
123                         if {[file type ${origname}] == "link"} {
124                                 set realpath "${prefix}/lib/"
125                                 append realpath [file readlink ${origname}]
126                         } else {
127                                 set realpath ${origname}
128                         }
129                         xinstall -m 755 ${realpath} \
130                                 ${appPath}/Frameworks/lib${libname}.dylib
131                 }
132                 system "install_name_tool \
133                         -change ${prefix}/lib/libiconv.2.dylib \
134                         @executable_path/../Frameworks/libiconv.dylib \
135                         ${appPath}/Frameworks/libintl.dylib"
136                 system "install_name_tool \
137                         -change ${prefix}/lib/libncurses.5.dylib \
138                         @executable_path/../Frameworks/libncurses.dylib \
139                         ${appPath}/Frameworks/libreadline.dylib"
140
141                 # migemo dicts
142                 xinstall -d 755 ${runtimePath}/dict
143                 foreach mdict {han2zen.dat hira2kata.dat \
144                                 migemo-dict roma2hira.dat zen2han.dat} {
145                         xinstall -m 644 ${prefix}/share/migemo/utf-8/${mdict} \
146                                 ${runtimePath}/dict
147                 }
148
149                 # vim tags
150                 system "${appPath}/MacOS/Vim \
151                         --cmd \":helptag ${runtimePath}/doc\" --cmd :quit"
152         }
153 }