Bug 176684 - Convert editors/vim to new options framework
Summary: Convert editors/vim to new options framework
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: David E. O'Brien
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-03-06 13:00 UTC by Baptiste Daroussin
Modified: 2013-03-21 17:58 UTC (History)
0 users

See Also:


Attachments
file.diff (8.58 KB, patch)
2013-03-06 13:00 UTC, Baptiste Daroussin
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Baptiste Daroussin freebsd_committer freebsd_triage 2013-03-06 13:00:00 UTC
This patch convert vim to use the new option framework, while here is fixes build of vim-lite when NLS is disabled.

It makes options more consistent and uses RADIO option to make sure the user can't choose more than 1 UI toolkit.

Fix: Patch attached with submission follows:
Comment 1 Baptiste Daroussin freebsd_committer freebsd_triage 2013-03-06 13:36:51 UTC
Responsible Changed
From-To: freebsd-ports-bugs->obrien

Over to maintainer.
Comment 2 dfilter service freebsd_committer freebsd_triage 2013-03-20 23:57:07 UTC
Author: bapt
Date: Wed Mar 20 23:56:59 2013
New Revision: 314778
URL: http://svnweb.freebsd.org/changeset/ports/314778

Log:
  Convert to new options framework:
  
  rename GNOME2 -> GNOME to fits what is defined in global options descriptions
  remove X11_ONLY and consider that if X11 is selected and no UI is selected you
  are in X11_ONLY mode
  remove LANG option which wasn't used anyway
  do not try to dirrmtry directory if NLS isn't checked
  use RADIO option to do the magic checking of different toolkit
  bsd.port.pre.mk and bsd.port.post.mk are not needed anymore so I just removed them
  
  PR:		ports/176684
  Submitted by:	bapt
  Reviewed by:	miwi
  Approved by:	maintainer timeout (14 days)

Deleted:
  head/editors/vim/options
Modified:
  head/editors/vim/Makefile
  head/editors/vim/pkg-plist

Modified: head/editors/vim/Makefile
==============================================================================
--- head/editors/vim/Makefile	Wed Mar 20 23:32:00 2013	(r314777)
+++ head/editors/vim/Makefile	Wed Mar 20 23:56:59 2013	(r314778)
@@ -1,10 +1,5 @@
-# ex:ts=8
-# Ports collection makefile for:  vim
-# Date created:			  Sat June 29, 1996
-# Whom:				  David O'Brien (obrien@cs.ucdavis.edu)
-#
+# Created by:  David O'Brien <obrien@cs.ucdavis.edu>
 # $FreeBSD$
-#
 
 PORTNAME?=	vim
 #		! _NEVER_ reduce or lower PATCHLEVEL, even if the PATCHLEVEL
@@ -33,10 +28,23 @@ COMMENT?=	Vi "workalike", with many addi
 
 SLAVEDIRS=	editors/vim-lite
 
-.if defined(WITH_OPTIONS) || defined(WITH_VIM_OPTIONS)
-.include "${.CURDIR}/../vim/options"
-.include <bsd.port.options.mk>
+.if !defined(LITE)
+OPTIONS_DEFINE=	PERL PYTHON TCL LUA CSCOPE EXUBERANT_CTAGS \
+		XTERM_SAVE RUBY NLS X11
+OPTIONS_RADIO=	UI
+OPTIONS_RADIO_UI=	ATHENA GTK2 GNOME MOTIF
+
+UI_DESC=	Graphical toolkit to use
+ATHENA_DESC=	Athena GUI toolkit
+XTERM_SAVE_DESC=	Restore xterm screen after exit
+CSCOPE_DESC=	cscope support
+EXUBERANT_CTAGS_DESC=	Use exctags instead of ctags
+.if defined(PACKAGE_BUILDING)
+OPTIONS_DEFAULT+=	CSCOPE EXUBERANT_CTAGS PERL PYTHON RUBY \
+			TCL LUA X11 GTK2
+.endif
 .endif
+.include <bsd.port.options.mk>
 
 CONFLICTS=	vim6* vim*-gnome libsysinfo
 .if defined(LITE)
