Skip to content

Commit

Permalink
editors/vim: Flavorize and update to 8.2.3394
Browse files Browse the repository at this point in the history
This commit completely rewires the vim ports. It includes the following:

* `vim' is now a TUI-only package. It is what the `vim-console' port
  was.

* `vim-gtk3' includes the TUI binary (vim) and a GTk3-backed GUI. It is
  what the `vim' port was.

* Each GUI toolkit has a separate package. There is vim-gtk3, -gtk2,
  -motif, -athena, and -x11.

* `vim-tiny' is still the same thing, except it includes a defaults.vim
  stub to silence a startup error message.

* Only the python3 language binding is included by default. Perl, Ruby,
  TCL, Scheme, and Lua can still be enabled via options. But there are
  very, very few plugins that require anything other than python.

* py27 support is removed entirely.

* CScope support is unconditionally enabled, but vim no longer depends
  upon it. If cscope is installed, it'll be used.

* The default ctags is now the version included in base. It's very
  rudimentary, but only a subset of users use ctags at all. Universal or
  exuberant ctags can still be enabled via option knobs.
  • Loading branch information
assistcontrol committed Sep 2, 2021
1 parent a055899 commit 620f205
Show file tree
Hide file tree
Showing 9 changed files with 105 additions and 135 deletions.
2 changes: 0 additions & 2 deletions editors/Makefile
Expand Up @@ -261,8 +261,6 @@
SUBDIR += vigor
SUBDIR += vile
SUBDIR += vim
SUBDIR += vim-console
SUBDIR += vim-tiny
SUBDIR += vscode
SUBDIR += web-mode
SUBDIR += with-editor
Expand Down
12 changes: 0 additions & 12 deletions editors/vim-console/Makefile

This file was deleted.

14 changes: 0 additions & 14 deletions editors/vim-console/pkg-descr

This file was deleted.

19 changes: 0 additions & 19 deletions editors/vim-tiny/Makefile

This file was deleted.

15 changes: 0 additions & 15 deletions editors/vim-tiny/pkg-descr

This file was deleted.

166 changes: 96 additions & 70 deletions editors/vim/Makefile
@@ -1,13 +1,12 @@
# Created by: David O'Brien <obrien@cs.ucdavis.edu>

PORTNAME= vim
PORTVERSION= 8.2.3273
PORTREVISION= 1
PORTVERSION= 8.2.3394
DISTVERSIONPREFIX= v
CATEGORIES= editors

MAINTAINER= adamw@FreeBSD.org
COMMENT?= Improved version of the vi editor
COMMENT= Improved version of the vi editor (${FLAVOR:U} flavor)

LICENSE= VIM
LICENSE_NAME= VIM License
Expand All @@ -17,10 +16,9 @@ LICENSE_PERMS= dist-mirror dist-sell pkg-mirror pkg-sell auto-accept
USES= cpe iconv ncurses pkgconfig shebangfix
USE_GITHUB= yes

CONFLICTS_INSTALL?= vim-console vim-tiny

# 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
Expand All @@ -31,25 +29,92 @@ MAKE_ARGS= STRIP="${STRIP_CMD}" \
CPE_VERSION= ${PORTVERSION:R}
GNU_CONFIGURE= yes
PLIST_SUB= VIM_VER=${VIM_VER}
PORTDATA?= ${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}

# OPTIONS for normal (non-tiny) vim
# ### Make sure any new options are excluded below in CONSOLE/TINY
OPTIONS_DEFAULT= CSCOPE DEFAULT_VIMRC CTAGS_EXUBERANT GTK3 PERL PYTHON RUBY
OPTIONS_DEFINE= CSCOPE DEFAULT_VIMRC MAKE_JOBS NLS XTERM_SAVE
OPTIONS_SINGLE= CTAGS UI
# Flavors {{{1
# FLAVORS are used to build various Vim GUIs. The default flavor (`vim') is
# console-only.
FLAVORS= console athena gtk2 gtk3 motif x11 tiny

# GUI flavors
.if ${FLAVOR:U} == console
GUI= no
PLIST_SUB+= GUI="@comment " DESKTOP="@comment "
CONFLICTS_INSTALL= vim-athena vim-gtk2 vim-gtk3 vim-motif vim-tiny vim-x11

.elif ${FLAVOR:U} == tiny
PKGNAMESUFFIX= -tiny
GUI= no
PLIST= ${.CURDIR}/pkg-plist-tiny
CONFLICTS_INSTALL= vim-athena vim-console vim-gtk2 vim-gtk3 vim-motif vim-x11

.elif ${FLAVOR:U} == athena
PKGNAMESUFFIX= -athena
GUI= athena
CONFIGURE_ARGS+=--enable-xim --enable-fontset
PLIST_SUB+= GUI="" DESKTOP="@comment "
USES+= xorg
USE_XORG+= ice sm x11 xaw xmu xpm xt
CONFLICTS_INSTALL= vim-console vim-gtk2 vim-gtk3 vim-motif vim-tiny vim-x11

