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 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88
|
Description: Pass correct path to the installed dir in unset variable
Forwarded: not-needed
Author: Nilesh Patra <nilesh@debian.org>
Last-Update: 2022-05-14
--- r-bioc-rhdf5lib.orig/R/zzz.R
+++ r-bioc-rhdf5lib/R/zzz.R
@@ -20,7 +20,7 @@
path <- Sys.getenv(
x = "RHDF5LIB_RPATH",
- unset = system.file("lib", package="Rhdf5lib", mustWork=TRUE)
+ unset = system.file("libs", package="Rhdf5lib", mustWork=TRUE)
)
if (nzchar(.Platform$r_arch)) {
@@ -51,7 +51,9 @@
winlibs <- gsub(pattern = "-lszip", replacement = "-lsz -laec", x = winlibs, fixed = TRUE)
}
}
-
+
+ multiarch <- system('dpkg-architecture -qDEB_HOST_MULTIARCH', intern=TRUE)
+
result <- switch(match.arg(opt),
PKG_C_LIBS = {
switch(sysname,
@@ -59,8 +61,8 @@
sprintf('-L%s -lhdf5 %s',
patharch, winlibs)
}, {
- sprintf('"%s/libhdf5.a"%s%s',
- patharch, .getSzipLoc(patharch), .getDynamicLinks())
+ sprintf('"/usr/lib/%s/hdf5/serial/libhdf5.a"%s%s',
+ multiarch, .getSzipLoc(patharch), .getDynamicLinks())
}
)
},
@@ -70,8 +72,8 @@
sprintf('-L%s -lhdf5_cpp -lhdf5 %s',
patharch, winlibs)
}, {
- sprintf('"%s/libhdf5_cpp.a" "%s/libhdf5.a"%s%s',
- patharch, patharch, .getSzipLoc(patharch), .getDynamicLinks())
+ sprintf('"/usr/lib/%s/hdf5/serial/libhdf5_cpp.a" "/usr/lib/%s/hdf5/serial/libhdf5.a"%s%s',
+ multiarch, multiarch, .getSzipLoc(patharch), .getDynamicLinks())
}
)
},
@@ -81,8 +83,8 @@
sprintf('-L%s -lhdf5_hl -lhdf5 %s',
patharch, winlibs)
}, {
- sprintf('"%s/libhdf5_hl.a" "%s/libhdf5.a"%s%s',
- patharch, patharch, .getSzipLoc(patharch), .getDynamicLinks())
+ sprintf('"/usr/lib/%s/hdf5/serial/libhdf5_hl.a" "/usr/lib/%s/hdf5/serial/libhdf5.a"%s%s',
+ multiarch, multiarch, .getSzipLoc(patharch), .getDynamicLinks())
}
)
},
@@ -92,8 +94,8 @@
sprintf('-L%s -lhdf5_hl_cpp -lhdf5_hl -lhdf5_cpp -lhdf5 %s',
patharch, winlibs)
}, {
- sprintf('"%s/libhdf5_hl_cpp.a" "%s/libhdf5_hl.a" "%s/libhdf5_cpp.a" "%s/libhdf5.a"%s%s',
- patharch, patharch, patharch, patharch, .getSzipLoc(patharch), .getDynamicLinks())
+ sprintf('"/usr/lib/%s/hdf5/serial/libhdf5_hl_cpp.a" "/usr/lib/%s/hdf5/serial/libhdf5_hl.a" "/usr/lib/%s/hdf5/serial/libhdf5_cpp.a" "/usr/lib/%s/hdf5/serial/libhdf5.a"%s%s',
+ multiarch, multiarch, multiarch, multiarch, .getSzipLoc(patharch), .getDynamicLinks())
}
)
}
@@ -128,7 +130,9 @@
if(sysname == "Windows") {
links <- "-lz"
} else {
- settings_file <- system.file('include', 'libhdf5.settings', package = "Rhdf5lib", mustWork = TRUE)
+ # It has been built with the args given in libhdf5.settings as in the original package
+ multiarch <- system('dpkg-architecture -qDEB_HOST_MULTIARCH', intern=TRUE)
+ settings_file <- file.path('/usr/lib', multiarch, 'hdf5/serial/libhdf5.settings')
libhdf5_settings <- readLines(settings_file)
line <- grep("Extra libraries", x = libhdf5_settings)
links <- strsplit(libhdf5_settings[line], split = ":")[[1]][2]
@@ -149,4 +153,4 @@
ldflags <- ""
}
return(ldflags)
-}
\ No newline at end of file
+}
|