@@ -63,50 +71,44 @@ MLINKS=		vim.1 rvim.1	vim.1 rview.1
 MLINKS+=	vim.1 gvim.1	vim.1 gview.1	vimdiff.1 gvimdiff.1 \
 		vim.1 rgvim.1	vim.1 rgview.1	evim.1 eview.1
 .endif
-.if !defined(WITHOUT_NLS)
+
+.if ${PORT_OPTIONS:MNLS}
 MANLANG=	"" ru.KOI8-R ru.UTF-8 pl.ISO8859-2 pl.UTF-8 pl fr.ISO8859-1 \
 		fr.UTF-8 fr it.ISO8859-1 it.UTF-8 it
+USE_GETTEXT=	yes
+PLIST_SUB=	NLS=""
+.else
+MAKE_ARGS+=	CONF_OPT_NLS="--disable-nls"
+PLIST_SUB=	NLS="@comment "
 .endif
 
-.if defined(PACKAGE_BUILDING) && !defined(LITE)
-WITH_CSCOPE=	yes
-WITH_EXUBERANT_CTAGS=yes
-WITH_PERL=	yes
-WITH_PYTHON=	yes
-WITH_RUBY=	yes
-WITH_TCL=	yes
-WITH_LUA=	yes
-.endif
-
-.if defined(WITH_PYTHON)
+.if ${PORT_OPTIONS:MPYTHON}
 USE_PYTHON=	yes
 MAKE_ARGS+=	CONF_OPT_PYTHON="--enable-pythoninterp"
 .endif
 
-.if defined(WITH_RUBY)
+.if ${PORT_OPTIONS:MRUBY}
 USE_RUBY=	yes
 MAKE_ARGS+=	CONF_OPT_RUBY="--enable-rubyinterp"
 .endif
 
-.if defined(WITH_TCL)
+.if ${PORT_OPTIONS:MTCL}
 USE_TCL=	85+
