Opened 8 years ago

Closed 8 years ago

#53228 closed defect (fixed)

R 3.3.2 fails to build due to zlib not being present

Reported by: Morpheu5 (Andrea Franceschini) Owned by: kjellpk (Kjell Konis)
Priority: Normal Milestone:
Component: ports Version: 2.3.5
Keywords: haspatch maintainer Cc: konradjk (Konrad Karczewski)
Port: R

Description

Like it says, see main.log attached.

Attachments (3)

main.log (43.7 KB) - added by Morpheu5 (Andrea Franceschini) 8 years ago.
main.log
R-Portfile.diff (1.2 KB) - added by kjellpk (Kjell Konis) 8 years ago.
R-Portfile-take2.diff (952 bytes) - added by kjellpk (Kjell Konis) 8 years ago.

Download all attachments as: .zip

Change History (14)

Changed 8 years ago by Morpheu5 (Andrea Franceschini)

Attachment: main.log added

main.log

comment:1 Changed 8 years ago by Morpheu5 (Andrea Franceschini)

Forgot to mention, this happens on macOS 10.12.2. I did the proper migration procedure, and pretty much every other package compiled fine – except for ghc, which I have patched.

comment:2 Changed 8 years ago by mf2k (Frank Schima)

Keywords: R zlib configure removed
Owner: set to kjellpk
Status: newassigned

In the future, please Cc the port maintainers (port info --maintainers R), if any.

Changed 8 years ago by kjellpk (Kjell Konis)

Attachment: R-Portfile.diff added

comment:3 in reply to:  2 Changed 8 years ago by Morpheu5 (Andrea Franceschini)

Replying to mf2k:

In the future, please Cc the port maintainers (port info --maintainers R), if any.

Thanks, I was in a rush, I forgot a lot of stuff :(

comment:4 Changed 8 years ago by kjellpk (Kjell Konis)

Maintainer here. Funnily enough I also just upgraded to 10.12.2 (from El Cap) and ran into exactly the same problem. But that doesn't have anything to do with this bug.

R's configure script uses this program to check the version of zlib:

#include <stdlib.h>
#include <string.h>
#include <zlib.h>
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
}

which reads the current version of zlib (1.2.10) as 1.2.1 and ranks it less than 1.2.5. I made the following change

#include <stdlib.h>
#include <string.h>
#include <zlib.h>
int main() {
#ifdef ZLIB_VERSION
  if(strlen(ZLIB_VERSION) == 6) exit(strncmp(ZLIB_VERSION, "1.2.05", 6) < 0);
/* 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
}

which fixes the problem for me (and hopefully won't introduce a bug for anyone else). The attached R-Portfile.diff makes this change and also removes the no longer used --with-system-zlib from the configure arguments.

comment:5 in reply to:  4 Changed 8 years ago by Morpheu5 (Andrea Franceschini)

Thanks, your changes fixed the problem for me too.

comment:6 Changed 8 years ago by mf2k (Frank Schima)

Keywords: haspatch maintainer added

Thank you. Since it is a build issue, there is no need to increase the revision.

comment:7 Changed 8 years ago by gaming-hacker (G Alexander)

good fix, works for me, i just updated from 10.11.6 to 10.12.2

Changed 8 years ago by kjellpk (Kjell Konis)

Attachment: R-Portfile-take2.diff added

comment:8 Changed 8 years ago by kjellpk (Kjell Konis)

Maintainer here. I just attached a new diff that doesn't bump the revision. Please commit asap.

comment:9 Changed 8 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: konradjk added

Has duplicate #53288.

comment:10 Changed 8 years ago by ryandesign (Ryan Carsten Schmidt)

In fa76739d/macports-ports:

R: Remove unneeded --with-system-zlib flag

See: #53228

comment:11 Changed 8 years ago by ryandesign (Ryan Carsten Schmidt)

Resolution: fixed
Status: assignedclosed

In efbf387e/macports-ports:

R: Fix incorrect zlib version comparison

Closes: #53228

Note: See TracTickets for help on using tickets.