OSDN Git Service

MacVim 20090405
[splhack/MacPorts.git] / editors / macvim / Portfile
1 # $Id$
2 PortSystem      1.0
3
4 name                            macvim
5 version                         20090405
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                      20090405
16 distname                        KaoriYa-${gittag}
17 use_zip                         yes
18 checksums                       \
19         ${distname}.zip sha1 342499bc25d5c4abff9a1cee8b9fb01371cf7724
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          --enable-gui=macvim \
32                                         --without-x \
33                                         --disable-gpm \
34                                         --with-features=huge \
35                                         --enable-multibyte \
36                                         --with-tlib=ncurses
37 configure.cppflags      -I${prefix}/include
38 configure.ldflags       -L${prefix}/lib
39
40 use_parallel_build      yes
41
42 variant perl description {Enable Perl scripting} {
43         configure.args-append   --enable-perlinterp
44         depends_lib-append              bin:perl:perl5.8
45 }
46 variant python description {Enable Python scripting} {
47         configure.args-append   --enable-pythoninterp
48         depends_lib-append              bin:python:python25
49 }
50 variant ruby description {Enable Ruby scripting} {
51         configure.args-append   --enable-rubyinterp
52         configure.env-append    ARCHFLAGS="-L${prefix}/lib"
53         depends_lib-append              bin:ruby:ruby
54 }
55 variant tcl description {Enable Tcl scripting} {
56         configure.args-append   --enable-tclinterp
57         depends_lib-append              bin:tclsh:tcl
58 }
59 variant cscope description {Enable source code browsing with cscope} {
60         configure.args-append   --enable-cscope
61 }
62 variant universal {
63         configure.args-append   --with-mac-arch=both
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 if {[variant_isset universal]} {
73         set xcodeconfig Universal
74 } else {
75         set xcodeconfig Release
76 }
77 post-build {
78         system "cd ${worksrcpath}/MacVim; xcodebuild -configuration ${xcodeconfig}"
79 }
80
81 # Can be removed once MacPorts 1.7.1 is released
82 pre-destroot {
83         xinstall -d ${destroot}${applications_dir}
84 }
85
86 set appPath "${destroot}${applications_dir}/MacVim.app/Contents"
87 set runtimePath "${appPath}/Resources/vim/runtime"
88
89 destroot {
90         file copy ${worksrcpath}/MacVim/build/${xcodeconfig}/MacVim.app ${destroot}${applications_dir}
91         xinstall -m 755 ${worksrcpath}/MacVim/mvim ${destroot}${prefix}/bin
92         xinstall -d 755 ${runtimePath}/lang/ja/LC_MESSAGES
93         xinstall -m 644 ${worksrcpath}/po/ja.mo \
94                 ${runtimePath}/lang/ja/LC_MESSAGES/vim.mo
95         file copy ${prefix}/share/migemo/tools/migemo.vim \
96                 ${runtimePath}/plugin/migemo.vim
97 }
98
99 test.run                        yes
100
101 variant standalone description {Enable standalonize} {
102         post-destroot {
103                 foreach dylib {intl.8 iconv.2 migemo.1 ncurses.5} {
104                         set libname [lindex [split ${dylib} .] 0]
105                         set instname "@executable_path/../Frameworks/lib${libname}.dylib"
106                         set origname "${prefix}/lib/lib${dylib}.dylib"
107                         system "install_name_tool \
108                                 -change ${origname} ${instname} ${appPath}/MacOS/Vim"
109                         if {[file type ${origname}] == "link"} {
110                                 set realpath "${prefix}/lib/"
111                                 append realpath [file readlink ${origname}]
112                         } else {
113                                 set realpath ${origname}
114                         }
115                         xinstall -m 755 ${realpath} \
116                                 ${appPath}/Frameworks/lib${libname}.dylib
117                 }
118                 system "install_name_tool \
119                         -change ${prefix}/lib/libiconv.2.dylib \
120                         @executable_path/../Frameworks/libiconv.dylib \
121                         ${appPath}/Frameworks/libintl.dylib"
122
123                 xinstall -d 755 ${runtimePath}/dict
124                 xinstall -m 644 ${prefix}/share/migemo/utf-8/migemo-dict \
125                         ${runtimePath}/dict
126         }
127 }
128
129 include gdb