Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 604676 - dev-lang/R-3.3.2 fails to build against sys-libs/zlib-1.2.10 - configure: error: zlib library and headers are required
Summary: dev-lang/R-3.3.2 fails to build against sys-libs/zlib-1.2.10 - configure: err...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Denis Dupeyron (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-01-04 17:47 UTC by Martin von Gagern
Modified: 2017-07-11 19:05 UTC (History)
1 user (show)

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


Attachments
svn commit 71889 (svn71889.patch,841 bytes, patch)
2017-01-04 17:48 UTC, Martin von Gagern
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Martin von Gagern 2017-01-04 17:47:16 UTC
R 3.3.2 fails to configure if zlib 1.2.10 is installed:

checking zlib.h usability... yes
checking zlib.h presence... yes
checking for zlib.h... yes
checking if zlib version >= 1.2.5... no
checking whether zlib support suffices... configure: error: zlib library and headers are required

From configure.log I can see that it does a string comparison:

int main() {
#ifdef ZLIB_VERSION
/* Work around Debian bug: it uses 1.2.3.4 even though there was no such
   version on the master site zlib.net */
  exit(strncmp(ZLIB_VERSION, "1.2.5", 5) < 0);
#else
  exit(1);
#endif
}

As 1.2.10 sorts before 1.2.5 in a string comparison, this check fails. The source of this appears to be the macro _R_HEADER_ZLIB in m4/R.m4.

Looking into zlib.h I see these macros which might help with a better check:

#define ZLIB_VERSION "1.2.10"
#define ZLIB_VERNUM 0x12a0
#define ZLIB_VER_MAJOR 1
#define ZLIB_VER_MINOR 2
#define ZLIB_VER_REVISION 10
#define ZLIB_VER_SUBREVISION 0

So one easy way would be comparing by ZLIB_VERNUM, but if version components were to exceed 15 that might break in some way, too. It seems upstream has decided to use that approach nevertheless, though:

  svn log --diff -r71889:71889 https://svn.r-project.org/R/trunk

retrieves a commit (dated from today!) which does address this very problem. So I suggest you simply include that as a patch for the ebuild.
Comment 1 Martin von Gagern 2017-01-04 17:48:27 UTC
Created attachment 458772 [details, diff]
svn commit 71889
Comment 2 Martin von Gagern 2017-01-04 17:53:38 UTC
Here is one way to apply the patch locally before the ebuild gets adjusted.

# ebuild /usr/portage/dev-lang/R/R-3.3.2.ebuild clean unpack
# svn log --diff -r71889:71889 https://svn.r-project.org/R/trunk \
  | patch -p0 -d /var/tmp/portage/dev-lang/R-3.3.2/work/R-3.3.2/
# ebuild /usr/portage/dev-lang/R/R-3.3.2.ebuild merge

I'm now past the configure phase, and expect the build to succeed eventually.
Comment 3 Justin Lecher (RETIRED) gentoo-dev 2017-01-05 19:27:10 UTC
commit 17331c2f15ee02bc370d3e2e6a596d377552eb42
Author: Justin Lecher <jlec@gentoo.org>
Date:   Thu Jan 5 19:25:46 2017 +0000

    dev-lang/R: Backport patch for zlib-1.2.10 compatibility

    Gentoo-Bug: https://bugs.gentoo.org/show_bug.cgi?id=604676

    Package-Manager: Portage-2.3.3, Repoman-2.3.1
    Signed-off-by: Justin Lecher <jlec@gentoo.org>

    https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=17331c2f15ee02bc370d3e2e6a596d377552eb42
Comment 4 P.B. Lecavalier 2017-07-11 18:59:26 UTC
Fixed? If so, why is it that the ebuild of R 3.3.2 in portage fails to build, precisely due to this?
Comment 5 Justin Lecher (RETIRED) gentoo-dev 2017-07-11 19:01:14 UTC
(In reply to P.B. Lecavalier from comment #4)
> Fixed? If so, why is it that the ebuild of R 3.3.2 in portage fails to
> build, precisely due to this?

please add a build.log.
Comment 6 P.B. Lecavalier 2017-07-11 19:05:07 UTC
My bad, I was referring to 3.3.1. The issue for 3.3.1 is identical. Might want to fix this ebuild as well or take it off the tree. ~3.3.2 is indeed building past the zlib issue, so it works for me.