From nobody@FreeBSD.org  Tue Feb 12 08:49:39 2013
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115])
	by hub.freebsd.org (Postfix) with ESMTP id 1532B4DA
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 12 Feb 2013 08:49:39 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id E9131DC9
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 12 Feb 2013 08:49:38 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.5/8.14.5) with ESMTP id r1C8ncS5065824
	for <freebsd-gnats-submit@FreeBSD.org>; Tue, 12 Feb 2013 08:49:38 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.5/8.14.5/Submit) id r1C8ncpN065823;
	Tue, 12 Feb 2013 08:49:38 GMT
	(envelope-from nobody)
Message-Id: <201302120849.r1C8ncpN065823@red.freebsd.org>
Date: Tue, 12 Feb 2013 08:49:38 GMT
From: Zeus Panchenko <zeus.panchenko@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: no sound support after building emacs port
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         176055
>Category:       ports
>Synopsis:       [patch] editors/emacs: no sound support
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    ashish
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Feb 12 08:50:01 UTC 2013
>Closed-Date:    Sun Feb 17 09:27:16 UTC 2013
>Last-Modified:  Sun Feb 17 09:27:16 UTC 2013
>Originator:     Zeus Panchenko
>Release:        9.1 amd64
>Organization:
>Environment:
FreeBSD 9.1-PRERELEASE #6 amd64
>Description:
ports/emacs while beed built with
OPTIONS_FILE_UNSET+=CANNA
OPTIONS_FILE_SET+=DBUS
OPTIONS_FILE_SET+=GCONF
OPTIONS_FILE_SET+=GIF
OPTIONS_FILE_SET+=GNUTLS
OPTIONS_FILE_UNSET+=GSETTINGS
OPTIONS_FILE_SET+=JPEG
OPTIONS_FILE_SET+=M17N
OPTIONS_FILE_SET+=MAGICK
OPTIONS_FILE_SET+=OTF
OPTIONS_FILE_SET+=PNG
OPTIONS_FILE_SET+=SCROLLBARS
OPTIONS_FILE_SET+=SOUND
OPTIONS_FILE_SET+=SOURCES
OPTIONS_FILE_UNSET+=SVG
OPTIONS_FILE_SET+=SYNC_INPUT
OPTIONS_FILE_UNSET+=TIFF
OPTIONS_FILE_SET+=XFT
OPTIONS_FILE_SET+=XIM
OPTIONS_FILE_SET+=XML
OPTIONS_FILE_SET+=XPM
OPTIONS_FILE_SET+=GTK2
OPTIONS_FILE_UNSET+=GTK3
OPTIONS_FILE_UNSET+=XAW
OPTIONS_FILE_UNSET+=XAW3D
OPTIONS_FILE_UNSET+=MOTIF

exposes lack of the sound support
while trying to play sound with `(play-sound-file "/path/to/file.wav")'
emacs complains with:
"This Emacs binary lacks sound support"
>How-To-Repeat:
just to build it and to try to play any sound file
>Fix:
this patch from dumbbell@ fixes the problem (amended patch-configure is attached):

--- patch-configure.orig	2013-02-02 09:50:49.669553126 +0200
+++ patch-configure	2013-02-11 16:18:07.253422611 +0200
@@ -1,9 +1,6 @@
-
-$FreeBSD: head/editors/emacs/files/patch-configure 301832 2012-08-01 15:20:25Z ashish $
-
---- configure.orig
-+++ configure
-@@ -8276,177 +8276,13 @@
+--- configure.orig	2012-08-23 08:37:10.000000000 +0200
++++ configure	2013-02-11 14:56:53.783037554 +0100
+@@ -8283,159 +8283,6 @@
    LIBSOUND=
  fi
  
@@ -160,20 +157,10 @@
 -
 -  fi
 -
--        if test x$have_sound_header = xyes || test $HAVE_ALSA = yes; then
--     case "$opsys" in
--              gnu-linux|freebsd|netbsd)
--
--$as_echo "#define HAVE_SOUND 1" >>confdefs.h
--
--         ;;
--     esac
--  fi
--
--
- fi
- 
- for ac_header in sys/select.h sys/time.h unistd.h utime.h \
+         if test x$have_sound_header = xyes || test $HAVE_ALSA = yes; then
+      case "$opsys" in
+               gnu-linux|freebsd|netbsd)
+@@ -8453,7 +8300,7 @@
    linux/version.h sys/systeminfo.h \
    stdio_ext.h fcntl.h coff.h pty.h sys/mman.h \
    sys/vlimit.h sys/resource.h locale.h sys/_mbstate_t.h \

Patch attached with submission follows:

--- configure.orig	2012-08-23 08:37:10.000000000 +0200
+++ configure	2013-02-11 14:56:53.783037554 +0100
@@ -8283,159 +8283,6 @@
   LIBSOUND=
 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:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_path_PKG_CONFIG+:} false; 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:${as_lineno-$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:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
-$as_echo "$PKG_CONFIG" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$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:${as_lineno-$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:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-            succeeded=yes
-
-            { $as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: result: $ALSA_CFLAGS" >&5
-$as_echo "$ALSA_CFLAGS" >&6; }
-
-            { $as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: result: $ALSA_LIBS" >&5
-$as_echo "$ALSA_LIBS" >&6; }
-        else
-            { $as_echo "$as_me:${as_lineno-$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_LIBS="$LIBS"
-    CFLAGS="$ALSA_CFLAGS $CFLAGS"
-    LIBS="$ALSA_LIBS $LIBS"
-    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <asoundlib.h>
-int
-main ()
-{
-snd_lib_error_set_handler (0);
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  emacs_alsa_normal=yes
-else
-  emacs_alsa_normal=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-    if test "$emacs_alsa_normal" != yes; then
-      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <alsa/asoundlib.h>
-int
-main ()
-{
-snd_lib_error_set_handler (0);
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  emacs_alsa_subdir=yes
-else
-  emacs_alsa_subdir=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-      if test "$emacs_alsa_subdir" != yes; then
-        as_fn_error $? "pkg-config found alsa, but it does not compile.  See config.log for error messages." "$LINENO" 5
-      fi
-      ALSA_CFLAGS="$ALSA_CFLAGS -DALSA_SUBDIR_INCLUDE"
-    fi
-
-    CFLAGS="$SAVE_CFLAGS"
-    LIBS="$SAVE_LIBS"
-    LIBSOUND="$LIBSOUND $ALSA_LIBS"
-    CFLAGS_SOUND="$CFLAGS_SOUND $ALSA_CFLAGS"
-
-$as_echo "#define HAVE_ALSA 1" >>confdefs.h
-
-  fi
-
         if test x$have_sound_header = xyes || test $HAVE_ALSA = yes; then
      case "$opsys" in
               gnu-linux|freebsd|netbsd)
@@ -8453,7 +8300,7 @@
   linux/version.h sys/systeminfo.h \
   stdio_ext.h fcntl.h coff.h pty.h sys/mman.h \
   sys/vlimit.h sys/resource.h locale.h sys/_mbstate_t.h \
-  sys/utsname.h pwd.h utmp.h dirent.h util.h
+  sys/utsname.h pwd.h utmp.h dirent.h util.h libutil.h
 do :
   as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->ashish 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Wed Feb 13 04:35:47 UTC 2013 
Responsible-Changed-Why:  
Over to maintainer (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=176055 

From: ashish@FreeBSD.org (Ashish SHUKLA)
To: bug-followup@FreeBSD.org,zeus.panchenko@gmail.com
Cc:  
Subject: Re: ports/176055: [patch] editors/emacs: no sound support
Date: Wed, 13 Feb 2013 19:13:08 +0530

 --=-=-=
 Content-Type: text/plain
 Content-Transfer-Encoding: quoted-printable
 
 Hi,
 
 Thanks for the diff. I'll go through it by this weekend.
 
 =2D-=20
 Ashish SHUKLA      | GPG: F682 CDCC 39DC 0FEA E116  20B6 C746 CFA9 E74F A4B0
 Sent from my Emacs
 
 --=-=-=
 Content-Type: application/pgp-signature
 
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.19 (FreeBSD)
 
 iQIcBAEBCgAGBQJRG5hxAAoJEMdGz6nnT6SwFJ4QAIj4Jbwy3bAtepYTzTWthvm+
 sXG7z8sn1vrM0wXVByNiDzidvkkZo+vRm4epPnjtlYaw24VXo/iNKZrCExtzEmD4
 e9bBIuDGsSIiunmZ2QQRq414ySXy43qkEqkHcDJWVvLe8i0Q4DHdaTzQDYSWjFMA
 1rd4kJuioZkiUeJGQKe29UJdzR5qaFmcu1qbzLlswynh6IKMSKxRPa4G85YW9dEQ
 atlbL3jKdZBJK/CG1WIZ2bH0KfX28VJVS8nxlExvZhAWLo9FCGV8U3yNY/27qoei
 HHDoyI1KjAEjwlMYiC0kMlc47A3JsTBuhJVaqG5BOwzngXNNhO8CdJnXxPM3eyLG
 234uFzSy8GnrF8OqtfObTPCDf45hJ7RU3p3ttF70iUbrjoFHR7HwpHuSkGZk/W2c
 1qrZwz6dCmsPurFzA8CMU6lCEp4T2HlVMe1u6ndKmbYTTzwDDIcv8us6Lg0yRKoj
 DjyL4URdM3DDweu3Y5Gi+bmCXnDvzm4DUX1/RWCi4MF4sgScFf2VVSn/bth8Mmn6
 qXOtlKWBn7c6iktYc+pXaao5czCY31zGf4PuMvWjN5QLCuTZX/KXs+B/7RM2C4Im
 yl9giKbxaidiq9Mhq5cjDyqY0nkMX0h8GQcm73lDuVEuNomnCzreAvoddzsZPDPc
 IlmLaIsedXASGuDgsf7C
 =T4hc
 -----END PGP SIGNATURE-----
 --=-=-=--

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/176055: commit references a PR
Date: Sun, 17 Feb 2013 09:17:49 +0000 (UTC)

 Author: ashish
 Date: Sun Feb 17 09:17:41 2013
 New Revision: 312406
 URL: http://svnweb.freebsd.org/changeset/ports/312406
 
 Log:
   - Fix SOUND support[1]
   - Make GSETTINGS option depend on DBUS option, as GSettings requires
     DBus to be functional[2]
   - Remove ABI versions from LIB_DEPENDS
   
   PR:		ports/176055[1], ports/175990[2]
   Submitted by:	Zeus Panchenko <zeus.panchenko at gmail.com>[1],
   		Fabian Keil <fk at fabiankeil.de>[2]
 
 Modified:
   head/editors/emacs/Makefile
   head/editors/emacs/files/patch-configure
 
 Modified: head/editors/emacs/Makefile
 ==============================================================================
 --- head/editors/emacs/Makefile	Sun Feb 17 08:43:16 2013	(r312405)
 +++ head/editors/emacs/Makefile	Sun Feb 17 09:17:41 2013	(r312406)
 @@ -60,7 +60,7 @@ OPTIONS_DEFINE=	CANNA DBUS GCONF GIF JPE
  OPTIONS_SINGLE=	X11TOOLKIT
  
  CANNA_DESC=		Canna support
 -GSETTINGS_DESC=		GSettings support
 +GSETTINGS_DESC=		GSettings support (requires DBUS)
  SCROLLBARS_DESC=	Toolkit scroll-bars
  SOUND_DESC=		Sound support
  SOURCES_DESC=		Install sources
 @@ -89,7 +89,7 @@ PATCH_DIST_STRIP=	-p1
  CONFIGURE_ARGS+=	--with-canna \
  			--with-canna-includes=${LOCALBASE}/include \
  			--with-canna-libraries=${LOCALBASE}/lib
 -LIB_DEPENDS+=		canna.1:${PORTSDIR}/japanese/canna-lib
 +LIB_DEPENDS+=		canna:${PORTSDIR}/japanese/canna-lib
  .endif
  
  .if defined(WITHOUT_X11)
 @@ -111,7 +111,7 @@ CONFIGURE_ARGS+=	--with-x-toolkit=gtk
  USE_GNOME+=	gtk30
  CONFIGURE_ARGS+=	--with-x-toolkit=gtk3
  .elif ${PORT_OPTIONS:MXAW3D}
 -LIB_DEPENDS+=	Xaw3d.${XAWVER}:${PORTSDIR}/x11-toolkits/Xaw3d
 +LIB_DEPENDS+=	Xaw3d:${PORTSDIR}/x11-toolkits/Xaw3d
  CONFIGURE_ARGS+=	--with-x-toolkit=athena
  .elif ${PORT_OPTIONS:MXAW}
  USE_XORG=	xaw
 @@ -130,19 +130,19 @@ CONFIGURE_ARGS+=	--without-sync-input
  .endif
  
  .if ${PORT_OPTIONS:MJPEG}
 -LIB_DEPENDS+=	jpeg.11:${PORTSDIR}/graphics/jpeg
 +LIB_DEPENDS+=	jpeg:${PORTSDIR}/graphics/jpeg
  .else
  CONFIGURE_ARGS+=	--without-jpeg
  .endif
  
  .if ${PORT_OPTIONS:MTIFF}
 -LIB_DEPENDS+=	tiff.4:${PORTSDIR}/graphics/tiff
 +LIB_DEPENDS+=	tiff:${PORTSDIR}/graphics/tiff
  .else
  CONFIGURE_ARGS+=	--without-tiff
  .endif
  
  .if ${PORT_OPTIONS:MGIF}
 -LIB_DEPENDS+=   gif.5:${PORTSDIR}/graphics/giflib
 +LIB_DEPENDS+=   gif:${PORTSDIR}/graphics/giflib
  .else
  CONFIGURE_ARGS+=	--without-gif
  .endif
 @@ -161,17 +161,17 @@ CONFIGURE_ARGS+=	--without-xpm
  
  .if ${PORT_OPTIONS:MXFT}
  USE_XORG+=	xft
 -LIB_DEPENDS+=	freetype.9:${PORTSDIR}/print/freetype2
 +LIB_DEPENDS+=	freetype:${PORTSDIR}/print/freetype2
  CONFIGURE_ARGS+=	--with-xft
  .if ${PORT_OPTIONS:MM17N}
  CONFIGURE_ARGS+=	--with-m17n-flt
 -LIB_DEPENDS+=	m17n.4:${PORTSDIR}/devel/m17n-lib
 +LIB_DEPENDS+=	m17n:${PORTSDIR}/devel/m17n-lib
  .else
  CONFIGURE_ARGS+=	--without-m17n-flt
  .endif
  .if ${PORT_OPTIONS:MOTF}
  CONFIGURE_ARGS+=	--with-otf
 -LIB_DEPENDS+=	otf.0:${PORTSDIR}/print/libotf
 +LIB_DEPENDS+=	otf:${PORTSDIR}/print/libotf
  .else
  CONFIGURE_ARGS+=	--without-libotf
  .endif
 @@ -221,10 +221,13 @@ CONFIGURE_ARGS+=	--without-sound
  .endif
  
  .if ${PORT_OPTIONS:MDBUS}
 -LIB_DEPENDS+=	dbus-1.3:${PORTSDIR}/devel/dbus
 +LIB_DEPENDS+=	dbus-1:${PORTSDIR}/devel/dbus
  CONFIGURE_ARGS+=	--with-dbus
  .else
  CONFIGURE_ARGS+=	--without-dbus
 +.if ${PORT_OPTIONS:MGSETTINGS}
 +IGNORE=	GSettings support requires DBUS. Please run 'make config'
 +.endif
  .endif
  
  .if ${PORT_OPTIONS:MXML}
 @@ -235,7 +238,7 @@ CONFIGURE_ARGS+=	--without-xml2
  .endif
  
  .if ${PORT_OPTIONS:MGNUTLS}
 -LIB_DEPENDS+=		gnutls.26:${PORTSDIR}/security/gnutls
 +LIB_DEPENDS+=		gnutls:${PORTSDIR}/security/gnutls
  CONFIGURE_ARGS+=	--with-gnutls
  .else
  CONFIGURE_ARGS+=	--without-gnutls
 
 Modified: head/editors/emacs/files/patch-configure
 ==============================================================================
 --- head/editors/emacs/files/patch-configure	Sun Feb 17 08:43:16 2013	(r312405)
 +++ head/editors/emacs/files/patch-configure	Sun Feb 17 09:17:41 2013	(r312406)
 @@ -3,7 +3,7 @@ $FreeBSD$
  
  --- configure.orig
  +++ configure
 -@@ -8276,177 +8276,13 @@
 +@@ -8283,159 +8283,6 @@
     LIBSOUND=
   fi
   
 @@ -160,20 +160,10 @@ $FreeBSD$
  -
  -  fi
  -
 --        if test x$have_sound_header = xyes || test $HAVE_ALSA = yes; then
 --     case "$opsys" in
 --              gnu-linux|freebsd|netbsd)
 --
 --$as_echo "#define HAVE_SOUND 1" >>confdefs.h
 --
 --         ;;
 --     esac
 --  fi
 --
 --
 - fi
 - 
 - for ac_header in sys/select.h sys/time.h unistd.h utime.h \
 +         if test x$have_sound_header = xyes || test $HAVE_ALSA = yes; then
 +      case "$opsys" in
 +               gnu-linux|freebsd|netbsd)
 +@@ -8453,7 +8300,7 @@
     linux/version.h sys/systeminfo.h \
     stdio_ext.h fcntl.h coff.h pty.h sys/mman.h \
     sys/vlimit.h sys/resource.h locale.h sys/_mbstate_t.h \
 _______________________________________________
 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"
 
State-Changed-From-To: open->closed 
State-Changed-By: ashish 
State-Changed-When: Sun Feb 17 09:27:15 UTC 2013 
State-Changed-Why:  
Committed. Thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=176055 
>Unformatted:
