Skip to content

Commit 3a06196

Browse files
committed
opus use cmake and support android
1 parent 6757439 commit 3a06196

File tree

4 files changed

+28
-62
lines changed

4 files changed

+28
-62
lines changed

.github/workflows/opus.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,11 @@ jobs:
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
2026
run: .github/workflows/onestep.sh opus all

configs/libs/opus.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@
2424

2525
export LIB_NAME='opus'
2626
export LIPO_LIBS="libopus"
27-
export LIB_DEPENDS_BIN="automake autoconf libtool"
27+
export LIB_DEPENDS_BIN="cmake"
28+
export CMAKE_TARGET_NAME=opus
2829
export GIT_LOCAL_REPO=extra/opus
2930
export GIT_COMMIT=v1.5.2
3031
export REPO_DIR=opus

do-compile/android/opus.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 cmake build shell
18+
./cmake-compatible.sh

do-compile/apple/opus.sh

Lines changed: 2 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -13,65 +13,6 @@
1313
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1414
# See the License for the specific language governing permissions and
1515
# limitations under the License.
16-
#
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 --disable-doc --disable-dependency-tracking --disable-shared --enable-silent-rules --disable-extra-programs --silent"
36-
CFLAGS="-arch $MR_ARCH $MR_OTHER_CFLAGS"
37-
38-
# for cross compile
39-
if [[ $(uname -m) != "$MR_ARCH" || "$MR_FORCE_CROSS" ]];then
40-
echo "[*] cross compile, on $(uname -m) compile $MR_PLAT $MR_ARCH."
41-
# https://www.gnu.org/software/automake/manual/html_node/Cross_002dCompilation.html
42-
CFLAGS="$CFLAGS -isysroot $MR_SYS_ROOT"
43-
CFG_FLAGS="$CFG_FLAGS --host=$MR_ARCH-apple-darwin --with-sysroot=$MR_SYS_ROOT"
44-
fi
45-
46-
echo "----------------------"
47-
echo "[*] configurate $LIB_NAME"
48-
echo "----------------------"
49-
50-
cd $MR_BUILD_SOURCE
51-
52-
if [[ -f 'configure' ]]; then
53-
echo "reuse configure"
54-
else
55-
echo "auto generate configure"
56-
./autogen.sh >/dev/null
57-
fi
58-
59-
60-
echo
61-
echo "CC: $MR_CC"
62-
echo "CFG_FLAGS: $CFG_FLAGS"
63-
echo "CFLAGS: $CFLAGS"
64-
echo
65-
66-
./configure $CFG_FLAGS \
67-
CC="$MR_CC" \
68-
CFLAGS="$CFLAGS" \
69-
LDFLAGS="$CFLAGS" \
70-
>/dev/null
71-
72-
#----------------------
73-
echo "----------------------"
74-
echo "[*] compile $LIB_NAME"
75-
echo "----------------------"
7616

77-
make install -j$MR_HOST_NPROC >/dev/null
17+
# call common cmake build shell
18+
./cmake-compatible.sh

0 commit comments

Comments
 (0)