diff --git a/editors/vim/Makefile b/editors/vim/Makefile index 5df59d5429eb..932ff7cc5d32 100644 --- a/editors/vim/Makefile +++ b/editors/vim/Makefile @@ -1,214 +1,215 @@ PORTNAME= vim -PORTVERSION= 9.0.0369 +PORTVERSION= 9.0.0379 DISTVERSIONPREFIX= v CATEGORIES= editors MAINTAINER= adamw@FreeBSD.org COMMENT= Improved version of the vi editor (${FLAVOR:U} flavor) LICENSE= VIM LICENSE_NAME= VIM License LICENSE_FILE= ${WRKSRC}/runtime/doc/uganda.txt LICENSE_PERMS= dist-mirror dist-sell pkg-mirror pkg-sell auto-accept USES= cpe iconv ncurses pkgconfig shebangfix USE_GITHUB= yes # Vim will try to link against libcanberra if it's installed CONFIGURE_ARGS= --disable-canberra \ --enable-cscope \ --enable-gui=${GUI} \ --enable-multibyte \ --with-tlib=ncursesw MAKE_ARGS= STRIP="${STRIP_CMD}" \ VIMRCLOC=${ETCDIR} \ VIMRUNTIMEDIR=${PREFIX}/share/vim/${VIM_VER} CPE_VERSION= ${PORTVERSION:R} GNU_CONFIGURE= yes PLIST_SUB= VIM_VER=${VIM_VER} PORTDATA= ${VIM_VER} PORTSCOUT= ignore:1 SHEBANG_FILES= runtime/tools/demoserver.py runtime/tools/efm_perl.pl VIM_VER= ${PORTNAME}${PORTVERSION:R:S|.||g} # Flavors {{{1 # FLAVORS are used to build various Vim GUIs. The default flavor (`vim') is # console-only. FLAVORS= console gtk2 gtk3 motif x11 tiny FLAVOR?= ${FLAVORS:[1]} # Register conflicts with all other flavors CONFLICTS_INSTALL= ${FLAVORS:N${FLAVOR}:S/^/vim-/} .for f in ${FLAVORS:Nconsole} ${f}_PKGNAMESUFFIX= -${f} .endfor # GUI flavors .if ${FLAVOR:U} == console GUI= no CONFIGURE_ARGS+=--without-x PLIST_SUB+= GUI="@comment " DESKTOP="@comment " .elif ${FLAVOR:U} == tiny GUI= no CONFIGURE_ARGS+=--without-x PLIST= ${.CURDIR}/pkg-plist-tiny .elif ${FLAVOR:U} == gtk2 GUI= gtk2 CONFIGURE_ARGS+=--enable-xim --enable-fontset PLIST_SUB+= GUI="" DESKTOP="" USES+= desktop-file-utils gnome xorg USE_GNOME= gdkpixbuf2 gtk20 USE_XORG= ice sm x11 xpm xt .elif ${FLAVOR:U} == gtk3 GUI= gtk3 CONFIGURE_ARGS+=--enable-xim --enable-fontset PLIST_SUB+= GUI="" DESKTOP="" USES+= desktop-file-utils gnome xorg USE_GNOME= cairo gdkpixbuf2 gtk30 USE_XORG= ice sm x11 xpm xt .elif ${FLAVOR:U} == motif GUI= motif CONFIGURE_ARGS+=--enable-xim --enable-fontset --with-motif=lib="${MOTIFLIB}" CONFIGURE_ENV+= MOTIFHOME=${LOCALBASE} PLIST_SUB+= GUI="" DESKTOP="@comment " USES+= motif xorg USE_XORG= ice sm x11 xmu xt .elif ${FLAVOR:U} == x11 GUI= x11 CONFIGURE_ARGS+=--with-x PLIST_SUB+= GUI="@comment " DESKTOP="@comment " USES+= xorg USE_XORG= ice sm x11 xmu xpm xt .endif # Options {{{1 # The bulk of the OPTIONS are for normal (non-tiny) vim ### Make sure any new options are excluded below in CONSOLE/TINY OPTIONS_DEFAULT= CTAGS_BASE PYTHON OPTIONS_DEFINE= MAKE_JOBS NLS XTERM_SAVE OPTIONS_SINGLE= CTAGS OPTIONS_SINGLE_CTAGS= CTAGS_BASE CTAGS_EXUBERANT CTAGS_UNIVERSAL OPTIONS_GROUP= LANGBIND OPTIONS_GROUP_LANGBIND= LUA PERL PYTHON RUBY SCHEME TCL OPTIONS_SUB= yes # vim-tiny excludes everything except CONSOLE, MAKE_JOBS .if ${FLAVOR:U} == tiny OPTIONS_EXCLUDE:= ${OPTIONS_DEFINE:NMAKE_JOBS} \ ${OPTIONS_SINGLE_UI:NCONSOLE} \ ${OPTIONS_GROUP_LANGBIND} \ ${OPTIONS_SINGLE_CTAGS} .endif MAKE_JOBS_DESC= Enable parallel build XTERM_SAVE_DESC= Restore xterm screen after exit CTAGS_BASE_DESC= Use system ctags CTAGS_EXUBERANT_DESC= Use exctags instead of ctags CTAGS_UNIVERSAL_DESC= Use uctags instead of ctags # GENERAL OPTIONS CTAGS_EXUBERANT_RUN_DEPENDS= exctags:devel/ctags CTAGS_UNIVERSAL_RUN_DEPENDS= uctags:devel/universal-ctags MAKE_JOBS_VARS_OFF= MAKE_JOBS_UNSAFE=yes NLS_CONFIGURE_ENABLE= nls NLS_USES= gettext # LANGUAGE BINDINGS LANGBIND_DESC= Optional language bindings LUA_CONFIGURE_ENABLE= luainterp LUA_CONFIGURE_WITH= lua-prefix=${LOCALBASE} LUA_USES= lua PERL_CONFIGURE_ENABLE= perlinterp PERL_USES= perl5 PYTHON_USES= python:3.6+ PYTHON_USES_OFF= python:env PYTHON_CONFIGURE_ENABLE= python3interp PYTHON_CONFIGURE_WITH= python3-command=${PYTHON_CMD} RUBY_CONFIGURE_ENABLE= rubyinterp RUBY_USE= RUBY=yes SCHEME_DESC= MzScheme (Racket) bindings SCHEME_CONFIGURE_ENABLE=mzschemeinterp SCHEME_BUILD_DEPENDS= mzscheme:lang/racket SCHEME_RUN_DEPENDS= ${SCHEME_BUILD_DEPENDS} TCL_CONFIGURE_ENABLE= tclinterp TCL_CONFIGURE_WITH= tclsh=tclsh${TCL_VER} TCL_USES= tcl # Targets {{{1 .include .if ${PORT_OPTIONS:MPYTHON} && !empty(WITH_DEBUG) CFLAGS+= -DPy_DEBUG -DPy_DEBUG_NO_PYMALLOC .endif post-extract: ${INSTALL_DATA} ${FILESDIR}/vietnamese_viscii.vim ${WRKSRC}/runtime/keymap post-patch: - ${ECHO_CMD} 'source $$VIMRUNTIME/defaults_freebsd.vim' >> ${WRKSRC}/runtime/defaults.vim + ${REINPLACE_CMD} -e 's|%%ETCDIR%%|${ETCDIR}|' ${WRKSRC}/src/feature.h ${REINPLACE_CMD} -e 's|-liconv|${ICONV_LIB}|g; s|/usr/local|${LOCALBASE}|g' \ ${WRKSRC}/src/auto/configure post-configure: # Needed when devel/libsysinfo is installed: ${REINPLACE_CMD} -e '/^#define HAVE_SYSINFO/ d' ${WRKSRC}/src/auto/config.h .if ${FLAVOR:U} == tiny do-install: ${MKDIR} ${STAGEDIR}${DATADIR}/${VIM_VER} ${INSTALL_PROGRAM} ${WRKSRC}/src/vim ${STAGEDIR}${PREFIX}/bin - ${INSTALL_DATA} ${FILESDIR}/defaults_freebsd.vim ${STAGEDIR}${DATADIR}/${VIM_VER}/defaults.vim + ${INSTALL_DATA} ${WRKSRC}/runtime/defaults.vim ${STAGEDIR}${DATADIR}/${VIM_VER} + ${INSTALL_DATA} ${FILESDIR}/defaults_freebsd.vim ${STAGEDIR}${DATADIR}/${VIM_VER} ${INSTALL_MAN} ${WRKSRC}/runtime/doc/vim.1 ${STAGEDIR}${MAN1PREFIX}/man/man1 .else # flavor != tiny post-install: - ${INSTALL_DATA} ${FILESDIR}/defaults_freebsd.vim ${STAGEDIR}${DATADIR}/${VIM_VER}/ + ${INSTALL_DATA} ${FILESDIR}/defaults_freebsd.vim ${STAGEDIR}${DATADIR}/${VIM_VER} ${RM} ${STAGEDIR}${PREFIX}/bin/ex ${RM} ${STAGEDIR}${PREFIX}/bin/view . for F in eview evim gview gvim gvimdiff rgview rgvim rview rvim vimdiff ${LN} -sf vim ${STAGEDIR}${PREFIX}/bin/$F . endfor # OPTIONS post-patch-CTAGS_BASE-on: ${FIND} ${WRKSRC}/runtime -name 'menu*.vim' | ${XARGS} ${GREP} -l 'ctags -R' | \ ${XARGS} ${REINPLACE_CMD} -Ee 's!ctags -R ?\.!${FIND} . -type f \\| ${XARGS} ctags!g' post-patch-CTAGS_EXUBERANT-on: ${FIND} ${WRKSRC}/runtime -name 'menu*.vim' | ${XARGS} ${GREP} -l 'ctags -R' | \ ${XARGS} ${REINPLACE_CMD} -e 's|ctags -R|exctags -R|g' post-patch-CTAGS_UNIVERSAL-on: ${FIND} ${WRKSRC}/runtime -name 'menu*.vim' | ${XARGS} ${GREP} -l 'ctags -R' | \ ${XARGS} ${REINPLACE_CMD} -e 's|ctags -R|uctags -R|g' post-patch-LUA-on: ${REINPLACE_CMD} -e 's|set dummy lua;|set dummy ${LUA_CMD};|g' ${WRKSRC}/src/auto/configure ${REINPLACE_CMD} -e '/$$LUA_LIBS/ s|^|LUA_LIBS="-L${LUA_LIBDIR} -llua-${LUA_VER}";|' ${WRKSRC}/src/auto/configure ${REINPLACE_CMD} -e '/LUA_CFLAGS=/s|".*"|"-I${LUA_INCDIR}"|' ${WRKSRC}/src/auto/configure post-patch-XTERM_SAVE-on: ${REINPLACE_CMD} -e '/FEAT_XTERM_SAVE/ s|.*|#define FEAT_XTERM_SAVE|' ${WRKSRC}/src/feature.h post-install-NLS-off: ${MKDIR} ${STAGEDIR}${DATADIR}/${VIM_VER}/lang ${MKDIR} ${STAGEDIR}${DATADIR}/${VIM_VER}/keymap ${INSTALL_DATA} ${WRKSRC}/runtime/keymap/* ${STAGEDIR}${DATADIR}/${VIM_VER}/keymap .endif #!defined(TINY) .include diff --git a/editors/vim/distinfo b/editors/vim/distinfo index fabbe4801854..abb472c05e19 100644 --- a/editors/vim/distinfo +++ b/editors/vim/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1662223469 -SHA256 (vim-vim-v9.0.0369_GH0.tar.gz) = 990710ef46e581461e39f38778dd38654f1b61b5768f846553e7c16a8ecb3231 -SIZE (vim-vim-v9.0.0369_GH0.tar.gz) = 16822389 +TIMESTAMP = 1662305587 +SHA256 (vim-vim-v9.0.0379_GH0.tar.gz) = 24aba67af6eee677f367a7f58facfb1fa58cb0f9565c60a3fa5fc1a39e4c0481 +SIZE (vim-vim-v9.0.0379_GH0.tar.gz) = 16828444 diff --git a/editors/vim/files/patch-runtime_defaults.vim b/editors/vim/files/patch-runtime_defaults.vim new file mode 100644 index 000000000000..0523e79e1ee2 --- /dev/null +++ b/editors/vim/files/patch-runtime_defaults.vim @@ -0,0 +1,24 @@ +We wrap `syntax on` in a try block so that it won't produce errors for +vim-tiny, which doens't include the runtime library. + +We also source our own FreeBSD-specific defaults file. + +--- runtime/defaults.vim.orig 2022-09-04 15:43:53 UTC ++++ runtime/defaults.vim +@@ -130,7 +130,9 @@ endif + " GUI (which always has colors). + if &t_Co > 2 || has("gui_running") + " Revert with ":syntax off". +- syntax on ++ try ++ syntax on ++ catch | endtry + + " I like highlighting strings inside C comments. + " Revert with ":unlet c_comment_strings". +@@ -152,3 +154,5 @@ if has('langmap') && exists('+langremap') + " compatible). + set nolangremap + endif ++ ++source $VIMRUNTIME/defaults_freebsd.vim diff --git a/editors/vim/files/patch-src_feature.h b/editors/vim/files/patch-src_feature.h new file mode 100644 index 000000000000..88691a17bba4 --- /dev/null +++ b/editors/vim/files/patch-src_feature.h @@ -0,0 +1,21 @@ +This allows /usr/local/etc/vim/vimrc to be loaded as a system +vimrc. Note that creating that file will prevent loading +defaults.vim from Vim's runtime. + +--- src/feature.h.orig 2022-09-04 15:48:55 UTC ++++ src/feature.h +@@ -710,12 +710,12 @@ + /* + * SYS_VIMRC_FILE Name of the system-wide .vimrc file. + */ +-// #define SYS_VIMRC_FILE "/etc/vimrc" ++#define SYS_VIMRC_FILE "%%ETCDIR%%/vimrc" + + /* + * SYS_GVIMRC_FILE Name of the system-wide .gvimrc file. + */ +-// #define SYS_GVIMRC_FILE "/etc/gvimrc" ++#define SYS_GVIMRC_FILE "%%ETCDIR%%/gvimrc" + + /* + * DFLT_HELPFILE Name of the help file.