Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Commit c0bc478

Browse files
Properly cross-compile for Linux arm64 (#352)
1 parent c5e8056 commit c0bc478

File tree

3 files changed

+48
-12
lines changed

3 files changed

+48
-12
lines changed

.github/workflows/ci.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -70,21 +70,21 @@ jobs:
7070
npm run prebuild-electron
7171
name: Prebuild (x64)
7272
73-
- run: npm run prebuild-electron-arm64
74-
if: ${{ matrix.os != 'macos-latest' }}
75-
name: Prebuild for Electron (ARM64)
76-
77-
- run: |
78-
docker build -t node-keytar/i386 docker/i386
79-
docker run --rm -v ${PWD}:/project node-keytar/i386 /bin/bash -c "cd /project && npm run prebuild-node-ia32 && npm run prebuild-electron-ia32"
80-
if: ${{ matrix.os == 'ubuntu-16.04' }}
81-
name: Prebuild (x86)
82-
8373
- run: |
74+
npm run prebuild-electron-arm64
8475
npm run prebuild-node-ia32
8576
npm run prebuild-electron-ia32
8677
if: ${{ matrix.os == 'windows-latest' }}
87-
name: Prebuild (x86)
78+
name: Prebuild (Windows x86 + ARM64)
79+
80+
- run: |
81+
mkdir -p prebuilds && chmod 777 prebuilds
82+
docker build -t node-keytar/i386 docker/i386
83+
docker run --rm -v ${PWD}:/project node-keytar/i386 /bin/bash -c "cd /project && npm run prebuild-node-ia32 && npm run prebuild-electron-ia32 && rm -rf build"
84+
docker build -t node-keytar/arm64-cross-compile docker/arm64-cross-compile
85+
docker run --rm -v ${PWD}:/project node-keytar/arm64-cross-compile /bin/bash -c "cd /project && npm run prebuild-electron-arm64"
86+
if: ${{ matrix.os == 'ubuntu-16.04' }}
87+
name: Prebuild (Linux x86 + ARM64)
8888
8989
- run: |
9090
ls prebuilds/

.travis.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,5 +52,12 @@ script:
5252
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then npm test; fi
5353
- npm run prebuild-node
5454
- npm run prebuild-electron
55-
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then docker build -t node-keytar/i386 docker/i386 && docker run --rm -v ${PWD}:/project node-keytar/i386 /bin/bash -c "cd /project && npm run prebuild-node-ia32 && npm run prebuild-electron-ia32 && npm run prebuild-electron-arm64"; fi
55+
- |
56+
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
57+
mkdir -p prebuilds && chmod 777 prebuilds
58+
docker build -t node-keytar/i386 docker/i386
59+
docker run --rm -v ${PWD}:/project node-keytar/i386 /bin/bash -c "cd /project && npm run prebuild-node-ia32 && npm run prebuild-electron-ia32 && rm -rf build"
60+
docker build -t node-keytar/arm64-cross-compile docker/arm64-cross-compile
61+
docker run --rm -v ${PWD}:/project node-keytar/arm64-cross-compile /bin/bash -c "cd /project && npm run prebuild-electron-arm64"
62+
fi
5663
- if [[ -n "$TRAVIS_TAG" ]]; then npm run upload; fi
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
FROM debian:buster
2+
3+
RUN dpkg --add-architecture arm64
4+
RUN apt-get update && apt-get install -y --no-install-recommends \
5+
crossbuild-essential-arm64 \
6+
python \
7+
git \
8+
pkg-config \
9+
fakeroot \
10+
rpm \
11+
ca-certificates \
12+
libx11-dev:arm64 \
13+
libx11-xcb-dev:arm64 \
14+
libxkbfile-dev:arm64 \
15+
libsecret-1-dev:arm64 \
16+
curl
17+
18+
ENV AS=/usr/bin/aarch64-linux-gnu-as \
19+
STRIP=/usr/bin/aarch64-linux-gnu-strip \
20+
AR=/usr/bin/aarch64-linux-gnu-ar \
21+
CC=/usr/bin/aarch64-linux-gnu-gcc \
22+
CPP=/usr/bin/aarch64-linux-gnu-cpp \
23+
CXX=/usr/bin/aarch64-linux-gnu-g++ \
24+
LD=/usr/bin/aarch64-linux-gnu-ld \
25+
FC=/usr/bin/aarch64-linux-gnu-gfortran \
26+
PKG_CONFIG_PATH=/usr/lib/aarch64-linux-gnu/pkgconfig
27+
28+
RUN curl -sL https://deb.nodesource.com/setup_15.x | bash -
29+
RUN apt-get install -y nodejs

0 commit comments

Comments
 (0)