+MAKE_ARGS+=	CONF_OPT_TCL="--enable-tclinterp --with-tclsh="${TCLSH:S/${LOCALBASE}\/bin\///g}""
 .endif
 
-.if defined(WITH_LUA)
+.if ${PORT_OPTIONS:MLUA}
 USE_LUA=	yes
 MAKE_ARGS+=	CONF_OPT_LUA="--enable-luainterp=dynamic" \
 MAKE_ARGS+=	CONF_OPT_LUA_PREFIX="--with-lua-prefix=${LOCALBASE}"
 .endif
 
-.if defined(WITH_PERL)
-WANT_PERL=	yes
+.if ${PORT_OPTIONS:MPERL}
+USE_PERL5=	yes
+MAKE_ARGS+=	CONF_OPT_PERL="--enable-perlinterp"
 .endif
 
-.if !defined(LITE) && !defined(NO_GUI) && !defined(WITHOUT_GUI) && !defined(WITHOUT_X11) && !defined(WITH_X11_ONLY) && !defined(WITH_ATHENA) && !defined(WITH_MOTIF)
 WANT_GNOME=	yes
-.endif
-
-.include <bsd.port.pre.mk>
 
 .if defined(LITE)
 PKGNAMESUFFIX=	-lite
@@ -115,73 +117,58 @@ MAKE_ARGS+=	CONF_OPT_PERL="--disable-per
 .else	# !LITE
 MAKE_ARGS+=	CONF_OPT_FEAT="--with-features=big"
 I18N=		CONF_OPT_MULTIBYTE="--enable-multibyte --enable-fontset --enable-xim"
+.endif
 
-. if defined(NO_GUI) || defined(WITHOUT_GUI)
-WITHOUT_X11=	yes
-. endif
-
-. if defined(WITH_CSCOPE)
+.if ${PORT_OPTIONS:MCSCOPE}
 RUN_DEPENDS+=	cscope:${PORTSDIR}/devel/cscope
 MAKE_ARGS+=	CONF_OPT_CSCOPE="--enable-cscope"
-. endif
+.endif
 
-. if defined(WITH_EXUBERANT_CTAGS)
+.if ${PORT_OPTIONS:MEXUBERANT_CTAGS}
 RUN_DEPENDS+=	exctags:${PORTSDIR}/devel/ctags
-. endif
+CTAGS_CMD=	exctags -R .
+.else
+CTAGS_CMD=	${FIND} . -type f \\|${XARGS} ctags
+.endif
 
-. if defined(WITH_PERL)
-USE_PERL5=	yes
-MAKE_ARGS+=	CONF_OPT_PERL="--enable-perlinterp"
-. endif
+CONF_OPT_GUI="--enable-gui=no --without-x"
 
-. if defined(WITH_TCL)
-MAKE_ARGS+=	CONF_OPT_TCL="--enable-tclinterp --with-tclsh="${TCLSH:S/${LOCALBASE}\/bin\///g}""
+.if ${PORT_OPTIONS:MX11}
+CONF_OPT_GUI="--enable-gui=no --with-x"
+
+. if ${PORT_OPTIONS:MATHENA}
+CONF_OPT_GUI="--enable-gui=athena"
 . endif
 
-. if !defined(WITHOUT_X11)
-#	for now default the GUI to the GTK+ one
-.  if !defined(WITH_X11_ONLY) && !defined(WITH_ATHENA) && !defined(WITH_MOTIF) && !defined(WITH_GNOME2) && !defined(WITH_GTK2)
-WITH_GTK2=	yes
-.  endif
-
-.  if defined(WITH_ATHENA)
-MAKE_ARGS+=	CONF_OPT_GUI="--enable-gui=athena" ${I18N}
-.  elif defined(WITH_GTK2)
+. if ${PORT_OPTIONS:MGTK2}
 USE_GNOME=	gtk20
-MAKE_ARGS+=	CONF_OPT_GUI="--enable-gui=gtk2 --with-gtk-prefix=${LOCALBASE}" ${I18N}
+CONF_OPT_GUI="--enable-gui=gtk2 --with-gtk-prefix=${LOCALBASE}"
 MAKE_ARGS+=	X_LIBS="$(X_LIBS) -lXt"
 USE_XORG+=	xt
-.  elif defined(WITH_GNOME2)
+. endif
+
+. if ${PORT_OPTIONS:MGNOME}
 USE_GNOME=	libgnomeui
 PKGNAMESUFFIX=	-gnome2
-MAKE_ARGS+=	CONF_OPT_GUI="--enable-gui=gnome2" ${I18N}
+CONF_OPT_GUI="--enable-gui=gnome2"
 MAKE_ARGS+=	X_LIBS="$(X_LIBS) -lXt"
 USE_XORG+=	xt glproto
-.  elif defined(WITH_MOTIF)
+. endif
+
+. if ${PORT_OPTIONS:MMOTIF}
 USE_MOTIF=	yes
-MAKE_ARGS+=	CONF_OPT_GUI="--enable-gui=motif --with-motif-lib=\"${MOTIFLIB}\"" MOTIFHOME=${LOCALBASE} ${I18N}
-.  elif defined(WITH_X11_ONLY)
-MAKE_ARGS+=	CONF_OPT_GUI="--enable-gui=no --with-x" ${I18N}
-.  endif
-. else	# WITHOUT_X11
-MAKE_ARGS+=	CONF_OPT_GUI="--enable-gui=no --without-x" ${I18N}
-. endif	# WITHOUT_X11
-.endif	# LITE
+CONF_OPT_GUI="--enable-gui=motif --with-motif-lib=\"${MOTIFLIB}\""
+MAKE_ARGS+=	MOTIFHOME=${LOCALBASE}
+. endif
+
+.endif
+MAKE_ARGS+=	CONF_OPT_GUI=${CONF_OPT_GUI} ${I18N}
+
 
 .if exists(${LOCALBASE}/lib/libiconv.so)
 USE_ICONV=	yes
 .endif
-.if !defined(WITHOUT_NLS)
-USE_GETTEXT=	yes
-.else
-MAKE_ARGS+=	CONF_OPT_NLS="--disable-nls"
-.endif
 
-.if defined(WITH_EXUBERANT_CTAGS)
-CTAGS_CMD=	exctags -R .
-.else
-CTAGS_CMD=	${FIND} . -type f \\|${XARGS} ctags
-.endif
 
 post-patch:
 	@(${FIND} ${WRKSRC}/../runtime/ -name menu\*.vim -print0 | ${XARGS} -0 \
@@ -197,7 +184,7 @@ pre-configure:
 		s|\$$gtk_config_exec_prefix/bin/gtk-config|\$${GTK_CONFIG}|g; \
 		s|/usr/local|${LOCALBASE}|g' \
 		${WRKSRC}/auto/configure
-.if defined(WITH_XTERM_SAVE)
+.if ${PORT_OPTIONS:MXTERM_SAVE}
 	@${REINPLACE_CMD} -e ' \
 		s|/\* #define FEAT_XTERM_SAVE \*/|#define FEAT_XTERM_SAVE|g' \
 		${WRKSRC}/feature.h
@@ -242,9 +229,6 @@ post-install:
 	@${CAT} ${PKGMESSAGE}
 	@${ECHO_CMD}
 
-show-options:
-	@${MAKE} -DWITH_OPTIONS showconfig
-
 .if defined(ONT_CHECKSUM)
 checksum:
 .endif
@@ -271,4 +255,4 @@ ckp:
 ckmtree:
 	${MTREE_CMD} -f ${MTREE_FILE} -p ${PREFIX}
 
-.include <bsd.port.post.mk>
+.include <bsd.port.mk>

Modified: head/editors/vim/pkg-plist
==============================================================================
--- head/editors/vim/pkg-plist	Wed Mar 20 23:32:00 2013	(r314777)
+++ head/editors/vim/pkg-plist	Wed Mar 20 23:56:59 2013	(r314778)
@@ -20,24 +20,24 @@ bin/gvimdiff
 @comment Insert PLIST.share-vim here
 @comment -=[ begin PLIST.share-vim ]=-
 @comment -=[ end PLIST.share-vim ]=-
-@dirrmtry man/fr/man1
-@dirrmtry man/fr
-@dirrmtry man/fr.ISO8859-1/man1
-@dirrmtry man/fr.ISO8859-1
-@dirrmtry man/fr.UTF-8/man1
-@dirrmtry man/fr.UTF-8
-@dirrmtry man/it/man1
-@dirrmtry man/it
-@dirrmtry man/it.ISO8859-1/man1
-@dirrmtry man/it.ISO8859-1
-@dirrmtry man/it.UTF-8/man1
-@dirrmtry man/it.UTF-8
-@dirrmtry man/pl/man1
-@dirrmtry man/pl
-@dirrmtry man/pl.ISO8859-2/man1
-@dirrmtry man/pl.ISO8859-2
-@dirrmtry man/pl.UTF-8/man1
-@dirrmtry man/pl.UTF-8
-@dirrmtry man/ru.UTF-8/man1
-@dirrmtry man/ru.UTF-8
+%%NLS%%@dirrmtry man/fr/man1
+%%NLS%%@dirrmtry man/fr
+%%NLS%%@dirrmtry man/fr.ISO8859-1/man1
+%%NLS%%@dirrmtry man/fr.ISO8859-1
+%%NLS%%@dirrmtry man/fr.UTF-8/man1
+%%NLS%%@dirrmtry man/fr.UTF-8
+%%NLS%%@dirrmtry man/it/man1
+%%NLS%%@dirrmtry man/it
+%%NLS%%@dirrmtry man/it.ISO8859-1/man1
+%%NLS%%@dirrmtry man/it.ISO8859-1
+%%NLS%%@dirrmtry man/it.UTF-8/man1
+%%NLS%%@dirrmtry man/it.UTF-8
+%%NLS%%@dirrmtry man/pl/man1
+%%NLS%%@dirrmtry man/pl
+%%NLS%%@dirrmtry man/pl.ISO8859-2/man1
+%%NLS%%@dirrmtry man/pl.ISO8859-2
+%%NLS%%@dirrmtry man/pl.UTF-8/man1
+%%NLS%%@dirrmtry man/pl.UTF-8
+%%NLS%%@dirrmtry man/ru.UTF-8/man1
+%%NLS%%@dirrmtry man/ru.UTF-8
 @dirrm share/vim
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
Comment 3 Baptiste Daroussin freebsd_committer freebsd_triage 2013-03-21 17:58:47 UTC
State Changed
From-To: open->closed

Committed. Thanks!