Bug 176929 - port accessibility/gnome-speech build fails
Summary: port accessibility/gnome-speech build fails
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: freebsd-gnome (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-03-14 00:10 UTC by Chris Torek
Modified: 2013-03-14 07:10 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Torek 2013-03-14 00:10:00 UTC
	(note: I wasn't sure if this was an "update" or "sw-bug", I
	picked "update" since I have attached a patch)

	Using portmaster to (re)build accessibility/gnome-speech,
	or going in and manually running a "make", eventually runs
	into:

	gmake[3]: Entering directory `/usr/ports/accessibility/gnome-speech/work/gnome-speech-0.4.25/drivers/espeak'
	cc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../.. -I../../gnome-speech -I/usr/local/include/libbonobo-2.0 -I/usr/local/include/bonobo-activation-2.0 -I/usr/local/include/orbit-2.0 -DORBIT2=1 -pthread -I/usr/local/include/glib-2.0 -I/usr/local/include   -Wall -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wno-sign-compare  -I/usr/local/include/espeak  -I/usr/local/include  -O2 -pipe -fno-strict-aliasing -MT espeaksynthesisdriver.o -MD -MP -MF .deps/espeaksynthesisdriver.Tpo -c -o espeaksynthesisdriver.o espeaksynthesisdriver.c
	In file included from espeaksynthesisdriver.c:31:
	/usr/local/include/glib-2.0/glib/gmain.h:21:2: error: #error "Only <glib.h> can be included directly."
	In file included from espeaksynthesisdriver.h:32,
			 from espeaksynthesisdriver.c:34:
	/usr/local/include/glib-2.0/glib/gthread.h:28:2: error: #error "Only <glib.h> can be included directly."
	In file included from espeakspeaker.h:37,
			 from espeaksynthesisdriver.h:35,
			 from espeaksynthesisdriver.c:34:
	/usr/local/include/glib-2.0/glib/gthread.h:28:2: error: #error "Only <glib.h> can be included directly."
	espeaksynthesisdriver.c: In function 'espeak_synthesis_driver_init':
	espeaksynthesisdriver.c:382: warning: 'g_mutex_new' is deprecated (declared at /usr/local/include/glib-2.0/glib/deprecated/gthread.h:272)
	espeaksynthesisdriver.c: In function 'main':
	espeaksynthesisdriver.c:494: warning: 'g_thread_init' is deprecated (declared at /usr/local/include/glib-2.0/glib/deprecated/gthread.h:260)
	gmake[3]: *** [espeaksynthesisdriver.o] Error 1
	gmake[3]: Leaving directory `/usr/ports/accessibility/gnome-speech/work/gnome-speech-0.4.25/drivers/espeak'
	gmake[2]: *** [all-recursive] Error 1
	gmake[2]: Leaving directory `/usr/ports/accessibility/gnome-speech/work/gnome-speech-0.4.25/drivers'
	gmake[1]: *** [all-recursive] Error 1
	gmake[1]: Leaving directory `/usr/ports/accessibility/gnome-speech/work/gnome-speech-0.4.25'
	gmake: *** [all] Error 2
	*** [do-build] Error code 1

Fix: 

Someone more familiar with gnome headers should make sure
        this is really OK, but it seemed simplest to just turn
        each "don't include this directly, include glib.h instead"
        error into "#include <glib.h>", which seems to work.

[text below goes into files/patch-espeak, or whatever you choose to
call it]

--- drivers/espeak/espeakspeaker.c.orig
+++ drivers/espeak/espeakspeaker.c
@@ -27,5 +27,5 @@
 #include <string.h>
 #include <libbonobo.h>
-#include <glib/gmain.h>
+#include <glib.h>
 #include <gnome-speech/gnome-speech.h>
 #include <speak_lib.h>

--- drivers/espeak/espeakspeaker.h.orig
+++ drivers/espeak/espeakspeaker.h
@@ -35,5 +35,5 @@
 
 #include <bonobo/bonobo-object.h>
-#include <glib/gthread.h>
+#include <glib.h>
 #include <speak_lib.h>
 #include <gnome-speech/gnome-speech.h>

--- drivers/espeak/espeaksynthesisdriver.c.orig
+++ drivers/espeak/espeaksynthesisdriver.c
@@ -29,5 +29,4 @@
 #include <libbonobo.h>
 #include <glib.h>
-#include <glib/gmain.h>
 #include <speak_lib.h>
 #include <gnome-speech/gnome-speech.h>

--- drivers/espeak/espeaksynthesisdriver.h.orig
+++ drivers/espeak/espeaksynthesisdriver.h
@@ -30,5 +30,5 @@
 
 #include <bonobo/bonobo-object.h>
-#include <glib/gthread.h>
+#include <glib.h>
 #include <gnome-speech/gnome-speech.h>
 #include <speak_lib.h>
How-To-Repeat: 	In my case it started with using portmaster to rebuild
	things that were using pcre, but:

	# portmaster accessibility/gnome-speech

	should suffice.

        (I have no idea what added gnome-speech along the way
        either, I was just rebuilding "stuff" and taking care of
        failures.)
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2013-03-14 00:10:08 UTC
Responsible Changed
From-To: freebsd-ports-bugs->gnome

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 dfilter service freebsd_committer freebsd_triage 2013-03-14 07:06:08 UTC
Author: kwm
Date: Thu Mar 14 07:05:55 2013
New Revision: 314134
URL: http://svnweb.freebsd.org/changeset/ports/314134

Log:
  Fix build with glib 2.34 when optional dependancy is enabled. [1]
  
  While here, us USES=pathfix instead of gnomehack and convert to OptionsNG.
  
  PR:		ports/176929 [1]
  Submitted by:	Chris Torek <torek@torek.net>

Modified:
  head/accessibility/gnome-speech/Makefile

Modified: head/accessibility/gnome-speech/Makefile
==============================================================================
--- head/accessibility/gnome-speech/Makefile	Thu Mar 14 06:32:04 2013	(r314133)
+++ head/accessibility/gnome-speech/Makefile	Thu Mar 14 07:05:55 2013	(r314134)
@@ -1,10 +1,6 @@
-# New ports collection makefile for:	gnomespeech
-# Date created:			11 May 2003
-# Whom:				Joe Marcus Clarke <marcus@FreeBSD.org>
-#
+# Created by: Joe Marcus Clarke <marcus@FreeBSD.org>
 # $FreeBSD$
 #   $MCom: ports/accessibility/gnome-speech/Makefile,v 1.21 2006/08/22 00:55:57 ahze Exp $
-#
 
 PORTNAME=	gnome-speech
 PORTVERSION=	0.4.25
@@ -17,37 +13,42 @@ COMMENT=	GNOME text-to-speech API
 
 USE_BZIP2=	yes
 USE_GMAKE=	yes
-USE_GNOME=	gnomehack gnomeprefix libbonobo
-GNU_CONFIGURE=  yes
+USE_GNOME=	gnomeprefix libbonobo
+USES=		pathfix
+GNU_CONFIGURE=	yes
 USE_LDCONFIG=	yes
 CONFIGURE_ARGS=	--enable-static
 CPPFLAGS+=	-I${LOCALBASE}/include
 LDFLAGS+=	-L${LOCALBASE}/lib
 
-.include <bsd.port.pre.mk>
+OPTIONS_DEFINE=	ESPEAK FESTIVAL
+ESPEAK_DESC=	Espeak speech synthesizer support
+FESTIVAL_DESC=	Festival speech synthesis support
 
-.if exists(${LOCALBASE}/lib/libespeak.so)
-WITH_ESPEAK=	yes
-.endif
-
-.if exists(${LOCALBASE}/bin/festival)
-WITH_FESTIVAL=	yes
-.endif
+.include <bsd.port.options.mk>
 
-.if defined(WITH_ESPEAK)
-LIB_DEPENDS+=	espeak.1:${PORTSDIR}/audio/espeak
+.if ${PORT_OPTIONS:MESPEAK}
+LIB_DEPENDS+=	espeak:${PORTSDIR}/audio/espeak
 CONFIGURE_ARGS+=--with-espeak-dir=${LOCALBASE}
 PLIST_SUB+=	ESPEAK:=""
 .else
 PLIST_SUB+=	ESPEAK:="@comment "
 .endif
 
-.if defined(WITH_FESTIVAL)
+.if ${PORT_OPTIONS:MFESTIVAL}
 RUN_DEPENDS+=	festival:${PORTSDIR}/audio/festival
 .endif
 
 post-patch:
 	@${REINPLACE_CMD} -e 's|== x|= x|g' \
 		${WRKSRC}/configure
+	@${REINPLACE_CMD} -e 's|glib/.*\.h>|glib.h>|g' \
+		${WRKSRC}/drivers/swift/*.[ch] \
+		${WRKSRC}/drivers/dectalk/*.[ch] \
+		${WRKSRC}/drivers/theta/*.[ch] \
+		${WRKSRC}/drivers/eloquence/*.[ch] \
+		${WRKSRC}/drivers/viavoice/*.[ch] \
+		${WRKSRC}/drivers/loquendo/*.[ch] \
+		${WRKSRC}/drivers/espeak/*.[ch]
 
-.include <bsd.port.post.mk>
+.include <bsd.port.mk>
_______________________________________________
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 Koop Mast freebsd_committer freebsd_triage 2013-03-14 07:07:11 UTC
State Changed
From-To: open->closed

Committed thanks!