ports/147103: [patch] editors/emacs-nox11: skip OPTIONS and use WITHOUT_DBUS

Ashish SHUKLA wahjava at gmail.com
Thu May 27 08:50:04 UTC 2010


The following reply was made to PR ports/147103; it has been noted by GNATS.

From: wahjava at gmail.com (Ashish SHUKLA)
To: Anonymous <swell.k at gmail.com>
Cc: phoffman at proper.com,  Giorgos Keramidas <keramida at freebsd.org>,  bug-followup at FreeBSD.org
Subject: Re: ports/147103: [patch] editors/emacs-nox11: skip OPTIONS and use WITHOUT_DBUS
Date: Thu, 27 May 2010 14:17:24 +0530

 --=-=-=
 
 Anonymous  writes:
 > wahjava at gmail.com (Ashish SHUKLA) writes:
 
 >> Hi Anonymous,
 >> 
 >> Thanks for your diff. 
 >> 
 >> I've few objections to the diff:
 >> 
 >> - WITHOUT_DBUS is unneeded, as DBUS can work without X11.
 
 > D-Bus is rarely used outside of X11/Gnome apps. WITHOUT_DBUS makes
 > emacs-nox11 package (not port) have no dependencies at all. And
 > installing dbus on e.g. server makes no sense.
 
 >> - No need to skip OPTIONS.
 
 > Why we should duplicate OPTIONS in nox11 slave port? Users are advised
 > to refer to the main port if they need them. -nox11 port is only for
 > package (pkg_add) and really lazy users.
 
 Okay, fine.
 
 >> 
 >> Following are the changes I've in mind for editors/emacs, which also try to
 >> fix the problem being solved by the current diff:
 >> 
 >> - Removing X11 and DBUS options from the editors/emacs port, as they're KNOBS
 >> and user can {dis,en}able them in there make.conf(5) or at command-line,
 >> there is no need for them to listed in OPTIONS, wrong decision by me in the
 >> first place.
 
 > I agree only on X11 knob. There is no need to list it in OPTIONS
 > variable, ifdef is enough. DBUS unlike X11 can stand on its own, though.
 
 DBUS is also a knob as per ${PORTSDIR}/KNOBS file.
 
 >> 
 >> - Adding a CONFLICTS for 'emacs-nox11-*' package in editors/emacs.
 >> 
 >> - Removal of ALSA checks from configure.
 >> 
 >> - Removal of libintl checks from configure.
 
 > Why? Do they interfere?
 
 That causes emacs to be linked with '-lintl'.
 
 [...]
 
 > BTW, I've dropped -lintl from LDFLAGS in emacs port and successfully
 > built it with Xaw toolkit. Again, if m17n really needs gettext symbols
 > on linking then libdata/pkgconfig/m17n-*.pc should be fixed rather than
 > emacs.
 
 Yes, same here.
 
 >> Also I can remove GTK2 OPTION, and use it as default toolkit if
 >> MOTIF/XAW/XAW3D aren't defined, as GTK2 is also a KNOB.
 
 > Agree, ifdef is enough. But you should mention it in OPTIONS, e.g.
 
 >   XAW "Use Athena widgets instead of GTK+ 2.0" OFF
 
 Instead of mentioning GTK+ in every OPTION, I've added a 'pre-everything'
 target.
 
 Attached is the diff file of the cleaned up port.
 
 Thanks
 -- 
 Ashish SHUKLA
 
 Sent via Gnus from GNU Emacs
 
 --=-=-=
 Content-Disposition: attachment; filename=emacs.diff
 Content-Description: editors/emacs diff
 
 diff -urN /usr/ports/editors/emacs/Makefile emacs/Makefile
 --- /usr/ports/editors/emacs/Makefile	2010-05-22 01:21:04.000000000 +0530
 +++ emacs/Makefile	2010-05-27 14:14:59.000000000 +0530
 @@ -28,7 +28,8 @@
  USE_GMAKE=	yes
  USE_BZIP2=	yes
  
 -USE_GETTEXT=	yes
 +LICENSE=	GPLv3
 +LICENSE_FILE=	${WRKSRC}/COPYING
  
  MAN1=		b2m.1 ctags.1 ebrowse.1 emacs.1 emacsclient.1 etags.1 \
  		grep-changelog.1 rcs-checkin.1
 @@ -43,10 +44,8 @@
  		org pcl-cvs pgg rcirc reftex remember sasl sc semantic ses sieve \
  		smtpmail speedbar tramp url vip viper widget woman
  
 -OPTIONS=	DBUS	"DBus support"			ON \
 -		GCONF	"GConf support"			ON \
 +OPTIONS=	GCONF	"GConf support"			ON \
  		GIF	"GIF support"			ON \
 -		GTK2	"GTK+ support"			ON \
  		JPEG	"JPEG support"			ON \
  		M17N	"M17N support for text-shaping"	ON \
  		MOTIF	"Motif support"			OFF \
 @@ -56,7 +55,6 @@
  		SOURCES	"Install source code"		ON \
  		SVG	"SVG support"			ON \
  		TIFF	"TIFF support"			ON \
 -		X11	"X11 support"			ON \
  		XAW	"XAW support"			OFF \
  		XAW3D	"XAW3D support"			OFF \
  		SYNC_INPUT	"Synchronously process asynchronous input"	ON \
 @@ -110,10 +108,6 @@
  CONFIGURE_ARGS+=	--without-toolkit-scroll-bars
  .endif
  
 -.if defined(WITHOUT_SOUND)
 -CONFIGURE_ARGS+=	--without-sound
 -.endif
 -
  .if defined(WITHOUT_SYNC_INPUT)
  CONFIGURE_ARGS+=	--without-sync-input
  .endif
 @@ -168,7 +162,7 @@
  .if !defined(WITHOUT_XFT)
  LIB_DEPENDS+=	m17n.4:${PORTSDIR}/devel/m17n-lib
  .endif
 -CONFIGURE_ENV+=		LDFLAGS="-L${LOCALBASE}/lib -lintl"
 +CONFIGURE_ENV+=		LDFLAGS="-L${LOCALBASE}/lib"
  .endif
  
  .if defined(WITHOUT_OTF)
 @@ -191,6 +185,10 @@
  
  .endif
  
 +.if defined(WITHOUT_SOUND)
 +CONFIGURE_ARGS+=	--without-sound
 +.endif
 +
  .if defined(WITHOUT_DBUS)
  CONFIGURE_ARGS+=	--without-dbus
  .else
 @@ -213,7 +211,7 @@
  .endif
  
  .if ${OSVERSION} < 700000 && defined(WITHOUT_X11) && defined(WITH_DBUS)
 -BROKEN= Does not currently build with dbus support but without X11
 +BROKEN=	Does not currently build with dbus support but without X11
  .endif
  
  post-patch:
 @@ -227,4 +225,12 @@
  	@${INSTALL_DATA} ${WRKSRC}/sources.el ${DATADIR}/${EMACS_VER}/site-lisp/site-start.el
  .endif
  
 +pre-everything::
 +	@${ECHO_MSG}
 +	@${ECHO_MSG} "====> By default Emacs is built with X11, DBUS, and GTK+ support."
 +	@${ECHO_MSG} "====> To disable X11 support, define: WITHOUT_X11."
 +	@${ECHO_MSG} "====> To disable GTK2 support, define: WITHOUT_GTK2."
 +	@${ECHO_MSG} "====> To disable DBUS support, define: WITHOUT_DBUS."
 +	@${ECHO_MSG}
 +
  .include <bsd.port.post.mk>
 diff -urN /usr/ports/editors/emacs/files/patch-configure emacs/files/patch-configure
 --- /usr/ports/editors/emacs/files/patch-configure	1970-01-01 05:30:00.000000000 +0530
 +++ emacs/files/patch-configure	2010-05-27 10:25:02.000000000 +0530
 @@ -0,0 +1,326 @@
 +
 +$FreeBSD$
 +
 +--- configure.orig
 ++++ configure
 +@@ -6432,218 +6432,10 @@
 + fi
 + 
 + 
 +-
 +-  ALSA_REQUIRED=1.0.0
 +-  ALSA_MODULES="alsa >= $ALSA_REQUIRED"
 +-
 +-  succeeded=no
 +-
 +-  # Extract the first word of "pkg-config", so it can be a program name with args.
 +-set dummy pkg-config; ac_word=$2
 +-{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5
 +-$as_echo_n "checking for $ac_word... " >&6; }
 +-if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
 +-  $as_echo_n "(cached) " >&6
 +-else
 +-  case $PKG_CONFIG in
 +-  [\\/]* | ?:[\\/]*)
 +-  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
 +-  ;;
 +-  *)
 +-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 +-for as_dir in $PATH
 +-do
 +-  IFS=$as_save_IFS
 +-  test -z "$as_dir" && as_dir=.
 +-  for ac_exec_ext in '' $ac_executable_extensions; do
 +-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
 +-    ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
 +-    $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
 +-    break 2
 +-  fi
 +-done
 +-done
 +-IFS=$as_save_IFS
 +-
 +-  test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
 +-  ;;
 +-esac
 +-fi
 +-PKG_CONFIG=$ac_cv_path_PKG_CONFIG
 +-if test -n "$PKG_CONFIG"; then
 +-  { $as_echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5
 +-$as_echo "$PKG_CONFIG" >&6; }
 +-else
 +-  { $as_echo "$as_me:$LINENO: result: no" >&5
 +-$as_echo "no" >&6; }
 + fi
 + 
 + 
 + 
 +-  if test "$PKG_CONFIG" = "no" ; then
 +-     HAVE_ALSA=no
 +-  else
 +-     PKG_CONFIG_MIN_VERSION=0.9.0
 +-     if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
 +-        { $as_echo "$as_me:$LINENO: checking for $ALSA_MODULES" >&5
 +-$as_echo_n "checking for $ALSA_MODULES... " >&6; }
 +-
 +-        if $PKG_CONFIG --exists "$ALSA_MODULES" 2>&5; then
 +-            { $as_echo "$as_me:$LINENO: result: yes" >&5
 +-$as_echo "yes" >&6; }
 +-            succeeded=yes
 +-
 +-            { $as_echo "$as_me:$LINENO: checking ALSA_CFLAGS" >&5
 +-$as_echo_n "checking ALSA_CFLAGS... " >&6; }
 +-            ALSA_CFLAGS=`$PKG_CONFIG --cflags "$ALSA_MODULES"|sed -e 's,///*,/,g'`
 +-            { $as_echo "$as_me:$LINENO: result: $ALSA_CFLAGS" >&5
 +-$as_echo "$ALSA_CFLAGS" >&6; }
 +-
 +-            { $as_echo "$as_me:$LINENO: checking ALSA_LIBS" >&5
 +-$as_echo_n "checking ALSA_LIBS... " >&6; }
 +-            ALSA_LIBS=`$PKG_CONFIG --libs "$ALSA_MODULES"|sed -e 's,///*,/,g'`
 +-            { $as_echo "$as_me:$LINENO: result: $ALSA_LIBS" >&5
 +-$as_echo "$ALSA_LIBS" >&6; }
 +-        else
 +-            { $as_echo "$as_me:$LINENO: result: no" >&5
 +-$as_echo "no" >&6; }
 +-            ALSA_CFLAGS=""
 +-            ALSA_LIBS=""
 +-            ## If we have a custom action on failure, don't print errors, but
 +-            ## do set a variable so people can do so.
 +-            ALSA_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$ALSA_MODULES"`
 +-
 +-        fi
 +-
 +-
 +-
 +-     else
 +-        echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
 +-        echo "*** See http://www.freedesktop.org/software/pkgconfig"
 +-     fi
 +-  fi
 +-
 +-  if test $succeeded = yes; then
 +-     HAVE_ALSA=yes
 +-  else
 +-     HAVE_ALSA=no
 +-  fi
 +-
 +-  if test $HAVE_ALSA = yes; then
 +-    SAVE_CFLAGS="$CFLAGS"
 +-    SAVE_LDFLAGS="$LDFLAGS"
 +-    CFLAGS="$ALSA_CFLAGS $CFLAGS"
 +-    LDFLAGS="$ALSA_LIBS $LDFLAGS"
 +-    cat >conftest.$ac_ext <<_ACEOF
 +-/* confdefs.h.  */
 +-_ACEOF
 +-cat confdefs.h >>conftest.$ac_ext
 +-cat >>conftest.$ac_ext <<_ACEOF
 +-/* end confdefs.h.  */
 +-#include <asoundlib.h>
 +-int
 +-main ()
 +-{
 +-snd_lib_error_set_handler (0);
 +-  ;
 +-  return 0;
 +-}
 +-_ACEOF
 +-rm -f conftest.$ac_objext
 +-if { (ac_try="$ac_compile"
 +-case "(($ac_try" in
 +-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
 +-  *) ac_try_echo=$ac_try;;
 +-esac
 +-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
 +-$as_echo "$ac_try_echo") >&5
 +-  (eval "$ac_compile") 2>conftest.er1
 +-  ac_status=$?
 +-  grep -v '^ *+' conftest.er1 >conftest.err
 +-  rm -f conftest.er1
 +-  cat conftest.err >&5
 +-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
 +-  (exit $ac_status); } && {
 +-	 test -z "$ac_c_werror_flag" ||
 +-	 test ! -s conftest.err
 +-       } && test -s conftest.$ac_objext; then
 +-  emacs_alsa_normal=yes
 +-else
 +-  $as_echo "$as_me: failed program was:" >&5
 +-sed 's/^/| /' conftest.$ac_ext >&5
 +-
 +-	emacs_alsa_normal=no
 +-fi
 +-
 +-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 +-    if test "$emacs_alsa_normal" != yes; then
 +-      cat >conftest.$ac_ext <<_ACEOF
 +-/* confdefs.h.  */
 +-_ACEOF
 +-cat confdefs.h >>conftest.$ac_ext
 +-cat >>conftest.$ac_ext <<_ACEOF
 +-/* end confdefs.h.  */
 +-#include <alsa/asoundlib.h>
 +-int
 +-main ()
 +-{
 +-snd_lib_error_set_handler (0);
 +-  ;
 +-  return 0;
 +-}
 +-_ACEOF
 +-rm -f conftest.$ac_objext
 +-if { (ac_try="$ac_compile"
 +-case "(($ac_try" in
 +-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
 +-  *) ac_try_echo=$ac_try;;
 +-esac
 +-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
 +-$as_echo "$ac_try_echo") >&5
 +-  (eval "$ac_compile") 2>conftest.er1
 +-  ac_status=$?
 +-  grep -v '^ *+' conftest.er1 >conftest.err
 +-  rm -f conftest.er1
 +-  cat conftest.err >&5
 +-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
 +-  (exit $ac_status); } && {
 +-	 test -z "$ac_c_werror_flag" ||
 +-	 test ! -s conftest.err
 +-       } && test -s conftest.$ac_objext; then
 +-  emacs_alsa_subdir=yes
 +-else
 +-  $as_echo "$as_me: failed program was:" >&5
 +-sed 's/^/| /' conftest.$ac_ext >&5
 +-
 +-	emacs_alsa_subdir=no
 +-fi
 +-
 +-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 +-      if test "$emacs_alsa_subdir" != yes; then
 +-        { { $as_echo "$as_me:$LINENO: error: pkg-config found alsa, but it does not compile.  See config.log for error messages." >&5
 +-$as_echo "$as_me: error: pkg-config found alsa, but it does not compile.  See config.log for error messages." >&2;}
 +-   { (exit 1); exit 1; }; }
 +-      fi
 +-      ALSA_CFLAGS="$ALSA_CFLAGS -DALSA_SUBDIR_INCLUDE"
 +-    fi
 +-
 +-    CFLAGS="$SAVE_CFLAGS"
 +-    LDFLAGS="$SAVE_LDFLAGS"
 +-    LIBSOUND="$LIBSOUND $ALSA_LIBS"
 +-    CFLAGS_SOUND="$CFLAGS_SOUND $ALSA_CFLAGS"
 +-
 +-cat >>confdefs.h <<\_ACEOF
 +-#define HAVE_ALSA 1
 +-_ACEOF
 +-
 +-  fi
 +-
 +-fi
 +-
 +-
 +-
 +-
 +-
 + 
 + 
 + 
 +@@ -20694,7 +20486,7 @@
 +   $as_echo_n "(cached) " >&6
 + else
 +   ac_check_lib_save_LIBS=$LIBS
 +-LIBS="-lintl  $LIBS"
 ++#LIBS="-lintl  $LIBS"
 + cat >conftest.$ac_ext <<_ACEOF
 + /* confdefs.h.  */
 + _ACEOF
 +@@ -20758,7 +20550,7 @@
 + #define HAVE_STRFTIME 1
 + _ACEOF
 + 
 +-LIBS="-lintl $LIBS"
 ++#LIBS="-lintl $LIBS"
 + fi
 + 
 + fi
 +@@ -23660,83 +23452,6 @@
 + 
 + fi
 + 
 +-# Solaris requires -lintl if you want strerror (which calls dgettext)
 +-# to return localized messages.
 +-
 +-{ $as_echo "$as_me:$LINENO: checking for dgettext in -lintl" >&5
 +-$as_echo_n "checking for dgettext in -lintl... " >&6; }
 +-if test "${ac_cv_lib_intl_dgettext+set}" = set; then
 +-  $as_echo_n "(cached) " >&6
 +-else
 +-  ac_check_lib_save_LIBS=$LIBS
 +-LIBS="-lintl  $LIBS"
 +-cat >conftest.$ac_ext <<_ACEOF
 +-/* confdefs.h.  */
 +-_ACEOF
 +-cat confdefs.h >>conftest.$ac_ext
 +-cat >>conftest.$ac_ext <<_ACEOF
 +-/* end confdefs.h.  */
 +-
 +-/* Override any GCC internal prototype to avoid an error.
 +-   Use char because int might match the return type of a GCC
 +-   builtin and then its argument prototype would still apply.  */
 +-#ifdef __cplusplus
 +-extern "C"
 +-#endif
 +-char dgettext ();
 +-int
 +-main ()
 +-{
 +-return dgettext ();
 +-  ;
 +-  return 0;
 +-}
 +-_ACEOF
 +-rm -f conftest.$ac_objext conftest$ac_exeext
 +-if { (ac_try="$ac_link"
 +-case "(($ac_try" in
 +-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
 +-  *) ac_try_echo=$ac_try;;
 +-esac
 +-eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\""
 +-$as_echo "$ac_try_echo") >&5
 +-  (eval "$ac_link") 2>conftest.er1
 +-  ac_status=$?
 +-  grep -v '^ *+' conftest.er1 >conftest.err
 +-  rm -f conftest.er1
 +-  cat conftest.err >&5
 +-  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
 +-  (exit $ac_status); } && {
 +-	 test -z "$ac_c_werror_flag" ||
 +-	 test ! -s conftest.err
 +-       } && test -s conftest$ac_exeext && {
 +-	 test "$cross_compiling" = yes ||
 +-	 $as_test_x conftest$ac_exeext
 +-       }; then
 +-  ac_cv_lib_intl_dgettext=yes
 +-else
 +-  $as_echo "$as_me: failed program was:" >&5
 +-sed 's/^/| /' conftest.$ac_ext >&5
 +-
 +-	ac_cv_lib_intl_dgettext=no
 +-fi
 +-
 +-rm -rf conftest.dSYM
 +-rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
 +-      conftest$ac_exeext conftest.$ac_ext
 +-LIBS=$ac_check_lib_save_LIBS
 +-fi
 +-{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_intl_dgettext" >&5
 +-$as_echo "$ac_cv_lib_intl_dgettext" >&6; }
 +-if test $ac_cv_lib_intl_dgettext = yes; then
 +-  cat >>confdefs.h <<_ACEOF
 +-#define HAVE_LIBINTL 1
 +-_ACEOF
 +-
 +-  LIBS="-lintl $LIBS"
 +-
 +-fi
 +-
 + 
 + { $as_echo "$as_me:$LINENO: checking whether localtime caches TZ" >&5
 + $as_echo_n "checking whether localtime caches TZ... " >&6; }
 
 --=-=-=--



More information about the freebsd-ports-bugs mailing list