Skip to content

Commit

Permalink
Additional work to #869
Browse files Browse the repository at this point in the history
  • Loading branch information
Draque Thompson committed Mar 20, 2020
1 parent 3eaa5ed commit 9ec609b
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 25 deletions.
18 changes: 3 additions & 15 deletions LICENSE.TXT
Original file line number Diff line number Diff line change
Expand Up @@ -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.
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.
25 changes: 16 additions & 9 deletions build_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
##############################################################################

import datetime
import distutils.spawn
import platform
import os
import shutil
import subprocess
import sys
import time
import uuid
Expand Down Expand Up @@ -45,13 +45,15 @@

# update the packager location for your OSX build
OSX_INS_NAME = 'PolyGlot-Ins-Osx.dmg'
SIGN_IDENTITY = '' # set in main for timing reasons


###############################
# WINDOWS BUILD CONSTANTS
# 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
Expand All @@ -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)

Expand Down Expand Up @@ -311,6 +312,7 @@ def imageOsx():

def distOsx():
print('Creating app image...')

command = (JAVA_HOME + '/bin/jpackage ' +
'--runtime-image build/image ' +
'--icon "PolyGlot.app" ' +
Expand All @@ -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...')
Expand All @@ -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')


######################################
Expand Down Expand Up @@ -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("""
Expand Down
5 changes: 4 additions & 1 deletion full_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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: [email protected] (A3YEXQ2CB4)"
else
python build_image.py "$BUILD_STEP" -copyDestination "/Users/draque/Google Drive/Permanent_Share/PolyGlotBetas"
fi
Expand Down
2 changes: 2 additions & 0 deletions packaging_files/mac/entitlements.plist
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,7 @@
<true/>
<key>com.apple.security.cs.disable-library-validation</key>
<true/>
<key>com.apple.security.device.audio-input</key>
<true/>
</dict>
</plist>

0 comments on commit 9ec609b

Please sign in to comment.