forgecode 1.6.0 → 1.7.1
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/bin/android/arm64/forge-aarch64-linux-android +0 -0
- package/bin/darwin/arm64/forge-aarch64-apple-darwin +0 -0
- package/bin/darwin/x64/forge-x86_64-apple-darwin +0 -0
- package/bin/linux/arm64/forge-aarch64-unknown-linux-gnu +0 -0
- package/bin/linux/arm64/forge-aarch64-unknown-linux-musl +0 -0
- package/bin/linux/x64/forge-x86_64-unknown-linux-gnu +0 -0
- package/bin/linux/x64/forge-x86_64-unknown-linux-musl +0 -0
- package/bin/win32/arm64/forge-aarch64-pc-windows-msvc.exe +0 -0
- package/bin/win32/x64/forge-x86_64-pc-windows-msvc.exe +0 -0
- package/install.js +46 -10
- package/package.json +1 -1
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/install.js
CHANGED
|
@@ -6,6 +6,26 @@ const { chmodSync, copyFileSync, existsSync } = require('fs');
|
|
|
6
6
|
const { spawnSync } = require('child_process');
|
|
7
7
|
const os = require('os');
|
|
8
8
|
|
|
9
|
+
// Function to check if running on Android
|
|
10
|
+
function isAndroid() {
|
|
11
|
+
try {
|
|
12
|
+
// Check for Android-specific system properties
|
|
13
|
+
const result = spawnSync('getprop', ['ro.build.version.release'], { encoding: 'utf8' });
|
|
14
|
+
if (result.status === 0 && result.stdout) {
|
|
15
|
+
return true;
|
|
16
|
+
}
|
|
17
|
+
} catch (e) {
|
|
18
|
+
// getprop command not available, probably not Android
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
// Check for Termux environment
|
|
22
|
+
if (process.env.PREFIX && process.env.PREFIX.includes('com.termux')) {
|
|
23
|
+
return true;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
return false;
|
|
27
|
+
}
|
|
28
|
+
|
|
9
29
|
// Function to get the glibc version on Linux
|
|
10
30
|
function getGlibcVersion() {
|
|
11
31
|
try {
|
|
@@ -151,6 +171,9 @@ const PLATFORMS = {
|
|
|
151
171
|
x64: 'forge-x86_64-pc-windows-msvc.exe',
|
|
152
172
|
arm64: 'forge-aarch64-pc-windows-msvc.exe',
|
|
153
173
|
},
|
|
174
|
+
android: {
|
|
175
|
+
arm64: 'forge-aarch64-linux-android',
|
|
176
|
+
}
|
|
154
177
|
};
|
|
155
178
|
|
|
156
179
|
// Platform-specific binary extension
|
|
@@ -194,18 +217,25 @@ function printPlatformInfo() {
|
|
|
194
217
|
function install() {
|
|
195
218
|
printPlatformInfo();
|
|
196
219
|
|
|
220
|
+
// Detect actual platform (override for Android)
|
|
221
|
+
let actualPlatform = platform;
|
|
222
|
+
if (platform === 'linux' && isAndroid()) {
|
|
223
|
+
actualPlatform = 'android';
|
|
224
|
+
console.log('🤖 Android environment detected, using Android binaries');
|
|
225
|
+
}
|
|
226
|
+
|
|
197
227
|
// Check if platform is supported
|
|
198
|
-
if (!PLATFORMS[
|
|
199
|
-
console.error(`❌ Unsupported platform: ${
|
|
200
|
-
console.error('Supported platforms: macOS, Linux, Windows');
|
|
228
|
+
if (!PLATFORMS[actualPlatform]) {
|
|
229
|
+
console.error(`❌ Unsupported platform: ${actualPlatform}`);
|
|
230
|
+
console.error('Supported platforms: macOS, Linux, Windows, Android');
|
|
201
231
|
process.exit(1);
|
|
202
232
|
}
|
|
203
233
|
|
|
204
234
|
// Check if architecture is supported
|
|
205
|
-
if (!PLATFORMS[
|
|
206
|
-
console.error(`❌ Unsupported architecture: ${arch} for platform ${
|
|
235
|
+
if (!PLATFORMS[actualPlatform][arch]) {
|
|
236
|
+
console.error(`❌ Unsupported architecture: ${arch} for platform ${actualPlatform}`);
|
|
207
237
|
console.error(
|
|
208
|
-
`Supported architectures for ${
|
|
238
|
+
`Supported architectures for ${actualPlatform}: ${Object.keys(PLATFORMS[actualPlatform]).join(', ')}`
|
|
209
239
|
);
|
|
210
240
|
process.exit(1);
|
|
211
241
|
}
|
|
@@ -214,8 +244,13 @@ function install() {
|
|
|
214
244
|
let binaryPath;
|
|
215
245
|
const targetPath = join(__dirname, 'forge' + getBinaryExtension());
|
|
216
246
|
|
|
217
|
-
// Handle
|
|
218
|
-
if (
|
|
247
|
+
// Handle platform-specific binary selection
|
|
248
|
+
if (actualPlatform === 'android') {
|
|
249
|
+
// Android: simple case, just one binary per arch
|
|
250
|
+
binaryName = PLATFORMS[actualPlatform][arch];
|
|
251
|
+
binaryPath = join(__dirname, 'bin', actualPlatform, arch, binaryName);
|
|
252
|
+
} else if (platform === 'linux') {
|
|
253
|
+
// Linux: handle libc type detection
|
|
219
254
|
// Check if running on Android first
|
|
220
255
|
if (isAndroid() && arch === 'arm64' && PLATFORMS[platform][arch]['android']) {
|
|
221
256
|
console.log('🤖 Android platform detected');
|
|
@@ -262,8 +297,9 @@ function install() {
|
|
|
262
297
|
}
|
|
263
298
|
}
|
|
264
299
|
} else {
|
|
265
|
-
|
|
266
|
-
|
|
300
|
+
// macOS, Windows: simple case
|
|
301
|
+
binaryName = PLATFORMS[actualPlatform][arch];
|
|
302
|
+
binaryPath = join(__dirname, 'bin', actualPlatform, arch, binaryName);
|
|
267
303
|
}
|
|
268
304
|
|
|
269
305
|
// Check if binary exists
|