Ticket #45696: Portfile-MacVim.txt

File Portfile-MacVim.txt, 8.3 KB (added by Russell-Jones-OxPhys (Russell Jones), 10 years ago)
Line 
1# $Id: Portfile 119294 2014-04-22 15:34:51Z raimue@macports.org $
2
3PortSystem          1.0
4PortGroup           compiler_blacklist_versions 1.0
5
6name                MacVim
7set vim_version     7.4
8set snapshot        73
9set gitcommit       snapshot-${snapshot}
10version             ${vim_version}.snapshot${snapshot}
11categories          editors
12platforms           darwin
13license             Vim GPL-2+
14maintainers         raimue
15description         MacVim is a GUI version of vim for Mac OS X
16long_description \
17    MacVim is a port of the text editor Vim to Mac OS X that is meant to look \
18    better and integrate more seamlessly with the Mac than vim-app.
19homepage            http://code.google.com/p/macvim
20
21master_sites        http://github.com/b4winckler/macvim/zipball/${gitcommit}
22checksums           ${name}-${version}.zip \
23                    rmd160  457b0eea2d7d86629d67683125df994e11e680dd \
24                    sha256  ed008a0d31f3c38f7fd018586aaa8c0bccda97c911f1be9f12c7120312f66976
25use_zip             yes
26worksrcdir          ${name}
27extract.only        ${name}-${version}.zip
28
29depends_build       bin:gnutar:gnutar \
30                    bin:grep:grep \
31                    bin:autoconf:autoconf \
32                    port:python27
33depends_lib         port:ncurses \
34                    port:gettext \
35                    port:libiconv
36
37if ![variant_isset python27] {
38    # python is only used for build scripts, no linking
39    license_noconflict  python27
40}
41
42patchfiles          patch-src-MacVim-icons-python.diff \
43                    patch-MacVim-GCC-VERSION.diff
44
45pre-fetch {
46    if {${os.platform} eq "darwin" && ${os.major} < 10} {
47        ui_error "${name} only runs on Mac OS X 10.6 or greater."
48        return -code error "incompatible Mac OS X version"
49    }
50}
51
52# does not run correctly when build with older clang releases, see #30985
53compiler.blacklist macports-clang-2.9 macports-clang-3.0 {clang < 400}
54
55post-extract {
56    # github zipball has root folder including commitish, renaming for ease of use
57    file rename [glob ${workpath}/b4winckler-*] ${worksrcpath}
58
59    # create cache directory
60    file mkdir ${workpath}/caches
61}
62
63patchfiles-append patch-compat-sigaltstack.diff
64
65post-patch {
66    reinplace "s|^# VIM_APP_DIR=/Applications$|VIM_APP_DIR=${applications_dir}|" \
67         ${worksrcpath}/src/MacVim/mvim
68}
69
70autoconf.dir ${worksrcpath}/src
71
72configure.args      --enable-gui=macvim \
73                    --without-x \
74                    --disable-gpm \
75                    --with-tlib=ncurses \
76                    --enable-multibyte \
77                    --enable-fail-if-missing
78
79# Old pre-compiled headers could influence build, #26723
80build.args          XCODEFLAGS="CACHE_ROOT=${workpath}/caches" \
81                    PYTHON=${prefix}/bin/python2.7
82
83destroot {
84    copy ${worksrcpath}/src/MacVim/build/Release/MacVim.app ${destroot}${applications_dir}
85    copy ${worksrcpath}/src/MacVim/mvim ${destroot}${prefix}/bin
86
87    # Create MacVim vimdiff, view, ex equivalents
88    ln -s mvim ${destroot}${prefix}/bin/mvimdiff
89    ln -s mvim ${destroot}${prefix}/bin/mview
90    # Link as mvimex as bin/mex conflicts with texlive
91    ln -s mvim ${destroot}${prefix}/bin/mvimex
92}
93
94test.run            yes
95
96if {![variant_isset big] && ![variant_isset huge]} {
97    default_variants +huge
98}
99
100variant big description {Build big feature set} conflicts huge {
101    configure.args-append --with-features=big
102}
103variant huge description {Build huge feature set} conflicts big {
104    configure.args-append --with-features=huge
105}
106variant xim description {Build with support for X Input Method} {
107    configure.args-append --with-xim
108}
109
110variant breakindent description {Apply the breakindent patch} {
111    # Upstream: https://retracile.net/wiki/VimBreakIndent
112    master_sites-append https://retracile.net/raw-attachment/blog/2013/09/12/23.00/:breakindent
113    distfiles-append    vim-7.4.16-fc19-breakindent.patch:breakindent
114    checksums-append    vim-7.4.16-fc19-breakindent.patch \
115                        rmd160  a03d102166b7fa4d699b621c6a9c54dae05017c6 \
116                        sha256  8374b1fa505797761fd4480adb1f636d5cdebc1c943c9af70db8f7431b761548
117
118    post-patch {
119        system -W ${worksrcpath} "patch -p1 < ${distpath}/vim-7.4.16-fc19-breakindent.patch"
120    }
121}
122
123variant perl description {Enable Perl scripting} {
124    configure.args-append   --enable-perlinterp
125    depends_lib-append      path:bin/perl:perl5
126}
127variant python requires python25 description {Compatibility variant, requires +python25} {}
128variant python25 conflicts python26 python27 description {Enable Python scripting} {
129    configure.args-append   --enable-pythoninterp --with-python=${prefix}/bin/python2.5
130    patchfiles-append       patch-python.diff
131    depends_lib-append      port:python25
132
133    use_autoconf yes
134}
135variant python26 conflicts python25 python27 description {Enable Python scripting} {
136    configure.args-append   --enable-pythoninterp --with-python=${prefix}/bin/python2.6
137    patchfiles-append       patch-python.diff
138    depends_lib-append      port:python26
139
140    use_autoconf yes
141}
142variant python27 conflicts python25 python26 description {Enable Python scripting} {
143    configure.args-append   --enable-pythoninterp --with-python=${prefix}/bin/python2.7
144    patchfiles-append       patch-python.diff
145    depends_lib-append      port:python27
146
147    use_autoconf yes
148}
149variant python31 conflicts python32 python33 python34 description {Enable Python scripting} {
150    configure.args-append   --enable-python3interp --with-python3=${prefix}/bin/python3.1
151    patchfiles-append       patch-python3.diff
152    depends_lib-append      port:python31
153
154    use_autoconf yes
155}
156variant python32 conflicts python31 python33 python34 description {Enable Python scripting} {
157    configure.args-append   --enable-python3interp --with-python3=${prefix}/bin/python3.2
158    patchfiles-append       patch-python3.diff
159    depends_lib-append      port:python32
160
161    use_autoconf yes
162    # Overwriting autoconf.cmd above removes dependency, add it again
163    depends_build-append port:autoconf
164}
165variant python33 conflicts python31 python32 python34 description {Enable Python scripting} {
166    configure.args-append   --enable-python3interp --with-python3=${prefix}/bin/python3.3
167    patchfiles-append       patch-python3.diff
168    depends_lib-append      port:python33
169
170    use_autoconf yes
171    # Overwriting autoconf.cmd above removes dependency, add it again
172    depends_build-append port:autoconf
173}
174variant python34 conflicts python31 python32 python33 description {Enable Python scripting} {
175    configure.args-append   --enable-python3interp --with-python3=${prefix}/bin/python3.4
176    patchfiles-append       patch-python3.diff
177    depends_lib-append      port:python34
178
179    use_autoconf yes
180    # Overwriting autoconf.cmd above removes dependency, add it again
181    depends_build-append port:autoconf
182}
183variant ruby requires ruby18 description {Compatibility variant, requires +ruby18} {}
184variant ruby18 conflicts ruby19 ruby20 description {Enable Ruby scripting} {
185    configure.args-append   --enable-rubyinterp
186    configure.args-append   --with-ruby-command=${prefix}/bin/ruby1.8
187    depends_lib-append      port:ruby
188}
189variant ruby19 conflicts ruby18 ruby20 description {Enable Ruby scripting} {
190    configure.args-append   --enable-rubyinterp
191    configure.args-append   --with-ruby-command=${prefix}/bin/ruby1.9
192    depends_lib-append      port:ruby19
193}
194variant ruby20 conflicts ruby18 ruby19 description {Enable Ruby scripting} {
195    configure.args-append   --enable-rubyinterp
196    configure.args-append   --with-ruby-command=${prefix}/bin/ruby2.0
197    depends_lib-append      port:ruby20
198}
199variant tcl description {Enable Tcl scripting} {
200    configure.args-append   --enable-tclinterp \
201                            --with-tclsh=${prefix}/bin/tclsh
202    patchfiles-append       patch-tcl.diff
203    depends_lib-append      port:tcl
204
205    use_autoconf yes
206}
207variant lua description {Enable Lua scripting} {
208    configure.args-append   --enable-luainterp \
209                            --with-lua-prefix=${prefix}
210    depends_lib-append      port:lua
211}
212
213variant cscope description {Enable source code browsing with cscope} {
214    configure.args-append   --enable-cscope
215}
216
217
218livecheck.type          regex
219livecheck.url           https://github.com/b4winckler/macvim/releases
220livecheck.version       ${snapshot}
221livecheck.regex         snapshot-(\\d+)