Skip to content

Commit 16d2a46

Browse files
committed
Try linux arm64 #88
1 parent 22bb231 commit 16d2a46

File tree

2 files changed

+36
-19
lines changed

2 files changed

+36
-19
lines changed

.github/workflows/build.yml

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,15 @@ jobs:
3535
- run: |
3636
echo "JAVA_HOME=$JAVA_HOME_11_arm64" >> $GITHUB_ENV
3737
echo "$JAVA_HOME_11_arm64/bin" >> $GITHUB_PATH
38+
# x64
3839
- run: python3 script/build.py --arch x64
3940
- run: python3 script/test.py
4041
- run: python3 script/package_platform.py --arch x64
4142
- uses: actions/upload-artifact@v4
4243
with:
4344
name: macos-x64-jars
4445
path: target/skija-macos-x64-*
46+
# arm64
4547
- run: python3 script/clean.py
4648
- run: python3 script/build.py --arch arm64
4749
- run: python3 script/test.py
@@ -58,12 +60,13 @@ jobs:
5860
echo "JAVA_HOME=$JAVA_HOME_11_X64" >> $GITHUB_ENV
5961
echo "$JAVA_HOME_11_X64/bin" >> $GITHUB_PATH
6062
sudo apt-get update
61-
sudo apt-get --quiet --yes install ninja-build libglu1-mesa-dev libegl-dev g\+\+-9-aarch64-linux-gnu libwayland-dev libglvnd-dev libegl1-mesa libegl1-mesa-dev
62-
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 60 --slave /usr/bin/g++ g++ /usr/bin/g++-9
63+
sudo apt-get --quiet --yes install ninja-build libglu1-mesa-dev libegl-dev g\+\+-10-aarch64-linux-gnu libwayland-dev libglvnd-dev libegl1-mesa libegl1-mesa-dev
64+
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-10 60 --slave /usr/bin/g++ g++ /usr/bin/g++-10
6365
sudo update-alternatives --config gcc
6466
- uses: actions/checkout@v5
6567
with:
6668
fetch-depth: 0
69+
# x64
6770
- run: python3 script/build.py
6871
- run: python3 script/package_shared.py
6972
- uses: actions/upload-artifact@v4
@@ -76,14 +79,14 @@ jobs:
7679
with:
7780
name: linux-x64-jars
7881
path: target/skija-linux-x64-*
79-
# Disabled until https://github.com/HumbleUI/SkiaBuild/issues/8
80-
# - run: python3 script/clean.py
81-
# - run: python3 script/build.py --arch arm64
82-
# - run: python3 script/package_platform.py --arch arm64
83-
# - uses: actions/upload-artifact@v4
84-
# with:
85-
# name: linux-arm64-jars
86-
# path: target/skija-linux-arm64-*
82+
# arm64
83+
- run: python3 script/clean.py
84+
- run: python3 script/build.py --arch arm64
85+
- run: python3 script/package_platform.py --arch arm64
86+
- uses: actions/upload-artifact@v4
87+
with:
88+
name: linux-arm64-jars
89+
path: target/skija-linux-arm64-*
8790

8891
build_windows:
8992
runs-on: windows-2022
@@ -130,10 +133,10 @@ jobs:
130133
with:
131134
name: linux-x64-jars
132135
path: target
133-
# - uses: actions/download-artifact@v4
134-
# with:
135-
# name: linux-arm64-jars
136-
# path: target
136+
- uses: actions/download-artifact@v4
137+
with:
138+
name: linux-arm64-jars
139+
path: target
137140
- uses: actions/download-artifact@v4
138141
with:
139142
name: windows-x64-jars

script/cross_compile.py

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#! /usr/bin/env python3
2-
import build_utils, subprocess
2+
import build_utils, os, subprocess
33
from typing import List
44

55
def extract_deb(url: str, name: str, native_build_dir: str):
@@ -10,7 +10,7 @@ def extract_deb(url: str, name: str, native_build_dir: str):
1010
return target
1111

1212
def setup_linux_arm64(native_build_dir: str, cmake_args: List[str]):
13-
deps_dir = f'{native_build_dir}/deps'
13+
deps_dir = os.path.abspath(f'{native_build_dir}/deps')
1414
build_utils.makedirs(deps_dir)
1515

1616
# libfreetype.so
@@ -46,10 +46,24 @@ def setup_linux_arm64(native_build_dir: str, cmake_args: List[str]):
4646
f'{deps_dir}/libfontconfig.so'
4747
)
4848

49+
# libEGL.so
50+
libegl1 = extract_deb(
51+
'http://ftp.us.debian.org/debian/pool/main/libg/libglvnd/libegl1_1.3.2-1_arm64.deb',
52+
'libegl1',
53+
native_build_dir
54+
)
55+
build_utils.copy_newer(
56+
f'{libegl1}/usr/lib/aarch64-linux-gnu/libEGL.so.1.1.0',
57+
f'{deps_dir}/libEGL.so'
58+
)
59+
4960
cmake_args += [
5061
'-DCMAKE_SYSTEM_NAME=Linux',
5162
'-DCMAKE_SYSTEM_PROCESSOR=aarch64',
52-
'-DCMAKE_C_COMPILER=/usr/bin/aarch64-linux-gnu-gcc-9',
53-
'-DCMAKE_CXX_COMPILER=/usr/bin/aarch64-linux-gnu-g++-9',
54-
'-DDEPS_DIR=' + deps_dir
63+
'-DCMAKE_C_COMPILER=/usr/bin/aarch64-linux-gnu-gcc-10',
64+
'-DCMAKE_CXX_COMPILER=/usr/bin/aarch64-linux-gnu-g++-10',
65+
'-DFREETYPE_LIBRARY=' + f'{deps_dir}/libfreetype.so',
66+
'-DFONTCONFIG_LIBRARY=' + f'{deps_dir}/libfontconfig.so',
67+
'-DSKIA_EGL_LIBRARY=' + f'{deps_dir}/libEGL.so',
68+
'-DSKIA_GL_LIBRARY=' + f'{deps_dir}/libGL.so'
5569
]

0 commit comments

Comments
 (0)