From 72782a93f50397bfd62049f249341293f3d64394 Mon Sep 17 00:00:00 2001 From: Alex Newman Date: Thu, 1 Dec 2016 15:00:56 -0800 Subject: [PATCH] Add support for 32 bit linux builds --- tools/buildInstaller.js | 21 ++++++++++----------- tools/buildPackage.js | 12 ++++++++---- 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/tools/buildInstaller.js b/tools/buildInstaller.js index f68f84f72e1..da79fc52867 100644 --- a/tools/buildInstaller.js +++ b/tools/buildInstaller.js @@ -10,11 +10,10 @@ var outDir = 'dist' var arch = 'x64' var cmds -if (isWindows) { - if (process.env.TARGET_ARCH === 'ia32') { - arch = 'ia32' - } +if (process.env.TARGET_ARCH === 'ia32') { + arch = 'ia32' } + const buildDir = 'Brave-' + process.platform + '-' + arch console.log('Building install and update for version ' + VersionInfo.braveVersion + ' in ' + buildDir + ' with Electron ' + VersionInfo.electronVersion) @@ -81,23 +80,23 @@ if (isDarwin) { execute(cmds, {}, console.log.bind(null, 'done')) }, (e) => console.log(`No dice: ${e.message}`)) } else if (isLinux) { - console.log('Install with sudo dpkg -i dist/brave_' + VersionInfo.braveVersion + '_amd64.deb') - console.log('Or install with sudo dnf install dist/brave_' + VersionInfo.braveVersion + '.x86_64.rpm') + console.log(format('Install with sudo dpkg -i dist/brave_' + VersionInfo.braveVersion + '_%s.deb', arch)) + console.log(format('Or install with sudo dnf install dist/brave_' + VersionInfo.braveVersion + '.%s.rpm', arch)) cmds = [ // .deb file 'electron-installer-debian' + - ' --src Brave-linux-x64/' + + format(' --src Brave-linux-%s/', arch) + ' --dest dist/' + - ' --arch amd64' + + format(' --arch %s', arch) + ' --config res/linuxPackaging.json', // .rpm file 'electron-installer-redhat' + - ' --src Brave-linux-x64/' + + format(' --src Brave-linux-%s/', arch) + ' --dest dist/' + - ' --arch x86_64' + + format(' --arch %s', arch) + ' --config res/linuxPackaging.json', // .tar.bz2 file - 'tar -jcvf dist/Brave.tar.bz2 ./Brave-linux-x64' + format('tar -jcvf dist/Brave.tar.bz2 ./Brave-linux-%s', arch) ] execute(cmds, {}, console.log.bind(null, 'done')) } else { diff --git a/tools/buildPackage.js b/tools/buildPackage.js index ff67397f2d6..019dae8a7ea 100644 --- a/tools/buildPackage.js +++ b/tools/buildPackage.js @@ -4,21 +4,25 @@ var VersionInfo = require('./lib/versionInfo') var execute = require('./lib/execute') +var format = require('util').format + const ignoredPaths = require('./lib/ignoredPaths') const config = require('./lib/config') const path = require('path') + const isWindows = process.platform === 'win32' const isDarwin = process.platform === 'darwin' var arch = 'x64' const isLinux = process.platform === 'linux' var appIcon +if (process.env.TARGET_ARCH === 'ia32') { + arch = 'ia32' +} + if (isWindows) { appIcon = 'res/app.ico' - if (process.env.TARGET_ARCH === 'ia32') { - arch = 'ia32' - } } else if (isDarwin) { appIcon = 'res/app.icns' } else { @@ -107,7 +111,7 @@ function BuildManifestFile () { } if (isLinux) { - cmds.push('mv Brave-linux-x64/Brave Brave-linux-x64/brave') + cmds.push(format('mv Brave-linux-%s/Brave Brave-linux-%s/brave', arch, arch)) cmds.push('ncp ./app/extensions ' + path.join(buildDir, 'resources', 'extensions')) } else if (isDarwin) { cmds.push('ncp ./app/extensions ' + path.join(buildDir, 'Brave.app', 'Contents', 'Resources', 'extensions'))