Skip to content

Commit f9ac9f8

Browse files
authored
Merge pull request #2940 from haslinghuis/bump-arm-build
Bump Arm build to ARMv8
2 parents bbc946c + 3f0a456 commit f9ac9f8

File tree

2 files changed

+24
-24
lines changed

2 files changed

+24
-24
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ If no platform is provided, the build for the host platform is run.
117117

118118
**Note:** Support for cross-platform building is very limited due to the requirement for platform specific build tools. If in doubt, build on the target platform.
119119

120-
You can also use multiple platforms e.g. `yarn gulp <taskname> --osx64 --linux64`. Other platforms like `--win32`, `--linux32` and `--armv7` can be used too, but they are not officially supported, so use them at your own risk.
120+
You can also use multiple platforms e.g. `yarn gulp <taskname> --osx64 --linux64`. Other platforms like `--win32`, `--linux32` and `--armv8` can be used too, but they are not officially supported, so use them at your own risk.
121121

122122
## Support
123123

gulpfile.js

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ const nwBuilderOptions = {
5858
zip: false,
5959
};
6060

61-
const nwArmVersion = '0.27.6';
61+
const nwArmVersion = 'nw60-arm64_2022-01-08';
6262

6363
let metadata = {};
6464

@@ -139,10 +139,10 @@ gulp.task('default', debugBuild);
139139

140140
// Get platform from commandline args
141141
// #
142-
// # gulp <task> [<platform>]+ Run only for platform(s) (with <platform> one of --linux64, --linux32, --armv7, --osx64, --win32, --win64, or --android)
142+
// # gulp <task> [<platform>]+ Run only for platform(s) (with <platform> one of --linux64, --linux32, --armv8, --osx64, --win32, --win64, or --android)
143143
// #
144144
function getInputPlatforms() {
145-
const supportedPlatforms = ['linux64', 'linux32', 'armv7', 'osx64', 'win32', 'win64', 'android'];
145+
const supportedPlatforms = ['linux64', 'linux32', 'armv8', 'osx64', 'win32', 'win64', 'android'];
146146
const platforms = [];
147147
const regEx = /--(\w+)/;
148148

@@ -232,7 +232,7 @@ function getRunDebugAppCommand(arch) {
232232

233233
case 'linux64':
234234
case 'linux32':
235-
case 'armv7':
235+
case 'armv8':
236236
command = path.join(DEBUG_DIR, metadata.name, arch, metadata.name);
237237

238238
break;
@@ -466,9 +466,9 @@ function listPostBuildTasks(folder) {
466466
});
467467
}
468468

