Skip to content

Commit 6e28b25

Browse files
committed
freetype and harbuzz support android
1 parent 8632d65 commit 6e28b25

File tree

7 files changed

+80
-126
lines changed

7 files changed

+80
-126
lines changed

.github/workflows/freetype.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,24 @@ on:
55
pull_request:
66
branches: [master]
77

8-
name: Create freetype Release
8+
name: Freetype
99

1010
jobs:
1111
build:
12-
name: compile freetype then deploy
12+
name: compile apple and android freetype then deploy
1313
runs-on: macos-14
1414
env:
1515
GH_TOKEN: ${{ github.token }}
1616
steps:
1717
- name: Checkout code
1818
uses: actions/checkout@v4
19+
- uses: nttld/setup-ndk@v1
20+
id: setup-ndk
21+
with:
22+
ndk-version: r21e
23+
add-to-path: false
24+
local-cache: true
1925
- name: One Step
20-
run: .github/workflows/onestep.sh freetype all
26+
run: .github/workflows/onestep.sh yuv all
27+
env:
28+
ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }}

.github/workflows/harfbuzz.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,23 @@ on:
55
pull_request:
66
branches: [master]
77

8-
name: Create harfbuzz Release
8+
name: Harfbuzz
99

1010
jobs:
1111
build:
12-
name: compile harfbuzz then deploy
12+
name: compile apple and android harfbuzz then deploy
1313
runs-on: macos-14
1414
env:
1515
GH_TOKEN: ${{ github.token }}
1616
steps:
1717
- name: Checkout code
1818
uses: actions/checkout@v4
19+
- uses: nttld/setup-ndk@v1
20+
id: setup-ndk
21+
with:
22+
ndk-version: r21e
23+
add-to-path: false
24+
local-cache: true
1925
- name: Install denpendencies
2026
run: |
2127
./main.sh install -p ios -l 'freetype'

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ Tips:
159159
| ----------- | ---------------------------------------------------- | ------ | -------------------------------------------------------- |
160160
| libass | https://github.com/libass/libass.git | 0.17.3 | export GIT_ASS_UPSTREAM = git@xx:yy/libass.git |
161161
| libbluray | https://code.videolan.org/videolan/libbluray.git | 1.3.4 | export GIT_BLURAY_UPSTREAM = git@xx:yy/libbluray.git |
162-
| dav1d | https://code.videolan.org/videolan/dav1d.git | 1.5.0 | export GIT_DAV1D_UPSTREAM = git@xx:yy/dav1d.git |
162+
| dav1d | https://code.videolan.org/videolan/dav1d.git | 1.5.1 | export GIT_DAV1D_UPSTREAM = git@xx:yy/dav1d.git |
163163
| libdvdread | https://code.videolan.org/videolan/libdvdread.git | 6.1.3 | export GIT_DVDREAD_UPSTREAM = git@xx:yy/libdvdread.git |
164164
| FFmpeg | https://github.com/FFmpeg/FFmpeg.git | 6.1.2 | export GIT_FFMPEG_UPSTREAM = git@xx:yy/FFmpeg.git |
165165
| freetype | https://gitlab.freedesktop.org/freetype/freetype.git | 2.13.3 | export GIT_FREETYPE_UPSTREAM = git@xx:yy/freetype.git |

do-compile/android/freetype.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#! /usr/bin/env bash
2+
#
3+
# Copyright (C) 2021 Matt Reach<[email protected]>
4+
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
#
17+
# call common meson build shell
18+
./meson-compatible.sh "-Dpng=disabled -Dharfbuzz=disabled"

do-compile/android/harfbuzz.sh

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
#! /usr/bin/env bash
2+
#
3+
# Copyright (C) 2021 Matt Reach<[email protected]>
4+
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
#
17+
# https://github.com/harfbuzz/harfbuzz/blob/main/BUILD.md
18+
19+
# https://trac.macports.org/ticket/60987
20+
21+
set -e
22+
23+
CFG_FLAGS="-Ddocs=disabled -Dcairo=disabled -Dchafa=disabled -Dtests=disabled"
24+
25+
echo "----------------------"
26+
echo "[*] check freetype"
27+
28+
pkg-config --libs freetype2 --silence-errors >/dev/null && enable_freetype2=1
29+
30+
if [[ $enable_freetype2 ]];then
31+
echo "[*] --enable-freetype"
32+
CFG_FLAGS="$CFG_FLAGS -Dfreetype=enabled"
33+
else
34+
echo "[*] --disable-freetype"
35+
CFG_FLAGS="$CFG_FLAGS -Dfreetype=disabled"
36+
fi
37+
38+
./meson-compatible.sh "$CFG_FLAGS"

do-compile/apple/freetype.sh

