mirror of
https://github.com/fergalmoran/picard.git
synced 2025-12-22 09:18:18 +00:00
Update to PyInstaller 6.1
This commit is contained in:
committed by
Philipp Wolfer
parent
6dca3fb37a
commit
5e47d907b8
@@ -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..."
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user