Bug 201926 - [patch] games/iourbanterror: error: conflicting types for 'speex_bits_read_from'
Summary: [patch] games/iourbanterror: error: conflicting types for 'speex_bits_read_f...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords: needs-qa, patch
Depends on:
Blocks:
 
Reported: 2015-07-27 16:34 UTC by O. Hartmann
Modified: 2015-10-29 10:23 UTC (History)
3 users (show)

See Also:
bugzilla: maintainer-feedback? (kamikaze)


Attachments
Patch for games/iourbanterror on CURRENT and most recent ports/tree (1.41 KB, text/plain)
2015-07-27 16:34 UTC, O. Hartmann
no flags Details
Fix include order for bundled libspee (1.08 KB, patch)
2015-09-28 17:31 UTC, Roman Bogorodskiy
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description O. Hartmann 2015-07-27 16:34:06 UTC
Created attachment 159309 [details]
Patch for games/iourbanterror on CURRENT and most recent ports/tree

On FreeBSD CURRENT (FreeBSD 11.0-CURRENT #12 r285890: Sun Jul 26 13:26:39 CEST 2015 amd64) and most recent ports/tree (Rev: 392988) games/iourbanterror rejects to compile due to an interface mismatch  in code/libspeex/bits.c with most recent port's libspeex installed:

[...]
CC code/libspeex/bits.c
code/libspeex/bits.c:109:6: error: conflicting types for 'speex_bits_read_from'
void speex_bits_read_from(SpeexBits *bits, char *chars, int len)
     ^
/usr/local/include/speex/speex_bits.h:80:6: note: previous declaration is here
void speex_bits_read_from(SpeexBits *bits, const char *bytes, int len);
     ^
code/libspeex/bits.c:156:6: error: conflicting types for 'speex_bits_read_whole_bytes'
void speex_bits_read_whole_bytes(SpeexBits *bits, char *chars, int nbytes)
     ^
/usr/local/include/speex/speex_bits.h:88:6: note: previous declaration is here
void speex_bits_read_whole_bytes(SpeexBits *bits, const char *bytes, int len);
     ^
2 errors generated.
[...]

The problem can be (syntactically) simply solved by the attached patchfile, which adjusts the call of the speex routines in question to the definitions given by the speex library.
Comment 1 Roman Bogorodskiy freebsd_committer freebsd_triage 2015-09-28 17:11:57 UTC
I'm not sure this patch solves the root of the problem.

iourbanterror doesn't seem to depend on speex at all, it ships bundled libspeex and tries to build it. The problem occurs when speex is installed on the system and its headers are used instead of a bundled speex's.

cc  -O2 -pipe  -fstack-protector -fno-strict-aliasing -MMD      -O2 -pipe  -fstack-protector -fno-strict-aliasing   -Wall -fno-strict-aliasing -Wimplicit -Wstrict-prototypes -DHOMEPATH=\"/.ioUrbanTerror\" -DDEFAULT_LIBDIR=\"/usr/local/lib/iourbanterror\" -DUSE_ICON -DMAP_ANONYMOUS=MAP_ANON -I/usr/local/include/SDL -I/usr/local/include  -D_REENTRANT -D_THREAD_SAFE   -DUSE_CURL -I/usr/local/include   -DUSE_CODEC_VORBIS -I/usr/local/include   -DUSE_MUMBLE -DUSE_VOIP -DFLOATING_POINT -DUSE_ALLOCA -Icode/libspeex/include -DDEFAULT_BASEDIR=\"/usr/local/share/quake3\" -DSTANDALONE -DPRODUCT_VERSION=\"1.36+4.2.018\" -o build/release-freebsd-amd64/client/buffer.o -c code/libspeex/buffer.c
code/libspeex/bits.c:109:6: error: conflicting types for 'speex_bits_read_from'
void speex_bits_read_from(SpeexBits *bits, char *chars, int len)
     ^


If you take a look at the "-I"s in CFLAGS you'll see that /usr/local/include comes before code/libspeex/include. I think the proper fix would be to make build system pass -Icode/libspeex/include before -I/usr/local/include to make it use right header files.
Comment 2 Roman Bogorodskiy freebsd_committer freebsd_triage 2015-09-28 17:31:55 UTC
Created attachment 161502 [details]
Fix include order for bundled libspee

Could you please try this patch? It's for master port, ioquake3, and it fixes problem for me for iourbanterror.
Comment 3 commit-hook freebsd_committer freebsd_triage 2015-09-30 15:18:42 UTC
A commit references this bug:

Author: novel
Date: Wed Sep 30 15:18:07 UTC 2015
New revision: 398218
URL: https://svnweb.freebsd.org/changeset/ports/398218

Log:
  Fix build when system libspeex is installed

  The build system uses incorrect include order and it picks system
  libspeex headers instead of bundled one so build fails because of
  the interface difference.

  Fix that by forcing including bundled libspeex. This also fixes
  build of iourbanterror build.

  PR:		201926

Changes:
  head/games/ioquake3/files/patch-Makefile
Comment 4 Mathieu Arnold freebsd_committer freebsd_triage 2015-10-29 10:23:27 UTC
This has been committed a month ago.