@platforma-sdk/r-builder 1.1.0 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/scripts/lib/linux.js +12 -27
package/package.json
CHANGED
package/scripts/lib/linux.js
CHANGED
|
@@ -64,7 +64,7 @@ async function installRockyLinuxPackages(logger) {
|
|
|
64
64
|
|
|
65
65
|
util.runInherit(`sudo dnf -y install R`);
|
|
66
66
|
util.runInherit(`sudo dnf -y builddep R`);
|
|
67
|
-
util.runInherit(`sudo dnf -y install patchelf openssl-devel libcurl-devel libpng-devel lapack-devel blas-devel fontconfig-devel libxml2-devel`);
|
|
67
|
+
util.runInherit(`sudo dnf -y install curl rsync unzip diffutils procps patchelf openssl-devel libcurl-devel libpng-devel lapack-devel blas-devel fontconfig-devel libxml2-devel`);
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
function getGCCMajorVersion() {
|
|
@@ -125,36 +125,19 @@ async function buildRDist(logger, buildDir, installRoot, rRoot) {
|
|
|
125
125
|
util.runInherit(`make`, { cwd: buildDir });
|
|
126
126
|
util.runInherit(`make install`, { cwd: buildDir });
|
|
127
127
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
// Ensure the source path exists before attempting to rename
|
|
136
|
-
if (!fs.existsSync(rLibPath)) {
|
|
137
|
-
logger.warn(`R library not found at expected path: ${rLibPath}, trying alternative...`);
|
|
138
|
-
|
|
139
|
-
// Try the alternative paths as fallback
|
|
140
|
-
rLibPath = rLibPath.includes('lib64')
|
|
141
|
-
? path.join(installRoot, 'lib', 'R') // Try lib if lib64 failed
|
|
142
|
-
: path.join(installRoot, 'lib64', 'R'); // Try lib64 if lib failed
|
|
143
|
-
|
|
144
|
-
if (!fs.existsSync(rLibPath)) {
|
|
145
|
-
throw new Error(`R library not found in either lib or lib64 directories`);
|
|
146
|
-
}
|
|
128
|
+
let libsDir = path.join(installRoot, 'lib64', 'R');
|
|
129
|
+
if (!fs.existsSync(libsDir)) {
|
|
130
|
+
libsDir = path.join(installRoot, 'lib', 'R');
|
|
131
|
+
}
|
|
132
|
+
if (!fs.existsSync(libsDir)) {
|
|
133
|
+
throw new Error(`R libraries directory not found in ${installRoot} (neither 'lib64/R' nor 'lib/R')`);
|
|
147
134
|
}
|
|
148
135
|
|
|
149
|
-
logger.info(`Moving R from ${
|
|
150
|
-
fs.renameSync(rLibPath, rRoot);
|
|
151
|
-
|
|
152
|
-
// Move core of R installation into desired R root, leaving behind all supporting
|
|
153
|
-
// (and unnecessary) files.
|
|
136
|
+
logger.info(`Moving R from ${libsDir} to ${rRoot}`);
|
|
154
137
|
if (fs.existsSync(rRoot)) {
|
|
155
138
|
fs.rmSync(rRoot, { recursive: true });
|
|
156
139
|
}
|
|
157
|
-
fs.renameSync(
|
|
140
|
+
fs.renameSync(libsDir, rRoot);
|
|
158
141
|
|
|
159
142
|
// 1st round of dependencies collection with binaries ELF patching to make R work from
|
|
160
143
|
// its new location. We'll collect dependencies of installed packages later by one more round.
|
|
@@ -226,7 +209,9 @@ function collectSoLibs(logger, binaryFiles, libsDir, libsToIgnore) {
|
|
|
226
209
|
for (const libPath of collectedLibs) {
|
|
227
210
|
logger.info(` copying '${libPath}'`);
|
|
228
211
|
const targetPath = path.join(libsDir, path.basename(libPath));
|
|
229
|
-
fs.
|
|
212
|
+
if (!fs.existsSync(targetPath)) {
|
|
213
|
+
fs.copyFileSync(libPath, targetPath);
|
|
214
|
+
}
|
|
230
215
|
}
|
|
231
216
|
|
|
232
217
|
return collectedLibs;
|