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

David Fuhrmann git at videolan.org
Mon Dec 14 19:26:34 UTC 2020


vlc | branch: master | David Fuhrmann <dfuhrmann at videolan.org> | Mon Dec 14 20:22:24 2020 +0100| [18271e16182312cc2d0a80848d562e52efc2ebf8] | committer: David Fuhrmann

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.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=18271e16182312cc2d0a80848d562e52efc2ebf8
---

 extras/package/macosx/codesign.sh | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/extras/package/macosx/codesign.sh b/extras/package/macosx/codesign.sh
index 22f6cbb61a..3d6e796aad 100755
--- a/extras/package/macosx/codesign.sh
+++ b/extras/package/macosx/codesign.sh
@@ -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 {} \;)



More information about the vlc-commits mailing list