Package: libpdl-io-hdf5-perl / 1:0.73-5

support-hdf5-1.8.13.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
Description: Support HDF5 >= 1.8.13.
Author: Gilles Filippini <pini@debian.org>
Forwarded: https://sourceforge.net/p/pdl/patches/83/

--- a/Makefile.PL
+++ b/Makefile.PL
@@ -42,6 +42,7 @@ $ENV{'HDF5_PATH'} = '' unless defined (
 @libdirs =  (
     $ENV{'HDF5_PATH'}."/lib",
     $ENV{'HDF5_PATH'}."/lib64",
+    $ENV{HDF5_LIBDIR},
     split(/ /, $Config{libpth}),  # TODO: This will break for paths with spaces
     '/usr/local/hdf5/lib',
     '/usr/local/lib',
@@ -51,6 +52,26 @@ $ENV{'HDF5_PATH'} = '' unless defined (
     '/usr/lib64'
     );
 push(@libdirs,split(":",$ENV{'LD_LIBRARY_PATH'}));
+@hdf5_lib=(
+    "libhdf5.so",
+    "libhdf5_serial.so",
+    "libhdf5.dll.a",
+    "libhdf5.a",
+);
+
+dirloop: foreach my $libdir ( @libdirs ) {
+  foreach my $hdf5_lib_test (@hdf5_lib) {
+      print STDERR "testing $libdir/$hdf5_lib_test\n";
+      if (-e "$libdir/$hdf5_lib_test") {
+        print "Found $hdf5_lib_test at $libdir/$hdf5_lib_test\n";
+        $hdf5_lib=$hdf5_lib_test;
+        $hdf5_lib=~s/\..*//;
+        $hdf5_lib_path = $libdir;
+        last dirloop;
+      }
+  }
+}
+
 foreach my $libdir ( @libdirs ) {
     
   if (-e "$libdir/libhdf5.so") {
@@ -82,6 +103,7 @@ unless(defined ($hdf5_lib_path) ){
 
 @incdirs =  (
     $ENV{'HDF5_PATH'}."/include",
+    $ENV{HDF5_INCDIR},
     $Config{usrinc},
     '/usr/local/hdf5/include',
     '/usr/local/include',
@@ -134,7 +156,7 @@ if ($Config{'osname'} =~ /win32/i) {
   print "Defining _HDF5USEDLL_ for win32\n";
 }
             
-$LIBS = "-L$hdf5_lib_path -lhdf5 ";
+$LIBS = "-L$hdf5_lib_path -lhdf5_serial ";
 $LIBS .= " -lz" if($zLib);
 $LIBS .= " -ljpeg" if($jpegLib);
 $LIBS .= " -lm";