Skip to content

Commit fd9de41

Browse files
authored
chore(maker-rpm): map arm64 -> aarch64 (#3137)
1 parent 3d5c87c commit fd9de41

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

packages/maker/rpm/src/MakerRpm.ts

+7-1
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,18 @@ import { ForgeArch, ForgePlatform } from '@electron-forge/shared-types';
55

66
import { MakerRpmConfig } from './Config';
77

8+
function renameRpm(dest: string, _src: string): string {
9+
return path.join(dest, '<%= name %>-<%= version %>-<%= revision %>.<%= arch === "aarch64" ? "arm64" : arch %>.rpm');
10+
}
11+
812
export function rpmArch(nodeArch: ForgeArch): string {
913
switch (nodeArch) {
1014
case 'ia32':
1115
return 'i386';
1216
case 'x64':
1317
return 'x86_64';
18+
case 'arm64':
19+
return 'aarch64';
1420
case 'armv7l':
1521
return 'armv7hl';
1622
case 'arm':
@@ -43,7 +49,7 @@ export default class MakerRpm extends MakerBase<MakerRpmConfig> {
4349
arch: rpmArch(targetArch),
4450
src: dir,
4551
dest: outDir,
46-
rename: undefined,
52+
rename: renameRpm,
4753
});
4854
return packagePaths;
4955
}

packages/maker/rpm/test/MakerRpm_spec.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,11 @@ describe('MakerRpm', () => {
5656
packageJSON,
5757
});
5858
const opts = eirStub.firstCall.args[0];
59+
delete opts.rename;
5960
expect(opts).to.deep.equal({
6061
arch: rpmArch(process.arch as ForgeArch),
6162
src: dir,
6263
dest: path.join(makeDir, 'rpm', process.arch),
63-
rename: undefined,
6464
});
6565
});
6666

@@ -81,14 +81,14 @@ describe('MakerRpm', () => {
8181
packageJSON,
8282
});
8383
const opts = eirStub.firstCall.args[0];
84+
delete opts.rename;
8485
expect(opts).to.deep.equal({
8586
arch: rpmArch(process.arch as ForgeArch),
8687
options: {
8788
productName: 'Redhat',
8889
},
8990
src: dir,
9091
dest: path.join(makeDir, 'rpm', process.arch),
91-
rename: undefined,
9292
});
9393
});
9494

@@ -101,6 +101,10 @@ describe('MakerRpm', () => {
101101
expect(rpmArch('x64')).to.equal('x86_64');
102102
});
103103

104+
it('should convert arm64 to aarch64', () => {
105+
expect(rpmArch('arm64')).to.equal('aarch64');
106+
});
107+
104108
it('should convert arm to armv6hl', () => {
105109
expect(rpmArch('arm')).to.equal('armv6hl');
106110
});

0 commit comments

Comments
 (0)