Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 650232 - games-fps/urbanterror-4.3.2: fails to build with undefined OF() macro with USE="server"
Summary: games-fps/urbanterror-4.3.2: fails to build with undefined OF() macro with US...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Nils Freydank
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-03-11 18:00 UTC by David
Modified: 2018-03-19 16:52 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log (games-fps:urbanterror-4.3.2_p20180218:20180311-171129.log,21.78 KB, text/plain)
2018-03-11 18:02 UTC, David
Details
emerge info (emerge-info.log,5.68 KB, text/x-log)
2018-03-11 18:04 UTC, David
Details
updated patch (urbanterror-4.3-fix-build_system.patch,2.71 KB, patch)
2018-03-19 11:36 UTC, Nils Freydank
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David 2018-03-11 18:00:15 UTC
Urbanterror 4.3.x fail to build with errors below (or full build.log attachement)

Reproducible: Always

Steps to Reproduce:
1. emerge games-fps/urbanterror
2.
3.
Actual Results:  
In file included from code/qcommon/unzip.h:57:0,
                 from code/qcommon/files.c:34:
code/qcommon/ioapi.h:38:44: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘OF’
 typedef voidpf (ZCALLBACK *open_file_func) OF((voidpf opaque, const char* filename, int mode));
                                            ^~
code/qcommon/ioapi.h:39:44: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘OF’
 typedef uLong  (ZCALLBACK *read_file_func) OF((voidpf opaque, voidpf stream, void* buf, uLong size));
                                            ^~
code/qcommon/ioapi.h:40:45: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘OF’
 typedef uLong  (ZCALLBACK *write_file_func) OF((voidpf opaque, voidpf stream, const void* buf, uLong size));
                                             ^~
code/qcommon/ioapi.h:41:44: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘OF’
 typedef long   (ZCALLBACK *tell_file_func) OF((voidpf opaque, voidpf stream));
                                            ^~
code/qcommon/ioapi.h:42:44: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘OF’
 typedef long   (ZCALLBACK *seek_file_func) OF((voidpf opaque, voidpf stream, uLong offset, int origin));
                                            ^~
code/qcommon/ioapi.h:43:45: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘OF’
 typedef int    (ZCALLBACK *close_file_func) OF((voidpf opaque, voidpf stream));
                                             ^~
code/qcommon/ioapi.h:44:49: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘OF’
 typedef int    (ZCALLBACK *testerror_file_func) OF((voidpf opaque, voidpf stream));
                                                 ^~
--


I see that the ebuild adds '-DOF=_Z_OF' as a cppflags, but we also need it for cflags.


Adding append-cflags "-DOF=_Z_OF" to src_compile() works fine for me.
Comment 1 David 2018-03-11 18:02:53 UTC
Created attachment 523526 [details]
build.log
Comment 2 David 2018-03-11 18:04:24 UTC
Created attachment 523528 [details]
emerge info
Comment 3 David 2018-03-11 18:49:18 UTC
In fact with GCC 6 we only need append-cflags "-DOF=_Z_OF"
Comment 4 Nils Freydank 2018-03-18 18:04:48 UTC
Hi, thanks for the report. I can't reproduce it though on my ~amd64 system (with gcc-6.4.0-r1 and your CFLAGS and USE flags). I’m setting up a complete stable system and will test there again.

Which version of zlib do you use? Do you apply any user patches (e.g. via /etc/portage/patches/)?

PS: cpp-flags are for the C preprocessor, not C++ flags. As far as I understood them they're (mostly) for "#include"s, and would be the correct place for the zlib flag here.
Comment 5 David 2018-03-18 18:47:46 UTC
I use sys-libs/zlib-1.2.11-r1 with minizip use flag which is a www-client/chromium requirement.

No user patches, except for gentoo-sources.

I was talking about GCC 6, because in my mind, the build failure has started after the upgrade of GCC but it's not clearly related.

I will try to re-build with zlib without minizip use flag.
Comment 6 David 2018-03-18 18:49:53 UTC
Nop It's not related to minizip as I see that urbanterror need the flag too.
Comment 7 Nils Freydank 2018-03-19 11:35:23 UTC
The bug actually depends on USE="server" as I overlooked the necessary parts of the Makefile. 

I added the neccessary lines to the Makefile patch.
Comment 8 Nils Freydank 2018-03-19 11:36:21 UTC
Created attachment 524382 [details, diff]
updated patch
Comment 9 Kolan Sh. 2018-03-19 11:40:16 UTC
> Adding append-cflags "-DOF=_Z_OF" to src_compile() works fine for me.

Thanks, David!
I added
append-cflags "-DOF=_Z_OF"
to the src_compile() and emerge is successfull now with USE="server".
Comment 10 James Le Cuirot gentoo-dev 2018-03-19 11:54:29 UTC
I've looked at the source. They've bundled their own fork of zlib's minizip and not kept it up to date. I don't know how different their fork is but it would be worth comparing the latest minizip against this. Look at unzip.c and unzip.h.
Comment 11 Larry the Git Cow gentoo-dev 2018-03-19 16:52:37 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d26453b62aa943abea979a8804dbcd0cfd54b4fb

commit d26453b62aa943abea979a8804dbcd0cfd54b4fb
Author:     Nils Freydank <holgersson@posteo.de>
AuthorDate: 2018-03-19 11:20:44 +0000
Commit:     Michał Górny <mgorny@gentoo.org>
CommitDate: 2018-03-19 16:52:26 +0000

    games-fps/urbanterror: Fix Makefile patch.
    
    Closes: https://bugs.gentoo.org/650232
    Closes: https://github.com/gentoo/gentoo/pull/7506
    Package-Manager: Portage-2.3.24, Repoman-2.3.6

 .../files/urbanterror-4.3-fix-build_system.patch   | 32 ++++++++++++++++++++--
 1 file changed, 29 insertions(+), 3 deletions(-)