[MacPorts] #53228: R 3.3.2 fails to build due to zlib not being present

MacPorts noreply at macports.org
Fri Jan 6 18:11:44 UTC 2017


#53228: R 3.3.2 fails to build due to zlib not being present
-----------------------+----------------------
  Reporter:  Morpheu5  |      Owner:  kjellpk
      Type:  defect    |     Status:  assigned
  Priority:  Normal    |  Milestone:
 Component:  ports     |    Version:  2.3.5
Resolution:            |   Keywords:
      Port:  R         |
-----------------------+----------------------

Comment (by kjellpk):

 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.

--
Ticket URL: <https://trac.macports.org/ticket/53228#comment:4>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list