Bug 204125

Summary: multimedia/xawtv: Fails to build on fresh ports
Product: Ports & Packages Reporter: Dmitry Afanasiev <KOT>
Component: Individual Port(s)Assignee: Oliver Lehmann <oliver>
Status: Closed FIXED    
Severity: Affects Some People Keywords: needs-qa
Priority: --- Flags: koobs: maintainer-feedback+
Version: Latest   
Hardware: Any   
OS: Any   

Description Dmitry Afanasiev 2015-10-29 15:00:59 UTC
multimedia/xawtv fails to build on ports r399880:
===>  Building for xawtv-3.103_2
gmake[2]: Entering directory '/var/ports/usr/ports/multimedia/xawtv/work/xawtv-3.103'
cc -O2 -pipe -march=k8-sse3 -DLIBICONV_PLUG -DMMX=1 -fstack-protector -fno-strict-aliasing -O2 -pipe -march=k8-sse3 -DLIBICONV_PLUG -DMMX=1 -fstack-protector -fno-strict-aliasing -I/usr/local/include -L/usr/local/lib -I/usr/include/ncursesw -Wall -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith -Wno-pointer-sign -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/local/include -I/usr/local/include -D_THREAD_SAFE -I/usr/local/include/freetype2 -I/usr/local/include/libpng16 -I/usr/include/X11/fonts -I. -I./vbistuff -I./x11 -I./jwz -I./common -I./console -I./x11 -I./structs -I./libng -Llibng -DCONFIGFILE="/etc/X11/xawtvrc" -DLIBDIR="/usr/local/lib/xawtv" -DDATADIR="/usr/local/share/xawtv" -DVERSION="3.103" -fPIC -Wp,-MD,mk/x11_xt.tmp -c -o x11/xt.o x11/xt.c
cc: warning: argument unused during compilation: '-L/usr/local/lib'
cc: warning: argument unused during compilation: '-Llibng'
x11/xt.c:2162:17: error: too many arguments to function call, expected 0, have 1
        ~~~~~~~~~~~~~~ ^~~~~~~~~
/usr/local/include/event2/event_compat.h:86:1: note: 'event_dispatch' declared
int event_dispatch(void);
1 error generated.
mk/Compile.mk:54: recipe for target 'x11/xt.o' failed
gmake[2]: *** [x11/xt.o] Error 1
gmake[2]: Leaving directory '/var/ports/usr/ports/multimedia/xawtv/work/xawtv-3.103'
*** Error code 1

make[1]: stopped in /usr/ports/multimedia/xawtv
*** Error code 1

make: stopped in /usr/ports/multimedia/xawtv

I building ports with this options:
===> The following configuration options are available for xawtv-3.103_2:
     AALIB=off: AAlib graphics library support
     DV=off: Quasar DV video codec support (libdv)
     MMX=on: Use MMX optimized routines
     QUICKTIME=off: QuickTime media support
     ZVBI=off: Enable libzvbi support
===> Use 'make config' to modify these settings

MMX option can be turned off without any effect.
Comment 1 Oliver Lehmann freebsd_committer 2015-10-30 06:40:57 UTC
Please check which port installs /usr/local/include/event2/event_compat.h multimedia/xawtv has obviously problems with it as it does not pick up its own event_compat.h for  compiling but the file installed by the other port.
Comment 2 Kubilay Kocak freebsd_committer freebsd_triage 2015-10-30 06:50:10 UTC
@Oliver, please set maintainer-feedback to + when you respond to an issue, this way it wont feedback timeout. Treat it as:

? = Provide feedback / Feedback requested
+ = Have given/provided feedback
- = Maintainer has not provided feedback (will be used for maintainer timeout)

Additionally, in terms of a port using bundles libraries or not, all ports must use system provided libraries ({LIB,RUN,BUILD}_DEPEND'ing on their respective ports), so it's worth looking down that path

I also note the following warning:

cc: warning: argument unused during compilation: '-Llibng'

Is this a typo? Is it supposed to be libpng?

event_compat.h will be provided by either the libevent or libevent2 ports, which many other ports/packages dependent on independently.
Comment 3 Oliver Lehmann freebsd_committer 2015-10-30 10:17:29 UTC
It is not that the port has it's own private copy ob libevent(2) - it is just that it has an implementation of a function with the same name - "event_dispatch" which conflicts with the function provided by libevent(2).
Obviously, libevents include files are found in the before xawtv's own files.

-I/usr/local/include appears prior to -I./common where event.h is located
Comment 4 commit-hook freebsd_committer 2015-10-30 12:42:00 UTC
A commit references this bug:

Author: oliver
Date: Fri Oct 30 12:41:06 UTC 2015
New revision: 400536
URL: https://svnweb.freebsd.org/changeset/ports/400536

  Fix include path to pick u?p local headers first instead of LOCALBASE stuff.
  This fixes a header conflict with libevent2

  PR:		204125
  Submitted by:	KOT@MATPOCKuH.Ru