-
Notifications
You must be signed in to change notification settings - Fork 1
176 lines (156 loc) · 6.45 KB
/
Copy pathbuild-free-https-gpl.yml
File metadata and controls
176 lines (156 loc) · 6.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
name: Build 6.0 LTS (Free Https GPL variant — Maven alias source)
# Produces the binary published under the Maven Central alias
# ffmpeg-kit-https-gpl — see build-81-free-https-gpl.yml's header for the
# full rationale. NOT rubberband — Arthenica's original GPL tiers never
# included it.
on:
workflow_dispatch:
jobs:
build:
name: Build ffmpeg-kit 6.0 LTS (free-https-gpl, arm64-v8a + x86_64)
runs-on: ubuntu-24.04
timeout-minutes: 180
defaults:
run:
shell: bash
working-directory: android-6.0-lts
steps:
- name: Checkout
uses: actions/checkout@v7
with:
submodules: recursive
- name: Set up JDK 17
uses: actions/setup-java@v6
with:
distribution: temurin
java-version: "17"
- name: Install build prerequisites
run: |
sudo apt-get update
sudo apt-get install -y \
autoconf automake libtool pkg-config curl git \
build-essential yasm nasm gperf texinfo bison ragel \
python3 python3-pip unzip zip wget meson ninja-build \
doxygen cmake autogen autopoint groff gtk-doc-tools libtasn1-bin
- name: Install Android platform 35
run: |
set +o pipefail
yes | "${ANDROID_HOME}"/cmdline-tools/latest/bin/sdkmanager --licenses >/dev/null
set -o pipefail
"${ANDROID_HOME}"/cmdline-tools/latest/bin/sdkmanager "platforms;android-35"
- name: Cache Android NDK r26c
id: cache-ndk
uses: actions/cache@v6
with:
path: ~/.ndk
key: ndk-r26c-linux
- name: Download Android NDK r26c
if: steps.cache-ndk.outputs.cache-hit != 'true'
run: |
curl -s "https://dl.google.com/android/repository/android-ndk-r26c-linux.zip" -o ndk.zip
unzip -q -o ndk.zip -d "${HOME}/.ndk"
- name: Export ANDROID_NDK_ROOT
run: echo "ANDROID_NDK_ROOT=${HOME}/.ndk/$(ls "${HOME}/.ndk")" >> "$GITHUB_ENV"
- name: Restore latest build checkpoint from ci-cache-free-https-gpl branch
run: |
if git ls-remote --exit-code --heads origin ci-cache-free-https-gpl >/dev/null 2>&1; then
echo "Found ci-cache-free-https-gpl branch, restoring prebuilt/ and src/ from it"
git fetch --depth=1 origin ci-cache-free-https-gpl
git archive FETCH_HEAD | tar -x
echo "Restored:"
find prebuilt src -maxdepth 2 -type d 2>/dev/null | sort || true
else
echo "No ci-cache-free-https-gpl branch yet - starting fresh"
fi
- name: Build free-https-gpl variant (arm64-v8a + x86_64)
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
touch build.log
set +e
./android.sh --enable-gnutls --enable-gmp \
--enable-gpl --enable-x264 --enable-x265 --enable-xvidcore --enable-libvidstab \
--enable-android-media-codec --enable-android-zlib \
--disable-arm-v7a --disable-arm-v7a-neon --disable-x86
BUILD_EXIT=$?
exit "$BUILD_EXIT"
- name: Print build log on failure
if: failure() || cancelled()
run: cat build.log || echo "no build.log produced (failed before the build step ran)"
- name: Print ffbuild config log on failure
if: failure() || cancelled()
run: '[[ -f ./src/ffmpeg/ffbuild/config.log ]] && tail -100 ./src/ffmpeg/ffbuild/config.log || true'
- name: Print toolchain env and per-library config logs on failure
if: failure() || cancelled()
run: |
echo "=== toolchain env ==="
echo "CC=$CC"
echo "CXX=$CXX"
echo "AR=$AR"
echo "AS=$AS"
echo "LD=$LD"
echo "STRIP=$STRIP"
echo "RANLIB=$RANLIB"
echo "CFLAGS=$CFLAGS"
echo "CXXFLAGS=$CXXFLAGS"
echo "LDFLAGS=$LDFLAGS"
echo "ANDROID_NDK_ROOT=$ANDROID_NDK_ROOT"
echo
echo "=== config.log files under src/ (most recently modified first) ==="
while IFS= read -r log; do
echo "--- $log ---"
tail -150 "$log"
echo
done < <(find src -iname "config.log" -printf '%T@ %p\n' 2>/dev/null | sort -rn | cut -d' ' -f2- | head -3)
- name: Verify 16 KB page size alignment
run: |
set -e
fail=0
while IFS= read -r so; do
min_exp=99
while IFS= read -r exp; do
[[ -z "$exp" ]] && continue
(( exp < min_exp )) && min_exp=$exp
done < <(objdump -p "$so" | grep -A1 LOAD | grep -oE 'align 2\*\*[0-9]+' | grep -oE '[0-9]+$')
echo "$so: align=2**${min_exp}"
if (( min_exp < 14 )); then
echo "::error file=${so}::not 16 KB aligned (got 2**${min_exp})"
fail=1
fi
done < <(find prebuilt -name "*.so")
exit "$fail"
- name: Verify tier content matches "https-gpl" exactly (binary check)
run: |
set -e
fail=0
echo "=== Negative: out-of-scope strings must be ABSENT ==="
for term in tesseract leptonica chromaprint whisper ggml libass rubberband; do
hits=$(grep -a -il -- "$term" $(find prebuilt -name "*.so") 2>/dev/null || true)
if [[ -n "$hits" ]]; then
echo "::error::found '$term' in: $hits (must not be in https-gpl)"
fail=1
else
echo "OK: '$term' absent"
fi
done
if find prebuilt -iname "*whisper*" | grep -q .; then
echo "::error::a libwhisperkit*.so file is present — must not be in a Free build"
fail=1
fi
echo "=== Positive: gnutls + mediacodec + GPL encoders must be PRESENT ==="
for term in gnutls mediacodec x264 x265 xvid; do
hits=$(grep -a -il -- "$term" $(find prebuilt -name "*.so") 2>/dev/null || true)
if [[ -z "$hits" ]]; then
echo "::error::'$term' not found in any .so — https-gpl build is incomplete"
fail=1
else
echo "OK: '$term' present in: $hits"
fi
done
exit "$fail"
- name: Upload AAR artifact
uses: actions/upload-artifact@v7
with:
name: ffmpeg-kit-free-https-gpl-arm64-v8a-x86_64
path: android-6.0-lts/prebuilt/bundle-android-aar/ffmpeg-kit/ffmpeg-kit.aar
retention-days: 3