469-
if (platforms.indexOf('armv7') !== -1) {
470-
postBuildTasks.push(function post_build_armv7(done) {
471-
return post_build('armv7', folder, done);
469+
if (platforms.indexOf('armv8') !== -1) {
470+
postBuildTasks.push(function post_build_armv8(done) {
471+
return post_build('armv8', folder, done);
472472
});
473473
}
474474

@@ -491,9 +491,9 @@ function post_build(arch, folder, done) {
491491
.pipe(gulp.dest(launcherDir));
492492
}
493493

494-
if (arch === 'armv7') {
495-
console.log('Moving ARMv7 build from "linux32" to "armv7" directory...');
496-
fse.moveSync(path.join(folder, metadata.name, 'linux32'), path.join(folder, metadata.name, 'armv7'));
494+
if (arch === 'armv8') {
495+
console.log('Moving armv8 build from "linux32" to "armv8" directory...');
496+
fse.moveSync(path.join(folder, metadata.name, 'linux32'), path.join(folder, metadata.name, 'armv8'));
497497
}
498498

499499
return done();
@@ -514,7 +514,7 @@ function injectARMCache(flavor, done) {
514514
if (!fs.existsSync('./cache')) {
515515
fs.mkdirSync('./cache');
516516
}
517-
fs.closeSync(fs.openSync('./cache/_ARMv7_IS_CACHED', 'w'));
517+
fs.closeSync(fs.openSync('./cache/_ARMv8_IS_CACHED', 'w'));
518518
const versionFolder = `./cache/${nwBuilderOptions.version}${flavorPostfix}`;
519519
if (!fs.existsSync(versionFolder)) {
520520
fs.mkdirSync(versionFolder);
@@ -524,12 +524,12 @@ function injectARMCache(flavor, done) {
524524
fs.mkdirSync(linux32Folder);
525525
}
526526
const downloadedArchivePath = `${versionFolder}/nwjs${flavorPostfix}-v${nwArmVersion}-linux-arm.tar.gz`;
527-
const downloadUrl = `https://github.com/LeonardLaszlo/nw.js-armv7-binaries/releases/download/v${nwArmVersion}/nwjs${flavorDownloadPostfix}-v${nwArmVersion}-linux-arm.tar.gz`;
527+
const downloadUrl = `https://github.com/LeonardLaszlo/nw.js-armv7-binaries/releases/download/${nwArmVersion}/${nwArmVersion}.tar.gz`;
528528
if (fs.existsSync(downloadedArchivePath)) {
529-
console.log('Prebuilt ARMv7 binaries found in /tmp');
529+
console.log('Prebuilt ARMv8 binaries found in /tmp');
530530
downloadDone(flavorDownloadPostfix, downloadedArchivePath, versionFolder);
531531
} else {
532-
console.log(`Downloading prebuilt ARMv7 binaries from "${downloadUrl}"...`);
532+
console.log(`Downloading prebuilt ARMv8 binaries from "${downloadUrl}"...`);
533533
process.stdout.write('> Starting download...\r');
534534
const armBuildBinary = fs.createWriteStream(downloadedArchivePath);
535535
https.get(downloadUrl, function(res) {
@@ -551,7 +551,7 @@ function injectARMCache(flavor, done) {
551551
});
552552

553553
function downloadDone(flavorDownload, downloadedArchivePath, versionFolder) {
554-
console.log('Injecting prebuilt ARMv7 binaries into Linux32 cache...');
554+
console.log('Injecting prebuilt ARMv8 binaries into Linux32 cache...');
555555
targz.decompress({
556556
src: downloadedArchivePath,
557557
dest: versionFolder,
@@ -583,16 +583,16 @@ function buildNWAppsWrapper(platforms, flavor, dir, done) {
583583
buildNWApps(platforms, flavor, dir, done);
584584
}
585585

586-
if (platforms.indexOf('armv7') !== -1) {
586+
if (platforms.indexOf('armv8') !== -1) {
587587
if (platforms.indexOf('linux32') !== -1) {
588-
console.log('Cannot build ARMv7 and Linux32 versions at the same time!');
588+
console.log('Cannot build ARMv8 and Linux32 versions at the same time!');
589589
clean_debug();
590590
process.exit(1);
591591
}
592-
removeItem(platforms, 'armv7');
592+
removeItem(platforms, 'armv8');
593593
platforms.push('linux32');
594594

595-
if (!fs.existsSync('./cache/_ARMv7_IS_CACHED', 'w')) {
595+
if (!fs.existsSync('./cache/_ARMv8_IS_CACHED', 'w')) {
596596
console.log('Purging cache because it needs to be overwritten...');
597597
clean_cache().then(() => {
598598
injectARMCache(flavor, buildNWAppsCallback);
@@ -601,7 +601,7 @@ function buildNWAppsWrapper(platforms, flavor, dir, done) {
601601
buildNWAppsCallback();
602602
}
603603
} else {
604-
if (platforms.indexOf('linux32') !== -1 && fs.existsSync('./cache/_ARMv7_IS_CACHED')) {
604+
if (platforms.indexOf('linux32') !== -1 && fs.existsSync('./cache/_ARMv8_IS_CACHED')) {
605605
console.log('Purging cache because it was previously overwritten...');
606606
clean_cache().then(buildNWAppsCallback);
607607
} else {
@@ -886,9 +886,9 @@ function listReleaseTasks(isReleaseBuild, appDirectory) {
886886
});
887887
}
888888

889-
if (platforms.indexOf('armv7') !== -1) {
890-
releaseTasks.push(function release_armv7_zip() {
891-
return release_zip('armv7', appDirectory);
889+
if (platforms.indexOf('armv8') !== -1) {
890+
releaseTasks.push(function release_armv8_zip() {
891+
return release_zip('armv8', appDirectory);
892892
});
893893
}
894894

0 commit comments

Comments
 (0)