From df2ac26f39d06dac7dd6d8654fbc65ec7bc40418 Mon Sep 17 00:00:00 2001 From: Draque Thompson Date: Thu, 19 Mar 2020 18:11:35 -0700 Subject: [PATCH] Additional work to #869 --- LICENSE.TXT | 18 +++--------------- build_image.py | 25 ++++++++++++++++--------- full_build.sh | 5 ++++- packaging_files/mac/entitlements.plist | 2 ++ 4 files changed, 25 insertions(+), 25 deletions(-) diff --git a/LICENSE.TXT b/LICENSE.TXT index 2d1e58c1..c144b534 100644 --- a/LICENSE.TXT +++ b/LICENSE.TXT @@ -2,20 +2,8 @@ MIT License Copyright 2014-2020 Draque Thompson -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/build_image.py b/build_image.py index a5198ba1..3912c827 100755 --- a/build_image.py +++ b/build_image.py @@ -11,10 +11,10 @@ ############################################################################## import datetime +import distutils.spawn import platform import os import shutil -import subprocess import sys import time import uuid @@ -45,6 +45,7 @@ # update the packager location for your OSX build OSX_INS_NAME = 'PolyGlot-Ins-Osx.dmg' +SIGN_IDENTITY = '' # set in main for timing reasons ############################### @@ -52,6 +53,7 @@ # update the packager location for your Windows build WIN_INS_NAME = 'PolyGlot-Ins-Win.exe' + ############################### # UNIVERSAL BUILD CONSTANTS # You will not need to change these @@ -61,7 +63,6 @@ POLYGLOT_VERSION = '' # set in main for timing reasons POLYGLOT_BUILD = '' # set in main for timing reasons JAVA_HOME = '' # set in main for timing reasons -SIGN_IDENTITY = '' # set in main for timing reasons IS_RELEASE = False CUR_YEAR = str(date.today().year) @@ -311,6 +312,7 @@ def imageOsx(): def distOsx(): print('Creating app image...') + command = (JAVA_HOME + '/bin/jpackage ' + '--runtime-image build/image ' + '--icon "PolyGlot.app" ' + @@ -322,13 +324,13 @@ def distOsx(): '--mac-package-name "PolyGlot" ' + '--file-associations packaging_files/mac/file_types_mac.prop ' + '--icon packaging_files/mac/PolyGlot.icns ' + - '--license-file LICENSE.TXT ' + '--app-version "' + POLYGLOT_VERSION + '"') os.system(command) # Remove the extra copy of libjli.dylib which causes notarization to fail - os.remove('PolyGlot.app/Contents/runtime/Contents/MacOS/libjli.dylib') + if(path.exists('PolyGlot.app/Contents/runtime/Contents/MacOS/libjli.dylib')): + os.remove('PolyGlot.app/Contents/runtime/Contents/MacOS/libjli.dylib') if SIGN_IDENTITY: print('Code signing app image...') @@ -344,20 +346,25 @@ def distOsx(): else: print('No code signing identity specified, app image will not be signed') - if shutil.which('dmgbuild'): + if distutils.spawn.find_executable('dmgbuild'): print('Creating distribution package...') command = ('dmgbuild ' + '-s packaging_files/mac/dmg_settings.py ' + 'PolyGlot ' + 'PolyGlot-' + POLYGLOT_VERSION + '.dmg') - + os.system(command) if copyDestination != "": copyInstaller('PolyGlot-' + POLYGLOT_VERSION + '.dmg') + else: - print('\'dmgbuild\' does not exist in PATH, distribution packaging will be skipped') - print('Run \'pip install dmgbuild\' to install it') + print('\'dmgbuild\' does not exist in PATH, distribution packaging will be skipped') + print('Run \'pip install dmgbuild\' to install it') + + # cleanup created app + if(path.exists('PolyGlot.app')): + shutil.rmtree('PolyGlot.app') ###################################### @@ -544,7 +551,7 @@ def copyInstaller(source): os.remove(failFile) os.remove(source) else: - print('Built installer missing: ' + source) + print('FAILURE: Built installer missing: ' + source) def printHelp(): print(""" diff --git a/full_build.sh b/full_build.sh index 0fc058bb..be815326 100755 --- a/full_build.sh +++ b/full_build.sh @@ -112,7 +112,10 @@ if [ "$#" -eq 0 ] || [ "$1" == "osx" ]; then git pull if [ "$BUILD_STEP" == "" ] ; then - python build_image.py -copyDestination "/Users/draque/Google Drive/Permanent_Share/PolyGlotBetas" + # Apple signature must be provided here. Must have xcode installed and pull into keychain. + python build_image.py \ + -copyDestination "/Users/draque/Google Drive/Permanent_Share/PolyGlotBetas" \ + -mac-sign-identity "Apple Development: draquemail@gmail.com (A3YEXQ2CB4)" else python build_image.py "$BUILD_STEP" -copyDestination "/Users/draque/Google Drive/Permanent_Share/PolyGlotBetas" fi diff --git a/packaging_files/mac/entitlements.plist b/packaging_files/mac/entitlements.plist index afa54db3..b61dc022 100644 --- a/packaging_files/mac/entitlements.plist +++ b/packaging_files/mac/entitlements.plist @@ -12,5 +12,7 @@ com.apple.security.cs.disable-library-validation + com.apple.security.device.audio-input +