Lines changed: 2 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -14,67 +14,5 @@
1414
# See the License for the specific language governing permissions and
1515
# limitations under the License.
1616
#
17-
18-
set -e
19-
20-
THIS_DIR=$(DIRNAME=$(dirname "$0"); cd "$DIRNAME"; pwd)
21-
cd "$THIS_DIR"
22-
23-
echo "=== [$0] check env begin==="
24-
env_assert "MR_ARCH"
25-
env_assert "MR_BUILD_NAME"
26-
env_assert "MR_CC"
27-
env_assert "MR_BUILD_SOURCE"
28-
env_assert "MR_BUILD_PREFIX"
29-
env_assert "MR_SYS_ROOT"
30-
env_assert "MR_HOST_NPROC"
31-
echo "MR_DEBUG:$MR_DEBUG"
32-
echo "===check env end==="
33-
34-
# prepare build config
35-
CFG_FLAGS="--prefix=$MR_BUILD_PREFIX --default-library static -Dpng=disabled -Dharfbuzz=disabled"
36-
37-
if [[ "$MR_DEBUG" == "debug" ]]; then
38-
CFG_FLAGS="$CFG_FLAGS --buildtype=debug"
39-
else
40-
CFG_FLAGS="$CFG_FLAGS --buildtype=release"
41-
fi
42-
43-
cd $MR_BUILD_SOURCE
44-
export CC="$MR_CC"
45-
export CXX="$MR_CXX"
46-
47-
if [[ $(uname -m) != "$MR_ARCH" || "$MR_FORCE_CROSS" ]]; then
48-
if [[ $MR_IS_SIMULATOR != 1 ]]; then
49-
echo "[*] cross compile, on $(uname -m) compile $MR_PLAT $MR_ARCH."
50-
CFG_FLAGS="$CFG_FLAGS --cross-file $MR_SHELL_CONFIGS_DIR/meson-crossfiles/$MR_ARCH-$MR_PLAT.meson"
51-
else
52-
echo "[*] cross compile, on $(uname -m) compile $MR_PLAT $MR_ARCH simulator."
53-
CFG_FLAGS="$CFG_FLAGS --cross-file $MR_SHELL_CONFIGS_DIR/meson-crossfiles/$MR_ARCH-$MR_PLAT-simulator.meson"
54-
fi
55-
fi
56-
57-
echo "----------------------"
58-
echo "[*] compile $LIB_NAME"
59-
echo "CC: $MR_CC"
60-
echo "CFG_FLAGS: $CFG_FLAGS"
61-
echo "----------------------"
62-
echo
63-
64-
build=./build-$MR_ARCH
65-
if [[ -d $build ]]; then
66-
rm -rf $build
67-
fi
68-
69-
meson setup $build $CFG_FLAGS
70-
71-
#cat $MR_BUILD_SOURCE/build-$MR_ARCH/meson-logs/meson-log.txt
72-
73-
cd $build
74-
75-
echo "compile"
76-
77-
meson compile && meson install
78-
79-
# ninja -C build
80-
# ninja -C build install
17+
# call common meson build shell
18+
./meson-compatible.sh "-Dpng=disabled -Dharfbuzz=disabled"

do-compile/apple/harfbuzz.sh

Lines changed: 2 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -20,27 +20,7 @@
2020

2121
set -e
2222

23-
THIS_DIR=$(DIRNAME=$(dirname "$0"); cd "$DIRNAME"; pwd)
24-
cd "$THIS_DIR"
25-
26-
echo "=== [$0] check env begin==="
27-
env_assert "MR_ARCH"
28-
env_assert "MR_BUILD_NAME"
29-
env_assert "MR_CC"
30-
env_assert "MR_BUILD_SOURCE"
31-
env_assert "MR_BUILD_PREFIX"
32-
env_assert "MR_SYS_ROOT"
33-
env_assert "MR_HOST_NPROC"
34-
echo "MR_DEBUG:$MR_DEBUG"
35-
echo "===check env end==="
36-
# prepare build config
37-
CFG_FLAGS="--prefix=$MR_BUILD_PREFIX --default-library static -Ddocs=disabled -Dcairo=disabled -Dchafa=disabled -Dtests=disabled"
38-
39-
if [[ "$MR_DEBUG" == "debug" ]]; then
40-
CFG_FLAGS="$CFG_FLAGS --buildtype=debug"
41-
else
42-
CFG_FLAGS="$CFG_FLAGS --buildtype=release"
43-
fi
23+
CFG_FLAGS="-Ddocs=disabled -Dcairo=disabled -Dchafa=disabled -Dtests=disabled"
4424

4525
echo "----------------------"
4626
echo "[*] check freetype"
@@ -55,38 +35,4 @@ else
5535
CFG_FLAGS="$CFG_FLAGS -Dfreetype=disabled"
5636
fi
5737

58-
cd $MR_BUILD_SOURCE
59-
export CC="$MR_CC"
60-
export CXX="$MR_CXX"
61-
62-
if [[ $(uname -m) != "$MR_ARCH" || "$MR_FORCE_CROSS" ]]; then
63-
if [[ $MR_IS_SIMULATOR != 1 ]]; then
64-
echo "[*] cross compile, on $(uname -m) compile $MR_PLAT $MR_ARCH."
65-
CFG_FLAGS="$CFG_FLAGS --cross-file $MR_SHELL_CONFIGS_DIR/meson-crossfiles/$MR_ARCH-$MR_PLAT.meson"
66-
else
67-
echo "[*] cross compile, on $(uname -m) compile $MR_PLAT $MR_ARCH simulator."
68-
CFG_FLAGS="$CFG_FLAGS --cross-file $MR_SHELL_CONFIGS_DIR/meson-crossfiles/$MR_ARCH-$MR_PLAT-simulator.meson"
69-
fi
70-
fi
71-
72-
echo "----------------------"
73-
echo "[*] compile $LIB_NAME"
74-
echo "CC: $MR_CC"
75-
echo "CFG_FLAGS: $CFG_FLAGS"
76-
echo "----------------------"
77-
echo
78-
79-
build=./build-$MR_ARCH
80-
if [[ -d $build ]]; then
81-
rm -rf $build
82-
fi
83-
84-
# show all configure
85-
# https://mesonbuild.com/Build-options.html
86-
meson setup $build $CFG_FLAGS
87-
88-
cd $build
89-
90-
echo "compile"
91-
92-
meson compile && meson install
38+
./meson-compatible.sh "$CFG_FLAGS"

0 commit comments

Comments
 (0)