Ticket #67567: Portfile

File Portfile, 8.9 KB (added by papadil, 17 months ago)

vim portfile mod to compile w/o the offending patches.

Line 
1# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
2
3PortSystem          1.0
4PortGroup           github 1.0
5
6# The vim port should always follow the patch level used in the MacVim port. This
7# is because they both share the same set of configuration files and ensures
8# that the user's configuration files will always work with both.
9set vim_version     9.0
10
11if {${os.platform} eq "darwin" && ${os.major} <= 14} {
12    # Fallback to previous port version, for 10.10 and earlier
13    # https://trac.macports.org/ticket/67209
14    set vim_patchlevel 0472
15    set port_revision  0
16
17    checksums       rmd160  ee809eb300deaf735c86b6e5b7f4bc4a8fe79a41 \
18                    sha256  7185577d6cd3708b62b2079b69a29215bb6a6048070d34e960d2d565c18b8a9b \
19                    size    16851486
20} else {
21    set vim_patchlevel 1499
22    set port_revision  0
23
24    checksums       rmd160  10d9edf0b19197771722e4a2fcf2e36021c34fa6 \
25                    sha256  3db98ddcbb8628ec9818da50353c4dd08d62938c80c71d38062250205310cdc3 \
26                    size    17010976
27}
28
29github.setup        vim vim ${vim_version}.${vim_patchlevel} v
30revision            ${port_revision}
31
32categories          editors
33platforms           darwin freebsd
34license             Vim GPL-2+
35maintainers         {raimue @raimue}
36
37description         Vi \"workalike\" with many additional features
38long_description    Vim is an advanced text editor that seeks to provide the\
39                    power of the de-facto Unix editor 'Vi', with a more\
40                    complete feature set.
41
42homepage            https://www.vim.org/
43
44
45depends_lib-append \
46                    port:ncurses \
47                    port:gettext \
48                    port:libiconv
49
50post-patch {
51    set features [open ${worksrcpath}/src/feature.h a+]
52    puts $features "#define SYS_VIMRC_FILE \"${prefix}/etc/vimrc\""
53    close $features
54}
55
56autoconf.cmd make autoconf
57autoconf.pre_args
58autoconf.args
59autoconf.dir ${worksrcpath}/src
60
61configure.args-append \
62                    --disable-gui \
63                    --without-x \
64                    --without-local-dir \
65                    --disable-gpm \
66                    --disable-canberra \
67                    --mandir=${prefix}/share/man \
68                    --with-tlib=ncurses \
69                    --enable-multibyte \
70                    --with-developer-dir=${configure.developer_dir} \
71                    --enable-fail-if-missing \
72                    --with-compiledby="MacPorts"
73
74post-destroot {
75    ln -s ${prefix}/bin/vim ${destroot}${prefix}/bin/vi
76}
77
78test.run            yes
79
80if {![variant_isset tiny] && ![variant_isset small] && ![variant_isset big] && ![variant_isset huge]} {
81    default_variants +huge
82}
83
84variant x11 description {Build CLI version with X support} {
85    configure.args-delete   --without-x
86    configure.args-append   --with-x --x-includes=${prefix}/include --x-libraries=${prefix}/lib
87    depends_lib-append      port:xorg-libXt
88}
89
90variant athena description {Build GUI version using Athena widgets} requires x11 conflicts gtk2 gtk3 motif {
91    configure.args-delete   --disable-gui
92    configure.args-append   --enable-gui=athena --disable-darwin
93    depends_lib-append      port:xorg-libXaw
94}
95variant gtk2 description {Build GUI version using GTK 2.x widgets} requires x11 conflicts athena gtk3 motif {
96    configure.args-delete   --disable-gui
97    configure.args-append   --enable-gui=gtk2 --disable-darwin
98    depends_lib-append      path:lib/pkgconfig/gtk+-2.0.pc:gtk2
99    depends_build-append    port:pkgconfig
100}
101variant gtk3 description {Build GUI version using GTK 3.x widgets} requires x11 conflicts athena gtk2 motif {
102    configure.args-delete   --disable-gui
103    configure.args-append   --enable-gui=gtk3 --disable-darwin
104    depends_lib-append      path:lib/pkgconfig/gtk+-3.0.pc:gtk3
105    depends_build-append    port:pkgconfig
106}
107variant motif description {Build GUI version with Motif widgets} requires x11 conflicts athena gtk2 gtk3 {
108    configure.args-delete   --disable-gui
109    configure.args-append   --enable-gui=motif --disable-darwin
110    depends_lib-append      lib:libXm:openmotif
111}
112
113configure.args-append --with-features=normal
114set levels {tiny small big huge}
115foreach level ${levels} {
116    variant ${level} description "Build ${level} feature set" conflicts {*}[lsearch -inline -all -not -exact $levels $level] "
117        configure.args-replace --with-features=normal --with-features=$level
118    "
119}
120
121variant xim description {Build with support for X Input Method} {
122    configure.args-append --enable-xim
123}
124
125variant perl description {Enable Perl scripting} {
126    configure.args-append   --enable-perlinterp
127    depends_lib-append      path:bin/perl:perl5
128}
129
130set pythons_suffixes {27 36 37 38 39 310 311}
131
132set pythons_ports {}
133foreach s ${pythons_suffixes} {
134    lappend pythons_ports python${s}
135}
136
137foreach s ${pythons_suffixes} {
138    set p python${s}
139    set major [string index ${s} 0]
140    set v ${major}.[string range ${s} 1 end]
141    set i [lsearch -exact ${pythons_ports} ${p}]
142    set c [lreplace ${pythons_ports} ${i} ${i}]
143    variant ${p} description "Enable Python scripting" conflicts {*}${c} "
144        if {${major} == 2} {
145            configure.args-append   --enable-pythoninterp --with-python-command=${prefix}/bin/python${v}
146            #patchfiles-append       patch-python.diff
147        } else {
148            configure.args-append   --enable-python3interp --with-python3-command=${prefix}/bin/python${v}
149            #patchfiles-append       patch-python3.diff
150        }
151        depends_lib-append      port:${p}
152        use_autoconf yes
153        # overwriting autoconf.cmd above removes dependency, add it again
154        depends_build-append port:autoconf
155    "
156}
157
158variant ruby requires ruby18 description {Compatibility variant, requires +ruby18} {}
159variant ruby18 conflicts ruby19 ruby20 ruby21 ruby22 ruby23 ruby24 ruby25 ruby30 description {Enable Ruby scripting} {
160    configure.args-append   --enable-rubyinterp
161    configure.args-append   --with-ruby-command=${prefix}/bin/ruby1.8
162    depends_lib-append      port:ruby
163}
164variant ruby19 conflicts ruby18 ruby20 ruby21 ruby22 ruby23 ruby24 ruby25 ruby30 description {Enable Ruby scripting} {
165    configure.args-append   --enable-rubyinterp
166    configure.args-append   --with-ruby-command=${prefix}/bin/ruby1.9
167    depends_lib-append      port:ruby19
168}
169variant ruby20 conflicts ruby18 ruby19 ruby21 ruby22 ruby23 ruby24 ruby25 ruby30 description {Enable Ruby scripting} {
170    configure.args-append   --enable-rubyinterp
171    configure.args-append   --with-ruby-command=${prefix}/bin/ruby2.0
172    depends_lib-append      port:ruby20
173}
174variant ruby21 conflicts ruby18 ruby19 ruby20 ruby22 ruby23 ruby24 ruby25 ruby30 description {Enable Ruby scripting} {
175    configure.args-append   --enable-rubyinterp
176    configure.args-append   --with-ruby-command=${prefix}/bin/ruby2.1
177    depends_lib-append      port:ruby21
178}
179variant ruby22 conflicts ruby18 ruby19 ruby20 ruby21 ruby23 ruby24 ruby25 ruby30 description {Enable Ruby scripting} {
180    configure.args-append   --enable-rubyinterp
181    configure.args-append   --with-ruby-command=${prefix}/bin/ruby2.2
182    depends_lib-append      port:ruby22
183}
184variant ruby23 conflicts ruby18 ruby19 ruby20 ruby21 ruby22 ruby24 ruby25 ruby30 description {Enable Ruby scripting} {
185    configure.args-append   --enable-rubyinterp
186    configure.args-append   --with-ruby-command=${prefix}/bin/ruby2.3
187    depends_lib-append      port:ruby23
188}
189variant ruby24 conflicts ruby18 ruby19 ruby20 ruby21 ruby22 ruby23 ruby25 ruby30 description {Enable Ruby scripting} {
190    configure.args-append   --enable-rubyinterp
191    configure.args-append   --with-ruby-command=${prefix}/bin/ruby2.4
192    depends_lib-append      port:ruby24
193}
194variant ruby25 conflicts ruby18 ruby19 ruby20 ruby21 ruby22 ruby23 ruby24 ruby30 description {Enable Ruby scripting} {
195    configure.args-append   --enable-rubyinterp
196    configure.args-append   --with-ruby-command=${prefix}/bin/ruby2.5
197    depends_lib-append      port:ruby25
198}
199variant ruby30 conflicts ruby18 ruby19 ruby20 ruby21 ruby22 ruby23 ruby24 ruby25 description {Enable Ruby scripting} {
200    configure.args-append   --enable-rubyinterp
201    configure.args-append   --with-ruby-command=${prefix}/bin/ruby3.0
202    depends_lib-append      port:ruby30
203}
204
205variant tcl description {Enable Tcl scripting} {
206    configure.args-append   --enable-tclinterp \
207                            --with-tclsh=${prefix}/bin/tclsh
208    patchfiles-append       patch-tcl.diff
209    depends_lib-append      port:tcl
210
211    use_autoconf yes
212    # Overwriting autoconf.cmd above removes dependency, add it again
213    depends_build-append port:autoconf
214}
215
216variant lua description {Enable Lua scripting} {
217    PortGroup               lua 1.0
218
219    configure.args-append   --enable-luainterp \
220                            --with-lua-prefix=${lua.dir}
221}
222
223variant cscope description {Enable source code browsing with cscope} {
224    configure.args-append   --enable-cscope
225}
226
227platform puredarwin {
228    configure.args-append --disable-darwin
229}