Update to PyInstaller 6.1

This commit is contained in:
Philipp Wolfer
2023-10-31 08:40:43 +01:00
committed by Philipp Wolfer
parent 6dca3fb37a
commit 5e47d907b8
5 changed files with 16 additions and 26 deletions

View File

@@ -56,7 +56,7 @@ mv "$APP_BUNDLE.tmp" "$APP_BUNDLE"
# Mitigate libwebp vulnerability allowing for arbitrary code execution (CVE-2023-4863).
# Disable the Qt webp imageformat plugin.
rm "$APP_BUNDLE/Contents/MacOS/PyQt6/Qt6/plugins/imageformats/libqwebp.dylib"
rm "$APP_BUNDLE/Contents/Frameworks/PyQt6/Qt6/plugins/imageformats/libqwebp.dylib"
if [ "$CODESIGN" = '1' ]; then
echo "Code signing app bundle ${APP_BUNDLE}..."
@@ -81,7 +81,6 @@ fi
# Only test the app if it was codesigned, otherwise execution likely fails
if [ "$CODESIGN" = '1' ]; then
echo "Verify Picard executable works and required dependencies are bundled..."
"$APP_BUNDLE/Contents/MacOS/picard-run" --long-version --no-crash-dialog || echo "Failed running picard-run"
VERSIONS=$("$APP_BUNDLE/Contents/MacOS/picard-run" --long-version --no-crash-dialog)
echo "$VERSIONS"
@@ -89,7 +88,7 @@ if [ "$CODESIGN" = '1' ]; then
[[ $VERSIONS =~ $ASTRCMP_REGEX ]] || (echo "Failed: Build does not include astrcmp C" && false)
LIBDISCID_REGEX="libdiscid [0-9]+\.[0-9]+\.[0-9]+"
[[ $VERSIONS =~ $LIBDISCID_REGEX ]] || (echo "Failed: Build does not include libdiscid" && false)
"$APP_BUNDLE/Contents/MacOS/fpcalc" -version
"$APP_BUNDLE/Contents/Frameworks/fpcalc" -version
fi
echo "Package app bundle into DMG image..."

View File

@@ -41,20 +41,22 @@ Function FinalizePackage {
$Path
)
$InternalPath = (Join-Path -Path $Path -ChildPath _internal)
CodeSignBinary -BinaryPath (Join-Path -Path $Path -ChildPath picard.exe) -ErrorAction Stop
CodeSignBinary -BinaryPath (Join-Path -Path $Path -ChildPath fpcalc.exe) -ErrorAction Stop
CodeSignBinary -BinaryPath (Join-Path -Path $Path -ChildPath discid.dll) -ErrorAction Stop
CodeSignBinary -BinaryPath (Join-Path -Path $InternalPath -ChildPath fpcalc.exe) -ErrorAction Stop
CodeSignBinary -BinaryPath (Join-Path -Path $InternalPath -ChildPath discid.dll) -ErrorAction Stop
# Move all Qt6 DLLs into the main folder to avoid conflicts with system wide
# versions of those dependencies. Since some version PyInstaller tries to
# maintain the file hierarchy of imported modules, but this easily breaks
# DLL loading on Windows.
# Workaround for https://tickets.metabrainz.org/browse/PICARD-2736
$QtBinDir = (Join-Path -Path $Path -ChildPath PyQt6\Qt6\bin)
Move-Item -Path (Join-Path -Path $QtBinDir -ChildPath *.dll) -Destination $Path -Force
Remove-Item -Path $QtBinDir
$Qt6Dir = (Join-Path -Path $InternalPath -ChildPath PyQt6\Qt6)
Move-Item -Path (Join-Path -Path $Qt6Dir -ChildPath bin\*.dll) -Destination $Path -Force
Remove-Item -Path (Join-Path -Path $Qt6Dir -ChildPath bin)
# Mitigate libwebp vulnerability allowing for arbitrary code execution (CVE-2023-4863).
# Disable the Qt webp imageformat plugin.
Remove-Item -Path (Join-Path -Path $Path -ChildPath PyQt6\Qt6\plugins\imageformats\qwebp.dll)
Remove-Item -Path (Join-Path -Path $Qt6Dir -ChildPath plugins\imageformats\qwebp.dll)
}