.elif ${FLAVOR:U} == gtk2
PKGNAMESUFFIX= -gtk2
GUI= gtk2
INSTALLS_ICONS= yes
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
CONFLICTS_INSTALL= vim-athena vim-console vim-gtk3 vim-motif vim-tiny vim-x11

.elif ${FLAVOR:U} == gtk3
PKGNAMESUFFIX= -gtk3
GUI= gtk3
INSTALLS_ICONS= yes
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
CONFLICTS_INSTALL= vim-athena vim-console vim-gtk2 vim-motif vim-tiny vim-x11

.elif ${FLAVOR:U} == motif
PKGNAMESUFFIX= -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
CONFLICTS_INSTALL= vim-athena vim-console vim-gtk2 vim-gtk3 vim-tiny vim-x11

.elif ${FLAVOR:U} == x11
PKGNAMESUFFIX= -x11
GUI= no
CONFIGURE_ARGS+=--enable-xim --enable-fontset --with-x
PLIST_SUB+= GUI="@comment " DESKTOP="@comment "
USES+= xorg
USE_XORG= ice sm x11 xt
CONFLICTS_INSTALL= vim-athena vim-console vim-gtk2 vim-gtk3 vim-motif vim-tiny
.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 DEFAULT_VIMRC PYTHON
OPTIONS_DEFINE= DEFAULT_VIMRC MAKE_JOBS NLS XTERM_SAVE
OPTIONS_SINGLE= CTAGS
OPTIONS_SINGLE_CTAGS= CTAGS_BASE CTAGS_EXUBERANT CTAGS_UNIVERSAL
OPTIONS_SINGLE_UI= ATHENA CONSOLE GTK2 GTK3 MOTIF X11
OPTIONS_GROUP= LANGBIND
OPTIONS_GROUP_LANGBIND= LUA PERL PYTHON RUBY SCHEME TCL
OPTIONS_SUB= yes

# vim-tiny excludes everything except CONSOLE, DEFAULT_VIMRC, MAKE_JOBS
.if defined(CONSOLE) || defined(TINY)
OPTIONS_SLAVE= CONSOLE
.if ${FLAVOR:U} == tiny
OPTIONS_EXCLUDE:= ${OPTIONS_DEFINE:NDEFAULT_VIMRC:NMAKE_JOBS} \
${OPTIONS_SINGLE_UI:NCONSOLE} \
${OPTIONS_GROUP_LANGBIND} \
Expand All @@ -64,22 +129,11 @@ CTAGS_BASE_DESC= Use system ctags
CTAGS_EXUBERANT_DESC= Use exctags instead of ctags
CTAGS_UNIVERSAL_DESC= Use uctags instead of ctags

UI_DESC= User interface
ATHENA_DESC= Athena GUI toolkit
CSCOPE_DESC= cscope support
CONSOLE_DESC= Console/terminal mode

LANGBIND_DESC= Optional language bindings
SCHEME_DESC= MzScheme (Racket) bindings

# BROKEN: ruby.h: error: wrong number of arguments specified for 'deprecated' attribute
OPTIONS_EXCLUDE_powerpc64= RUBY
OPTIONS_EXCLUDE_powerpc64le= RUBY

# GENERAL OPTIONS
CSCOPE_CONFIGURE_ENABLE=cscope
CSCOPE_RUN_DEPENDS= cscope:devel/cscope

CTAGS_EXUBERANT_RUN_DEPENDS= exctags:devel/ctags
CTAGS_UNIVERSAL_RUN_DEPENDS= uctags:devel/universal-ctags

Expand All @@ -88,53 +142,24 @@ MAKE_JOBS_VARS_OFF= MAKE_JOBS_UNSAFE=yes
NLS_CONFIGURE_ENABLE= nls
NLS_USES= gettext

# UI
ATHENA_PLIST_SUB= GUI="" DESKTOP="@comment "
ATHENA_USES= xorg
ATHENA_USE= XORG=ice,sm,x11,xaw,xmu,xpm,xt
ATHENA_VARS= GUI=athena

CONSOLE_CONFIGURE_OFF= --enable-xim --enable-fontset
CONSOLE_PLIST_SUB= GUI="@comment " DESKTOP="@comment "
CONSOLE_VARS= GUI=no

GTK2_PLIST_SUB= GUI="" DESKTOP=""
GTK2_USE= GNOME=gdkpixbuf2,gtk20 XORG=ice,sm,x11,xpm,xt
GTK2_USES= desktop-file-utils gnome xorg
GTK2_VARS= GUI=gtk2 INSTALLS_ICONS=yes

