source: build-files/ports-overlay/editors/vim/Makefile @ 1e102bd

9.2-releasereleng/10.0releng/10.0.1releng/10.0.2releng/10.0.3
Last change on this file since 1e102bd was 1e102bd, checked in by Kris Moore <kris@…>, 11 months ago

Add a bunch of modified ports for 10.0, so we can fix the building

  • Property mode set to 100644
File size: 9.4 KB
Line 
1# Created by: David O'Brien <obrien@cs.ucdavis.edu>
2# $FreeBSD: editors/vim/Makefile 328318 2013-09-25 21:16:43Z obrien $
3
4PORTNAME?=      vim
5#               ! _NEVER_ reduce or lower PATCHLEVEL, even if the PATCHLEVEL
6#               ! value # is added to BADPATCHES.  Doing otherwise will cause
7#               ! PORTEPOCH to be needed, which we do NOT want.
8#
9#               ! DO NOT increase PATCHLEVEL to a patch listed in BADPATCHES.
10#               ! Doing so is dis-genuine.  It implies we're at a level we are
11#               ! not.  The "PATCHLEVEL" patch needs to apply before bumping
12#               ! PATCHLEVEL to that level.
13PATCHLEVEL=     1314
14PORTVERSION=    7.3.${PATCHLEVEL}
15RELEASE=        vim-${PORTVERSION:C/\.[0-9a-z]*$//}
16PORTREVISION?=  0
17CATEGORIES?=    editors
18MASTER_SITES=   ${MASTER_SITE_VIM}
19DISTFILES=      ${RELEASE}${EXTRACT_SUFX}
20
21PATCH_SITES=    ${MASTER_SITES:S|unix|patches/${PORTVERSION:C/\.[0-9a-z]*$//}|}\
22                ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/local-distfiles/obrien/:local
23PATCHFILES!=    /usr/bin/jot -s " " -w ${PORTVERSION:C/\.[0-9]*$//}.%03d  \
24                        ${PATCHLEVEL} 1 ${PATCHLEVEL}
25#       bits to remove
26BADPATCHES=     527 780 796 873 890 1104 1111
27.for p in ${BADPATCHES}
28PATCHFILES:=    ${PATCHFILES:N7.3.${p}}
29.endfor
30
31MAINTAINER?=    obrien@FreeBSD.org
32COMMENT?=       Vi "workalike", with many additional features
33
34SLAVEDIRS=      editors/vim-lite
35NO_STAGE=       yes
36
37.if !defined(LITE)
38.if defined(WITH_OPTIONS) || defined(WITH_VIM_OPTIONS)
39.include "${.CURDIR}/../vim/options"
40OPTIONS_DEFAULT+=       CSCOPE EXUBERANT_CTAGS PERL PYTHON RUBY \
41                        TCL LUA X11 GTK2
42.else
43VIM_PORT_SCRIPT_LANGS?= LUA PERL PYTHON RUBY TCL
44VIM_PORT_OPTIONS=       CSCOPE DOCS EXAMPLES EXUBERANT_CTAGS \
45                        ${VIM_PORT_SCRIPT_LANGS}
46PORT_OPTIONS?=  ${VIM_PORT_OPTIONS}
47.endif
48.endif
49
50.include <bsd.port.options.mk>
51
52CONFLICTS=      vim6* vim*-gnome
53.if defined(LITE)
54CONFLICTS+=     vim*
55.else
56CONFLICTS+=     vim*-lite
57.endif
58
59MAKE_JOBS_UNSAFE=       yes
60USE_GCC=        yes
61USE_BZIP2=      yes
62DIST_SUBDIR=    vim
63WRKSRC=         ${WRKDIR}/vim${PORTVERSION:C/\.[0-9]*$//:S/.//g}/src
64PATCH_DIST_ARGS= -d ${WRKSRC:S/src$//} --batch --forward --quiet -E ${PATCH_DIST_STRIP}
65# consider
66#PATCH_DIST_ARGS=       -t
67REINPLACE_ARGS=         -i ""
68MAKE_ARGS+=     CONF_ARGS="--prefix=${PREFIX} --with-tlib=termlib ${CSCOPE_ARG}"
69ALL_TARGET=     #
70_DATADIR=       ${RELEASE:S/-//g:S/.//g}
71DATADIR=        ${PREFIX}/share/vim/${_DATADIR}
72PLIST_SUB=      VIM_VER=${_DATADIR}
73MAN1=           evim.1 vim.1 vimdiff.1 vimtutor.1 xxd.1
74MLINKS=         vim.1 rvim.1    vim.1 rview.1
75.if !defined(LITE)
76MLINKS+=        vim.1 gvim.1    vim.1 gview.1   vimdiff.1 gvimdiff.1 \
77                vim.1 rgvim.1   vim.1 rgview.1  evim.1 eview.1
78.endif
79
80.if ${PORT_OPTIONS:MNLS}
81MANLANG=        "" ru.KOI8-R ru.UTF-8 pl.ISO8859-2 pl.UTF-8 pl fr.ISO8859-1 \
82                fr.UTF-8 fr it.ISO8859-1 it.UTF-8 it
83USES+=          gettext
84PLIST_SUB+=     NLS=""
85.else
86MAKE_ARGS+=     CONF_OPT_NLS="--disable-nls"
87PLIST_SUB+=     NLS="@comment "
88.endif
89
90.if ${PORT_OPTIONS:MPYTHON}
91USE_PYTHON=     yes
92MAKE_ARGS+=     CONF_OPT_PYTHON="--enable-pythoninterp"
93.endif
94
95.if ${PORT_OPTIONS:MRUBY}
96USE_RUBY=       yes
97MAKE_ARGS+=     CONF_OPT_RUBY="--enable-rubyinterp"
98.endif
99
100.if ${PORT_OPTIONS:MTCL}
101USE_TCL=        85+
102MAKE_ARGS+=     CONF_OPT_TCL="--enable-tclinterp --with-tclsh="${TCLSH:S/${LOCALBASE}\/bin\///g}""
103.endif
104
105.if ${PORT_OPTIONS:MLUA}
106USE_LUA=        yes
107MAKE_ARGS+=     CONF_OPT_LUA="--enable-luainterp=dynamic"
108MAKE_ARGS+=     CONF_OPT_LUA_PREFIX="--with-lua-prefix=${LOCALBASE}"
109.endif
110
111.if ${PORT_OPTIONS:MPERL}
112USES=   perl5
113MAKE_ARGS+=     CONF_OPT_PERL="--enable-perlinterp"
114.endif
115
116WANT_GNOME=     yes
117
118.if defined(LITE)
119PKGNAMESUFFIX=  -lite
120CONF_OPT_GUI="--enable-gui=no --without-x --enable-multibyte"
121MAKE_ARGS+=     CONF_OPT_PERL="--disable-perlinterp --disable-pythoninterp --disable-tclinterp --disable-rubyinterp --disable-luainterp"
122.else   # !LITE
123MAKE_ARGS+=     CONF_OPT_FEAT="--with-features=big"
124I18N=           CONF_OPT_MULTIBYTE="--enable-multibyte --enable-fontset --enable-xim"
125CONF_OPT_GUI="--enable-gui=no --without-x"
126.endif
127
128.if ${PORT_OPTIONS:MCSCOPE}
129RUN_DEPENDS+=   cscope:${PORTSDIR}/devel/cscope
130MAKE_ARGS+=     CONF_OPT_CSCOPE="--enable-cscope"
131.endif
132
133.if ${PORT_OPTIONS:MEXUBERANT_CTAGS}
134RUN_DEPENDS+=   exctags:${PORTSDIR}/devel/ctags
135CTAGS_CMD=      exctags -R .
136.else
137CTAGS_CMD=      ${FIND} . -type f \\|${XARGS} ctags
138.endif
139
140.if ${PORT_OPTIONS:MX11}
141CONF_OPT_GUI="--enable-gui=no --with-x"
142
143. if ${PORT_OPTIONS:MATHENA}
144CONF_OPT_GUI="--enable-gui=athena"
145USE_XORG+=      xaw
146. endif
147
148. if ${PORT_OPTIONS:MGTK2}
149USE_GNOME=      gtk20
150CONF_OPT_GUI="--enable-gui=gtk2 --with-gtk-prefix=${LOCALBASE}"
151MAKE_ARGS+=     X_LIBS="$(X_LIBS) -lXt"
152USE_XORG+=      xt
153. endif
154
155. if ${PORT_OPTIONS:MGNOME}
156USE_GNOME=      libgnomeui
157PKGNAMESUFFIX=  -gnome2
158CONF_OPT_GUI="--enable-gui=gnome2"
159MAKE_ARGS+=     X_LIBS="$(X_LIBS) -lXt"
160USE_XORG+=      xt glproto
161. endif
162
163. if ${PORT_OPTIONS:MMOTIF}
164USES+=          motif
165CONF_OPT_GUI="--enable-gui=motif --with-motif-lib=\"${MOTIFLIB}\""
166MAKE_ARGS+=     MOTIFHOME=${LOCALBASE}
167. endif
168
169.endif
170MAKE_ARGS+=     CONF_OPT_GUI=${CONF_OPT_GUI} ${I18N}
171
172
173.if exists(${LOCALBASE}/lib/libiconv.so)
174USES+=  iconv
175.endif
176
177
178post-patch:
179        @(${FIND} ${WRKSRC}/../runtime/ -name menu\*.vim -print0 | ${XARGS} -0 \
180                ${REINPLACE_CMD} -e 's,ctags -R \.,${CTAGS_CMD},g')
181.if !defined(STRIP) || ${STRIP} == ""
182        ${REINPLACE_CMD} '/$$(STRIP)/d' ${WRKSRC}/Makefile
183.endif
184
185pre-configure:
186        @${CP} -pv ${WRKSRC}/config.mk.dist ${WRKSRC}/auto/config.mk
187        @(cd ${WRKSRC} ; ${MAKE} distclean)
188        @${REINPLACE_CMD} -e ' \
189                s|\$$gtk_config_prefix/bin/gtk-config|\$${GTK_CONFIG}|g; \
190                s|\$$gtk_config_exec_prefix/bin/gtk-config|\$${GTK_CONFIG}|g; \
191                s|/usr/local|${LOCALBASE}|g; \
192                s|set dummy lua;|set dummy lua-${LUA_VER};|g' \
193                ${WRKSRC}/auto/configure
194.if ${PORT_OPTIONS:MXTERM_SAVE}
195        @${REINPLACE_CMD} -e ' \
196                s|/\* #define FEAT_XTERM_SAVE \*/|#define FEAT_XTERM_SAVE|g' \
197                ${WRKSRC}/feature.h
198.endif
199
200post-configure:
201        @(cd ${WRKSRC} ; ${SETENV} ${MAKE_ENV} ${MAKE} ${MAKE_ARGS} scratch config)
202        ${REINPLACE_CMD} -e 's@#define HAVE_SYSINFO 1@/* #undef HAVE_SYSINFO */@' ${WRKSRC}/auto/config.h
203
204#       Clean up junk files to keep them from being installed.
205pre-install:
206        @${FIND} ${WRKSRC:H} -type f -name '*.orig' -delete
207
208post-install:
209        [ -e ${PREFIX}/bin/gvim ] || (cd ${PREFIX}/bin ; ${LN} -sf vim gvim)
210        #       below needed for `vim-lite' port
211        ${TEST} -e ${PREFIX}/bin/rgvim  || (cd ${PREFIX}/bin ; ${LN} -sf vim rgvim)
212        ${TEST} -e ${PREFIX}/bin/gview  || (cd ${PREFIX}/bin ; ${LN} -sf vim gview)
213        ${TEST} -e ${PREFIX}/bin/rgview || (cd ${PREFIX}/bin ; ${LN} -sf vim rgview)
214        ${TEST} -e ${PREFIX}/bin/evim   || (cd ${PREFIX}/bin ; ${LN} -sf vim evim)
215        ${TEST} -e ${PREFIX}/bin/eview  || (cd ${PREFIX}/bin ; ${LN} -sf vim eview)
216        ${TEST} -e ${PREFIX}/bin/gvimdiff  \
217                || (cd ${PREFIX}/bin ; ${LN} -sf vim gvimdiff)
218        ${TEST} -e ${PREFIX}/bin/gvimtutor  \
219                || (cd ${PREFIX}/bin ; ${LN} -sf vimtutor gvimtutor)
220        ${INSTALL_DATA} ${FILESDIR}/vietnamese_viscii.vim ${DATADIR}/keymap
221        cd ${PREFIX} ;                                          \
222            ${FIND} share/vim/${_DATADIR} -type f -o -type l    \
223                | ${SORT}                                       \
224                >${WRKDIR}/PLIST.share-vim
225        cd ${PREFIX} ;                                          \
226            ${FIND} share/vim/${_DATADIR} -type d               \
227                | ${SORT} -r | ${SED} -e 's/^/@dirrm /g'        \
228                >>${WRKDIR}/PLIST.share-vim
229        ${ECHO_CMD} "r ${TMPPLIST}"                     > ${WRKDIR}/ex.script
230        ${ECHO_CMD} "/Insert PLIST.share-vim"           >> ${WRKDIR}/ex.script
231        ${ECHO_CMD} "d"                                 >> ${WRKDIR}/ex.script
232        ${ECHO_CMD} "r ${WRKDIR}/PLIST.share-vim"       >> ${WRKDIR}/ex.script
233        ${ECHO_CMD} "x!"                                >> ${WRKDIR}/ex.script
234        ${CP} -p ${TMPPLIST} ${TMPPLIST}.pre-share-vim
235        cd ${WRKDIR} ; ex < ex.script
236
237show-options:
238        @${MAKE} -DWITH_OPTIONS showconfig
239        @${ECHO_CMD} ""
240        @${ECHO_CMD} "Put \"WITH_OPTIONS=yes\" -or- \"WITH_VIM_OPTIONS=yes\""
241        @${ECHO_CMD} "in your /etc/make.conf or /etc/ports.conf file to enable OPTIONS processing.
242
243.if defined(ONT_CHECKSUM)
244checksum:
245.endif
246
247cklatest: .PHONY
248        @${ECHO} -n "Currently at: "
249        @${MAKE} -V PATCHLEVEL
250        -(${SED} -i '' "s/^PATCHLEVEL=.*$$/PATCHLEVEL=  `ncftpls \
251            ftp://ftp.vim.org/pub/vim/patches/${PORTVERSION:C/\.[0-9a-z]*$//}/ \
252                | grep "^${PORTVERSION:C/\.[0-9a-z]*$//}" \
253                | ${SED} -n -E -e 's/${PORTVERSION:C/[0-9]*$//}([0-9]+)$$/\1/p' \
254                | sort -n | ${TAIL} -1`/" Makefile)
255        @${ECHO} -n "Now at: "
256        @${MAKE} -V PATCHLEVEL
257
258find-bad-patches:
259        @cd ${DISTDIR} ; egrep -l \
260                '(src/if_(ole|mzsch)|src/gui_(w32|w48|mac)|src/os_(riscos|cyg|os2|vms|amiga|win32|mswin))|src(/testdir)?/Make_(dos|cyg|vms|mvc|ming|os2|amiga|mms)'\
261                vim/${PORTVERSION:C/\.[0-9a-z]*$//}*
262
263ckp:
264        /usr/bin/time -h ${MAKE} -DPATCH_DEBUG -DONT_CHECKSUM clean patch
265
266ckmtree:
267        ${MTREE_CMD} -f ${MTREE_FILE} -p ${PREFIX}
268
269do-patch:
270        @${ECHO_MSG} "===>  Applying distribution patches for ${PKGNAME} from `pwd`"
271        @set -e ; \
272        (cd ${_DISTDIR} ; \
273        for i  in ${_PATCHFILES}; do \
274                if [ ${PATCH_DEBUG_TMP} = yes ]; then \
275                        ${ECHO_MSG} "===>   Applying distribution patch $$i" ; \
276                fi ; \
277                ${PATCH} ${PATCH_DIST_ARGS} -i ${_DISTDIR}/$$i; \
278        done )
279        @set -e ;\
280        if [ -d ${PATCHDIR} ]; then \
281                if [ "`${ECHO_CMD} ${PATCHDIR}/patch-*`" != "${PATCHDIR}/patch-*" ]; then \
282                        ${ECHO_MSG} "===>  Applying ${OPSYS} patches for ${PKGNAME}" ; \
283                        PATCHES_APPLIED="" ; \
284                        for i in ${PATCHDIR}/patch-*; do \
285                                case $$i in \
286                                        *.orig|*.rej|*~|*,v) \
287                                                ${ECHO_MSG} "===>   Ignoring patchfile $$i" ; \
288                                                ;; \
289                                        *) \
290                                                if [ ${PATCH_DEBUG_TMP} = yes ]; then \
291                                                        ${ECHO_MSG} "===>   Applying ${OPSYS} patch $$i" ; \
292                                                fi; \
293                                                if ${PATCH} ${PATCH_ARGS} < $$i ; then \
294                                                        PATCHES_APPLIED="$$PATCHES_APPLIED $$i" ; \
295                                                else \
296                                                        ${ECHO_MSG} `${ECHO_CMD} "=> Patch $$i failed to apply cleanly." | ${SED} "s|${PATCHDIR}/||"` ; \
297                                                        if [ x"$$PATCHES_APPLIED" != x"" ]; then \
298                                                                ${ECHO_MSG} `${ECHO_CMD} "=> Patch(es) $$PATCHES_APPLIED applied cleanly." | ${SED} "s|${PATCHDIR}/||g"` ; \
299                                                        fi; \
300                                                        ${FALSE} ; \
301                                                fi; \
302                                                ;; \
303                                esac; \
304                        done; \
305                fi; \
306        fi
307
308.include <bsd.port.mk>
Note: See TracBrowser for help on using the repository browser.