Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 385569 - dev-lang/swi-prolog with USE=zlib fails to build with zlib-1.2.5.1-r1 and up
Summary: dev-lang/swi-prolog with USE=zlib fails to build with zlib-1.2.5.1-r1 and up
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Prolog project
URL:
Whiteboard:
Keywords: PATCH
Depends on: 383179
Blocks:
  Show dependency tree
 
Reported: 2011-10-04 05:17 UTC by Maks Verver
Modified: 2011-10-07 18:17 UTC (History)
0 users

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


Attachments
Patch to swi-prolog-5.11.28.ebuild (swi-prolog-zlib.patch,416 bytes, patch)
2011-10-04 05:27 UTC, Maks Verver
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Maks Verver 2011-10-04 05:17:33 UTC
As described at bug #383179, Gentoo now renames zlib's internal OF macro to _Z_OF which is still used in zutil.h which ships with SWI Prolog.

A simple workaround is to modify zutil.h so it redefines OF to _Z_OF (if OF wasn't defined in zlib.h).  I'll attach a patch to the latest swi-prolog ebuild that does this.

Reproducible: Always
Comment 1 Maks Verver 2011-10-04 05:27:20 UTC
Created attachment 288737 [details, diff]
Patch to swi-prolog-5.11.28.ebuild

This patch updates packages/zlib/util.h in src_prepare to define OF as _Z_OF if the former isn't already defined by zlib.h, allowing the package to be built with both older and newer versions of Gentoo's zlib.h.
Comment 2 Maks Verver 2011-10-04 05:47:58 UTC
Comment on attachment 288737 [details, diff]
Patch to swi-prolog-5.11.28.ebuild

>--- /usr/portage/dev-lang/swi-prolog/swi-prolog-5.11.28.ebuild	2011-10-03 09:51:26.000000000 +0200
>+++ swi-prolog-5.11.28.ebuild	2011-10-04 07:20:04.000000000 +0200
>@@ -44,6 +44,14 @@
> 	EPATCH_FORCE=yes
> 	EPATCH_SUFFIX=patch
> 	epatch "${WORKDIR}"/${PV}
>+
>+	# fix for bug #385569
>+	sed -e '/^#include "zlib.h"/ {
>+a#ifndef OF
>+a#define OF _Z_OF
>+a#endif
>+}' -i "${S}"/packages/zlib/zutil.h || die
>+
> }
> 
> src_configure() {
Comment 3 Keri Harris gentoo-dev 2011-10-07 18:17:09 UTC
Thanks for taking the time to have a look at this!

It looks like we've both separately looked at SWI failing with its bundled copy of zutil.h. I've pulled in an upstream fix [1] and applied it to pl-5.10.5-r1 and pl-5.11.28.

[1] http://www.swi-prolog.org/git/packages/zlib.git/commit/662d4015