GTK3_PLIST_SUB= GUI="" DESKTOP=""
GTK3_USE= GNOME=cairo,gdkpixbuf2,gtk30 XORG=ice,sm,x11,xpm,xt
GTK3_USES= desktop-file-utils gnome xorg
GTK3_VARS= GUI=gtk3 INSTALLS_ICONS=yes

MOTIF_CONFIGURE_ENV= MOTIFHOME=${LOCALBASE}
MOTIF_CONFIGURE_WITH= motif-lib="${MOTIFLIB}"
MOTIF_PLIST_SUB= GUI="" DESKTOP="@comment "
MOTIF_USE= XORG=ice,sm,x11,xmu,xt
MOTIF_USES= motif xorg
MOTIF_VARS= GUI=motif

X11_CONFIGURE_WITH= x
X11_PLIST_SUB= GUI="@comment " DESKTOP="@comment "
X11_USE= XORG=ice,sm,x11,xt
X11_USES= xorg
X11_VARS= GUI=no

# 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
PYTHON_USES= python:3.6+
PYTHON_USES_OFF= python:env
PYTHON_CONFIGURE_ARGS= --enable-python3interp --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}
Expand All @@ -143,17 +168,11 @@ TCL_CONFIGURE_ENABLE= tclinterp
TCL_CONFIGURE_WITH= tclsh=tclsh${TCL_VER}
TCL_USES= tcl

# Targets {{{1
.include <bsd.port.pre.mk>

.if ${PORT_OPTIONS:MPYTHON}
. if !empty(WITH_DEBUG)
.if ${PORT_OPTIONS:MPYTHON} && !empty(WITH_DEBUG)
CFLAGS+= -DPy_DEBUG -DPy_DEBUG_NO_PYMALLOC
. endif
. if ${PYTHON_MAJOR_VER} == 3
CONFIGURE_ARGS+= --enable-python3interp --with-python3-command=${PYTHON_CMD}
. else
CONFIGURE_ARGS+= --enable-pythoninterp --with-python-command=${PYTHON_CMD}
. endif
.endif

post-extract:
Expand All @@ -173,13 +192,20 @@ post-install-DEFAULT_VIMRC-on:
${MKDIR} ${STAGEDIR}${ETCDIR}
${INSTALL_DATA} ${FILESDIR}/vimrc ${STAGEDIR}${ETCDIR}/vimrc.sample

.if !defined(TINY)
.if ${FLAVOR:U} == tiny
do-install:
${MKDIR} ${STAGEDIR}${DATADIR}/${VIM_VER}
${INSTALL_PROGRAM} ${WRKSRC}/src/vim ${STAGEDIR}${PREFIX}/bin
${TOUCH} ${STAGEDIR}${DATADIR}/${VIM_VER}/defaults.vim
${INSTALL_MAN} ${WRKSRC}/runtime/doc/vim.1 ${STAGEDIR}${MAN1PREFIX}/man/man1

.else # flavor != tiny
post-install:
${RM} ${STAGEDIR}${PREFIX}/bin/ex
${RM} ${STAGEDIR}${PREFIX}/bin/view
.for F in eview evim gview gvim gvimdiff rgview rgvim rview rvim vimdiff
. for F in eview evim gview gvim gvimdiff rgview rgvim rview rvim vimdiff
${LN} -sf vim ${STAGEDIR}${PREFIX}/bin/$F
.endfor
. endfor

# OPTIONS
post-patch-CTAGS_BASE-on:
Expand Down
6 changes: 3 additions & 3 deletions editors/vim/distinfo
@@ -1,3 +1,3 @@
TIMESTAMP = 1627902718
SHA256 (vim-vim-v8.2.3273_GH0.tar.gz) = 03c5f8962aa68107e4310895b0679c463f6aef2452759ccac50cd052eda49b76
SIZE (vim-vim-v8.2.3273_GH0.tar.gz) = 15665556
TIMESTAMP = 1630541775
SHA256 (vim-vim-v8.2.3394_GH0.tar.gz) = aae16c7705bd22e1ecc9316366ad19193a980b986019557aa95f04f6bacd0b10
SIZE (vim-vim-v8.2.3394_GH0.tar.gz) = 15708831
6 changes: 6 additions & 0 deletions editors/vim/pkg-descr
Expand Up @@ -6,5 +6,11 @@ many consider it an entire IDE. It's not just for programmers, though. Vim is
perfect for all kinds of text editing, from composing email to editing
configuration files.

FreeBSD has the following Vim packages:
* vim: Console-only Vim (vim binary) with all runtime files
* vim-gtk3, -gtk2, -athena, -motif, -x11: Console Vim plus a GUI (gvim binary)
* vim-tiny: Vim binary only, with no runtime files. Not useful for most people;
intended for minimal (ex. jail) installations

WWW: http://www.vim.org/
WWW: https://github.com/vim/vim
File renamed without changes.

0 comments on commit 620f205

Please sign in to comment.