summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorGeorge Hartzell <hartzell@alerce.com>2017-01-23 10:20:54 -0800
committerbecker33 <becker33@llnl.gov>2017-01-23 10:20:54 -0800
commit162be154d29a19407722611519524a7384affe8e (patch)
tree1cce77b76c76564c49573af24f9ac2ca472ab476 /var
parent7fd936735cfecba6fd250bf328d85ebf1de4cd58 (diff)
downloadspack-162be154d29a19407722611519524a7384affe8e.tar.gz
spack-162be154d29a19407722611519524a7384affe8e.tar.bz2
spack-162be154d29a19407722611519524a7384affe8e.tar.xz
spack-162be154d29a19407722611519524a7384affe8e.zip
Fix configure's zlib version check (#2901)
* Fix configure's zlib version check R wants a version of zlib that is 1.2.5 or newer. The version checking code just does a lexicographic comparison of the first 5 characters of the string, so it seesthat the latest zlib version, 1.2.10, as 1.2.1 and fails. This patch changes the comparison to use zlibs' hex ZLIB_VERNUM so that it does not suffer from this problem. A version of this patch is wending it's way through the R comunity community and will/should be included in a future release. I tested the patch with the current R, 3.3.1. * Tighten zlib dependency version (>= 1.2.5) * Convert patch to level=1 format.
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/r/package.py4
-rw-r--r--var/spack/repos/builtin/packages/r/zlib.patch29
2 files changed, 32 insertions, 1 deletions
diff --git a/var/spack/repos/builtin/packages/r/package.py b/var/spack/repos/builtin/packages/r/package.py
index 3fed62d1fa..590c5b2feb 100644
--- a/var/spack/repos/builtin/packages/r/package.py
+++ b/var/spack/repos/builtin/packages/r/package.py
@@ -63,7 +63,7 @@ class R(Package):
depends_on('ncurses')
depends_on('icu4c')
depends_on('glib')
- depends_on('zlib@:1.2.8')
+ depends_on('zlib@1.2.5:')
depends_on('bzip2')
depends_on('libtiff')
depends_on('jpeg')
@@ -82,6 +82,8 @@ class R(Package):
depends_on('pcre')
depends_on('jdk')
+ patch('zlib.patch', when='@:3.3.1')
+
@property
def etcdir(self):
return join_path(prefix, 'rlib', 'R', 'etc')
diff --git a/var/spack/repos/builtin/packages/r/zlib.patch b/var/spack/repos/builtin/packages/r/zlib.patch
new file mode 100644
index 0000000000..673d5352fa
--- /dev/null
+++ b/var/spack/repos/builtin/packages/r/zlib.patch
@@ -0,0 +1,29 @@
+*** a/configure 2017-01-21 21:48:35.077000000 +0000
+--- b/configure 2017-01-21 21:50:50.700000000 +0000
+***************
+*** 35496,35505 ****
+ #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
+--- 35496,35509 ----
+ #include <string.h>
+ #include <zlib.h>
+ int main() {
+! /* Checking ZLIB_VERNUM trick learned here:
+! * https://github.com/TransitApp/protobuf/blob/master/configure.ac#L95
+! */
+! #ifdef ZLIB_VERNUM
+! if (ZLIB_VERNUM < 0x1250) {
+! exit(1);
+! }
+! exit(0);
+ #else
+ exit(1);
+ #endif