summaryrefslogtreecommitdiff
path: root/var/spack/repos/builtin/packages/py-netcdf4/check_hdf5version.patch
blob: c2c3bd025cdb424a425d8f9fa32c45de49262666 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
--- a/setup.py
+++ b/setup.py
@@ -275,7 +275,7 @@ HDF5_DIR environment variable not set, checking some standard locations ..\n""")
         for direc in dirstosearch:
             sys.stdout.write('checking %s ...\n' % direc)
             hdf5_version = check_hdf5version(os.path.join(direc, 'include'))
-            if hdf5_version is None or hdf5_version[1:6] < '1.8.0':
+            if hdf5_version is None or [int(c) for c in hdf5_version[1:-1].split('.')] < [1, 8, 0]:
                 continue
             else:
                 HDF5_dir = direc
@@ -290,7 +290,7 @@ HDF5_DIR environment variable not set, checking some standard locations ..\n""")
         hdf5_version = check_hdf5version(HDF5_incdir)
         if hdf5_version is None:
             raise ValueError('did not find HDF5 headers in %s' % HDF5_incdir)
-        elif hdf5_version[1:6] < '1.8.0':
+        elif [int(c) for c in hdf5_version[1:-1].split('.')] < [1, 8, 0]:
             raise ValueError('HDF5 version >= 1.8.0 is required')
 
     if netCDF4_incdir is None and netCDF4_dir is None: