mirror of
https://github.com/onionshare/onionshare.git
synced 2025-01-28 07:17:15 -05:00
Updated OSX codesigning code for PyInstaller
This commit is contained in:
parent
55b653d3d2
commit
08c5e720ae
@ -12,21 +12,12 @@ echo Building OnionShare.app
|
|||||||
pyinstaller install/pyinstaller-osx.spec
|
pyinstaller install/pyinstaller-osx.spec
|
||||||
|
|
||||||
if [ "$1" = "--sign" ]; then
|
if [ "$1" = "--sign" ]; then
|
||||||
SIGNING_IDENTITY_APP="Developer ID Application: Micah Lee"
|
SIGNING_IDENTITY_APP="3rd Party Mac Developer Application: Micah Lee"
|
||||||
SIGNING_IDENTITY_INSTALLER="Developer ID Installer: Micah Lee"
|
SIGNING_IDENTITY_INSTALLER="3rd Party Mac Developer Installer: Micah Lee"
|
||||||
|
|
||||||
# codesign the .app
|
# codesign the .app
|
||||||
python3 $ROOT/install/prepare_for_codesign.py
|
codesign -vvvv --deep -s "$SIGNING_IDENTITY_APP" dist/OnionShare.app
|
||||||
cd dist
|
|
||||||
|
|
||||||
# for some reason --deep fails, so sign each binary individually
|
# build .pkg
|
||||||
codesign -vvvv -s "Developer ID Application: Micah Lee" OnionShare.app/Contents/Frameworks/QtCore.framework
|
productbuild --component dist/OnionShare.app /Applications dist/OnionShare.pkg --sign "$SIGNING_IDENTITY_INSTALLER"
|
||||||
codesign -vvvv -s "Developer ID Application: Micah Lee" OnionShare.app/Contents/Frameworks/QtGui.framework
|
|
||||||
codesign -vvvv -s "Developer ID Application: Micah Lee" OnionShare.app/Contents/Frameworks/Python.framework
|
|
||||||
codesign -vvvv -s "Developer ID Application: Micah Lee" OnionShare.app/Contents/Frameworks/libssl.1.0.0.dylib
|
|
||||||
codesign -vvvv -s "Developer ID Application: Micah Lee" OnionShare.app/Contents/Frameworks/libcrypto.1.0.0.dylib
|
|
||||||
codesign -vvvv -s "Developer ID Application: Micah Lee" OnionShare.app/Contents/MacOS/python
|
|
||||||
codesign -vvvv -s "Developer ID Application: Micah Lee" OnionShare.app
|
|
||||||
|
|
||||||
productbuild --component OnionShare.app /Applications OnionShare.pkg --sign "$SIGNING_IDENTITY_INSTALLER"
|
|
||||||
fi
|
fi
|
||||||
|
@ -1,36 +0,0 @@
|
|||||||
"""
|
|
||||||
This script is from https://github.com/kamillus/py2app-pyqt-codesign-fix-os-x
|
|
||||||
and slightly modified.
|
|
||||||
"""
|
|
||||||
|
|
||||||
import os
|
|
||||||
import re
|
|
||||||
import shutil
|
|
||||||
|
|
||||||
path_to_app = "dist/OnionShare.app"
|
|
||||||
|
|
||||||
def move_func(file):
|
|
||||||
print("moving %s to %s " % (os.path.join(dir_name, file), os.path.join(dir_name, 'Versions', "Current")))
|
|
||||||
try:
|
|
||||||
shutil.move(os.path.join(dir_name, file), os.path.join(dir_name, 'Versions', "Current"))
|
|
||||||
except Exception as e:
|
|
||||||
print(e)
|
|
||||||
return file
|
|
||||||
|
|
||||||
def filter_func(x):
|
|
||||||
return x != "Versions"
|
|
||||||
|
|
||||||
|
|
||||||
dir = path_to_app + "/Contents/Frameworks/"
|
|
||||||
p = re.compile('^Qt(.+)\.framework$')
|
|
||||||
|
|
||||||
for dir_name, subdir_list, file_list in os.walk(dir):
|
|
||||||
dir_name_short = dir_name.replace(dir, "")
|
|
||||||
|
|
||||||
if p.match(dir_name_short):
|
|
||||||
print('Found directory: %s' % dir_name_short)
|
|
||||||
print(file_list)
|
|
||||||
if os.path.islink(os.path.join(dir_name, file_list[0])):
|
|
||||||
os.unlink(os.path.join(dir_name, file_list[0]))
|
|
||||||
list(map(move_func, file_list[1:]))
|
|
||||||
list(map(move_func, filter(filter_func, subdir_list)))
|
|
Loading…
x
Reference in New Issue
Block a user