Replace the dangling jniLibs link before copying the libraries

mpv-android ships app/src/main/jniLibs as a symlink for the ABI its own
build wants, so mkdir -p fails with "File exists" when the link target
does not exist. Replace the link (or file) with a plain directory and
copy the three libraries into arm64-v8a/.
This commit is contained in:
TheM14 committed 2026-10-31 02:55:20 +08:00
1 parent c45808135d
commit 68fc020260
1 file changed
+12 -1
+12 -1
View File
@@ -166,7 +166,18 @@ jobs:
run: |
set -euo pipefail
abi=arm64-v8a
libs="$GITHUB_WORKSPACE/android/app/src/main/jniLibs/$abi"
jni="$GITHUB_WORKSPACE/android/app/src/main/jniLibs"
# The checkout carries this path as a symlink (pointing at a prefix
# directory for an ABI we do not build), and mkdir -p refuses a
# dangling link with "File exists". Replace it with a plain directory.
if [ -L "$jni" ]; then
echo "jniLibs is a symlink to $(readlink "$jni" 2>/dev/null || echo '?'); replacing it"
rm -f "$jni"
elif [ -e "$jni" ] && [ ! -d "$jni" ]; then
echo "jniLibs is a file; replacing it with a directory"
rm -f "$jni"
fi
libs="$jni/$abi"
mkdir -p "$libs"
cp "$GITHUB_WORKSPACE/android/buildscripts/prefix/arm64/lib/libmpv.so" "$libs/"
cp "$GITHUB_WORKSPACE/joc/build-android/libjoc_core.so" "$libs/"