Skip to content
Snippets Groups Projects
Commit 18271e16 authored by David's avatar David
Browse files

macosx: codesign: Check whether vlc-cache-gen can be executed

Check whether vlc-cache-gen can actually be executed, to
detect whether it is available for the right architecture.

If it is not available, support the possibility to not
sign the plugins.dat cache file. Also support the case
the cache file is not there from the beginning.
parent 80d4dd91
No related branches found
No related tags found
No related merge requests found
......@@ -79,13 +79,19 @@ if [ -e "./vlc-cache-gen" ]; then
VLCCACHEGEN="./vlc-cache-gen"
fi
$VLCCACHEGEN --help 1>/dev/null 2>&1 && returncode=$? || returncode=$?
if [ $returncode -ne 0 ]; then
info "WARN: Cannot execute vlc-cache-gen with path '$VLCCACHEGEN' (wrong arch?)"
VLCCACHEGEN=""
fi
if [ -z "$VLCCACHEGEN" ]; then
info "WARN: Cannot find vlc-cache-gen, cache will be corrupt after signing"
info "WARN: Cannot find vlc-cache-gen, cache will be removed for signing"
fi
SCRIPTDIR=$(dirname "$0")
if [ ! -z "$RUNTIME" ]; then
RUNTIME_FLAGS="--options runtime --entitlements $SCRIPTDIR/vlc-hardening.entitlements"
RUNTIME_FLAGS="--options runtime --entitlements $SCRIPTDIR/vlc-hardening.entitlements"
fi
# Call with $1 = file or folder
......@@ -124,10 +130,11 @@ done
if [ ! -z "$VLCCACHEGEN" ]; then
$VLCCACHEGEN VLC.app/Contents/Frameworks/plugins
sign "VLC.app/Contents/Frameworks/plugins/plugins.dat"
else
rm "VLC.app/Contents/Frameworks/plugins/plugins.dat" || true
fi
sign "VLC.app/Contents/Frameworks/plugins/plugins.dat"
info "Signing the libraries"
for i in $(find VLC.app/Contents/Frameworks -type f -name "*.dylib" -d 1 -exec echo {} \;)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment