mirror of
https://gitlab.com/openlp/packaging.git
synced 2024-12-22 21:12:50 +00:00
Final changes to improve and cleanup build process for osx:
- fix setting dmg icon, dmg background - remove old files - cleanup build script - fix paths bzr-revno: 2
This commit is contained in:
commit
6d2290ae49
0
osx/DmgImageInstallBackground.png
Executable file → Normal file
0
osx/DmgImageInstallBackground.png
Executable file → Normal file
Before Width: | Height: | Size: 48 KiB After Width: | Height: | Size: 48 KiB |
28
osx/Makefile
28
osx/Makefile
@ -1,28 +0,0 @@
|
|||||||
all:
|
|
||||||
python build.py -c openlp.cfg
|
|
||||||
|
|
||||||
view:
|
|
||||||
python build.py -c openlp.cfg --package-view --compress-view
|
|
||||||
|
|
||||||
package:
|
|
||||||
|
|
||||||
python build.py -c openlp.cfg --package --package-view
|
|
||||||
|
|
||||||
bundle:
|
|
||||||
|
|
||||||
python build.py -c openlp.cfg --compress --compress-view
|
|
||||||
|
|
||||||
clean:
|
|
||||||
# remove old configuration files
|
|
||||||
rm -f openlp.spec
|
|
||||||
rm -f Info.plist
|
|
||||||
rm -f .version
|
|
||||||
|
|
||||||
# remove old build artifacts
|
|
||||||
rm -rf build
|
|
||||||
rm -rf dist
|
|
||||||
rm -rf Macopenlp.app
|
|
||||||
rm -rf OpenLP.app
|
|
||||||
rm -f warnopenlp.txt
|
|
||||||
rm -f *dmg
|
|
||||||
|
|
@ -1,43 +1,6 @@
|
|||||||
on saveImageWithItselfAsIcon(icon_image_file)
|
|
||||||
-- save icon_image_file with itself as icon
|
|
||||||
set icon_image_file_string to icon_image_file as string
|
|
||||||
tell application "Image Events"
|
|
||||||
launch
|
|
||||||
set icon_image to open file icon_image_file_string
|
|
||||||
save icon_image with icon
|
|
||||||
close icon_image
|
|
||||||
end tell
|
|
||||||
end saveImageWithItselfAsIcon
|
|
||||||
|
|
||||||
on copyIconOfTo(aFileOrFolderWithIcon, aFileOrFolder)
|
|
||||||
tell application "Finder" to set f to aFileOrFolderWithIcon as alias
|
|
||||||
-- grab the file's icon
|
|
||||||
my CopyOrPaste(f, "c")
|
|
||||||
-- now the icon is in the clipboard
|
|
||||||
tell application "Finder" to set c to aFileOrFolder as alias
|
|
||||||
my CopyOrPaste(result, "v")
|
|
||||||
end copyIconOfTo
|
|
||||||
|
|
||||||
on CopyOrPaste(i, cv)
|
|
||||||
tell application "Finder"
|
|
||||||
activate
|
|
||||||
set infoWindow to open information window of i
|
|
||||||
set infoWindowName to name of infoWindow
|
|
||||||
end tell
|
|
||||||
tell application "System Events" to tell process "Finder" to tell window infoWindowName
|
|
||||||
keystroke tab -- select icon button
|
|
||||||
keystroke (cv & "w") using command down (* (copy or paste) + close window *)
|
|
||||||
end tell -- window 1 then process Finder then System Events
|
|
||||||
end CopyOrPaste
|
|
||||||
|
|
||||||
on run
|
on run
|
||||||
set icon_image_file to POSIX file "%s" as alias
|
|
||||||
set dmg_file to POSIX file "/Volumes/%s" as alias
|
|
||||||
|
|
||||||
my saveImageWithItselfAsIcon(icon_image_file)
|
|
||||||
-- wait for virus scanner
|
-- wait for virus scanner
|
||||||
delay 2
|
delay 2
|
||||||
my copyIconOfTo(icon_image_file, dmg_file)
|
|
||||||
|
|
||||||
tell application "Finder"
|
tell application "Finder"
|
||||||
tell disk "%s"
|
tell disk "%s"
|
@ -1,74 +0,0 @@
|
|||||||
on saveImageWithItselfAsIcon(icon_image_file)
|
|
||||||
-- save icon_image_file with itself as icon
|
|
||||||
set icon_image_file_string to icon_image_file as string
|
|
||||||
tell application "Image Events"
|
|
||||||
launch
|
|
||||||
set icon_image to open file icon_image_file_string
|
|
||||||
save icon_image with icon
|
|
||||||
close icon_image
|
|
||||||
end tell
|
|
||||||
end saveImageWithItselfAsIcon
|
|
||||||
|
|
||||||
on copyIconOfTo(aFileOrFolderWithIcon, aFileOrFolder)
|
|
||||||
tell application "Finder" to set f to aFileOrFolderWithIcon as alias
|
|
||||||
-- grab the file's icon
|
|
||||||
my CopyOrPaste(f, "c")
|
|
||||||
-- now the icon is in the clipboard
|
|
||||||
tell application "Finder" to set c to aFileOrFolder as alias
|
|
||||||
my CopyOrPaste(result, "v")
|
|
||||||
end copyIconOfTo
|
|
||||||
|
|
||||||
on CopyOrPaste(i, cv)
|
|
||||||
tell application "Finder"
|
|
||||||
activate
|
|
||||||
open information window of i
|
|
||||||
end tell
|
|
||||||
tell application "System Events" to tell process "Finder" to tell window 1
|
|
||||||
keystroke tab -- select icon button
|
|
||||||
keystroke (cv & "w") using command down (* (copy or paste) + close window *)
|
|
||||||
end tell -- window 1 then process Finder then System Events
|
|
||||||
end CopyOrPaste
|
|
||||||
|
|
||||||
on run
|
|
||||||
set icon_image_file to POSIX file "%s" as alias
|
|
||||||
set dmg_file to POSIX file "/Volumes/%s" as alias
|
|
||||||
|
|
||||||
my saveImageWithItselfAsIcon(icon_image_file)
|
|
||||||
-- wait for virus scanner
|
|
||||||
delay 2
|
|
||||||
my copyIconOfTo(icon_image_file, dmg_file)
|
|
||||||
|
|
||||||
tell application "Finder"
|
|
||||||
tell disk "%s"
|
|
||||||
open
|
|
||||||
set current view of container window to icon view
|
|
||||||
set toolbar visible of container window to false
|
|
||||||
set statusbar visible of container window to false
|
|
||||||
set the bounds of container window to {400, 100, 1100, 500}
|
|
||||||
set theViewOptions to the icon view options of container window
|
|
||||||
set arrangement of theViewOptions to not arranged
|
|
||||||
set icon size of theViewOptions to 128
|
|
||||||
set background picture of theViewOptions to file ".background:installer-background.png"
|
|
||||||
if not exists file "Applications" then
|
|
||||||
make new alias file at container window to POSIX file "/Applications" with properties {name:"Applications"}
|
|
||||||
end if
|
|
||||||
delay 5
|
|
||||||
set position of item "%s" of container window to {160, 200}
|
|
||||||
set position of item ".Trashes" of container window to {100, 500}
|
|
||||||
set position of item ".installer-background.png" of container window to {200, 500}
|
|
||||||
set position of item ".DS_Store" of container window to {400, 500}
|
|
||||||
set position of item "Applications" of container window to {550, 200}
|
|
||||||
set position of item ".VolumeIcon.icns" of container window to {500, 500}
|
|
||||||
set position of item ".fseventsd" of container window to {300, 500}
|
|
||||||
if exists POSIX file ".SymAVx86QSFile" then
|
|
||||||
set position of item ".SymAVx86QSFile" of container window to {600, 500}
|
|
||||||
end if
|
|
||||||
open
|
|
||||||
close
|
|
||||||
update without registering applications
|
|
||||||
-- wait until the virus scan completes
|
|
||||||
delay 5
|
|
||||||
-- eject
|
|
||||||
end tell
|
|
||||||
end tell
|
|
||||||
end run
|
|
@ -1,40 +0,0 @@
|
|||||||
on saveImageWithItselfAsIcon(icon_image_file)
|
|
||||||
-- save icon_image_file with itself as icon
|
|
||||||
set icon_image_file_string to icon_image_file as string
|
|
||||||
tell application "Image Events"
|
|
||||||
launch
|
|
||||||
set icon_image to open file icon_image_file_string
|
|
||||||
save icon_image with icon
|
|
||||||
close icon_image
|
|
||||||
end tell
|
|
||||||
end saveImageWithItselfAsIcon
|
|
||||||
|
|
||||||
on copyIconOfTo(aFileOrFolderWithIcon, aFileOrFolder)
|
|
||||||
tell application "Finder" to set f to aFileOrFolderWithIcon as alias
|
|
||||||
-- grab the file's icon
|
|
||||||
my CopyOrPaste(f, "c")
|
|
||||||
-- now the icon is in the clipboard
|
|
||||||
tell application "Finder" to set c to aFileOrFolder as alias
|
|
||||||
my CopyOrPaste(result, "v")
|
|
||||||
end copyIconOfTo
|
|
||||||
|
|
||||||
on CopyOrPaste(i, cv)
|
|
||||||
tell application "Finder"
|
|
||||||
activate
|
|
||||||
open information window of i
|
|
||||||
end tell
|
|
||||||
tell application "System Events" to tell process "Finder" to tell window 1
|
|
||||||
keystroke tab -- select icon button
|
|
||||||
keystroke (cv & "w") using command down (* (copy or paste) + close window *)
|
|
||||||
end tell -- window 1 then process Finder then System Events
|
|
||||||
end CopyOrPaste
|
|
||||||
|
|
||||||
on run
|
|
||||||
set icon_image_file to POSIX file "%s" as alias
|
|
||||||
set dmg_file to POSIX file "%s" as alias
|
|
||||||
|
|
||||||
my saveImageWithItselfAsIcon(icon_image_file)
|
|
||||||
-- wait for virus scanner
|
|
||||||
delay 2
|
|
||||||
my copyIconOfTo(icon_image_file, dmg_file)
|
|
||||||
end run
|
|
@ -1,41 +0,0 @@
|
|||||||
on saveImageWithItselfAsIcon(icon_image_file)
|
|
||||||
-- save icon_image_file with itself as icon
|
|
||||||
set icon_image_file_string to icon_image_file as string
|
|
||||||
tell application "Image Events"
|
|
||||||
launch
|
|
||||||
set icon_image to open file icon_image_file_string
|
|
||||||
save icon_image with icon
|
|
||||||
close icon_image
|
|
||||||
end tell
|
|
||||||
end saveImageWithItselfAsIcon
|
|
||||||
|
|
||||||
on copyIconOfTo(aFileOrFolderWithIcon, aFileOrFolder)
|
|
||||||
tell application "Finder" to set f to aFileOrFolderWithIcon as alias
|
|
||||||
-- grab the file's icon
|
|
||||||
my CopyOrPaste(f, "c")
|
|
||||||
-- now the icon is in the clipboard
|
|
||||||
tell application "Finder" to set c to aFileOrFolder as alias
|
|
||||||
my CopyOrPaste(result, "v")
|
|
||||||
end copyIconOfTo
|
|
||||||
|
|
||||||
on CopyOrPaste(i, cv)
|
|
||||||
tell application "Finder"
|
|
||||||
activate
|
|
||||||
set infoWindow to open information window of i
|
|
||||||
set infoWindowName to name of infoWindow
|
|
||||||
end tell
|
|
||||||
tell application "System Events" to tell process "Finder" to tell window infoWindowName
|
|
||||||
keystroke tab -- select icon button
|
|
||||||
keystroke (cv & "w") using command down (* (copy or paste) + close window *)
|
|
||||||
end tell -- window 1 then process Finder then System Events
|
|
||||||
end CopyOrPaste
|
|
||||||
|
|
||||||
on run
|
|
||||||
set icon_image_file to POSIX file "%s" as alias
|
|
||||||
set dmg_file to POSIX file "%s" as alias
|
|
||||||
|
|
||||||
my saveImageWithItselfAsIcon(icon_image_file)
|
|
||||||
-- wait for virus scanner
|
|
||||||
delay 2
|
|
||||||
my copyIconOfTo(icon_image_file, dmg_file)
|
|
||||||
end run
|
|
@ -1,6 +1,6 @@
|
|||||||
[executables]
|
[executables]
|
||||||
sphinx = sphinx-build
|
sphinx = sphinx-build
|
||||||
pyinstaller = %(here)s/../pyinstaller/pyinstaller.py
|
pyinstaller = %(projects)s/pyinstaller/pyinstaller.py
|
||||||
lrelease = lrelease
|
lrelease = lrelease
|
||||||
diskutil = diskutil
|
diskutil = diskutil
|
||||||
hdiutil = hdiutil
|
hdiutil = hdiutil
|
||||||
|
@ -205,14 +205,13 @@ class MacosxBuilder(object):
|
|||||||
"""
|
"""
|
||||||
parser = ArgumentParser()
|
parser = ArgumentParser()
|
||||||
parser.add_argument('-b', '--branch', metavar='BRANCH', dest='branch',
|
parser.add_argument('-b', '--branch', metavar='BRANCH', dest='branch',
|
||||||
help='Specify the path to the branch you wish to build.',
|
help='Specify the path to the branch you wish to build.')
|
||||||
default='../trunk')
|
|
||||||
parser.add_argument('--devel', dest='devel',
|
parser.add_argument('--devel', dest='devel',
|
||||||
action='store_true', default=False,
|
action='store_true', default=False,
|
||||||
help='Development build does not have set icons for .dmg file '
|
help='Development build does not have set icons for .dmg file '
|
||||||
'and .dmg filename contains bzr revision number.')
|
'and .dmg filename contains bzr revision number.')
|
||||||
parser.add_argument('-d', '--documentation', metavar='DOCS',
|
parser.add_argument('-d', '--documentation', metavar='DOCS',
|
||||||
dest='docs', default=os.path.join('..', 'documentation'),
|
dest='docs',
|
||||||
help='Specify the path to the documentation branch.')
|
help='Specify the path to the documentation branch.')
|
||||||
parser.add_argument('-c', '--config', metavar='CONFIG', dest='config',
|
parser.add_argument('-c', '--config', metavar='CONFIG', dest='config',
|
||||||
help='Specify the path to the configuration file.',
|
help='Specify the path to the configuration file.',
|
||||||
@ -226,6 +225,10 @@ class MacosxBuilder(object):
|
|||||||
parser.add_argument('--transifex',
|
parser.add_argument('--transifex',
|
||||||
dest='update_translations', action='store_true', default=False,
|
dest='update_translations', action='store_true', default=False,
|
||||||
help='Update the language translation from Transifex.')
|
help='Update the language translation from Transifex.')
|
||||||
|
parser.add_argument('--transifex-user',
|
||||||
|
dest='transifex_user', help='Transifex username.')
|
||||||
|
parser.add_argument('--transifex-pass',
|
||||||
|
dest='transifex_pass', help='Transifex password.')
|
||||||
parser.add_argument('-v', '--verbose', dest='verbose',
|
parser.add_argument('-v', '--verbose', dest='verbose',
|
||||||
action='store_true', default=False,
|
action='store_true', default=False,
|
||||||
help='Print out additional information.')
|
help='Print out additional information.')
|
||||||
@ -236,7 +239,9 @@ class MacosxBuilder(object):
|
|||||||
Read the configuration from the configuration file.
|
Read the configuration from the configuration file.
|
||||||
"""
|
"""
|
||||||
self.config = ConfigParser(defaults={
|
self.config = ConfigParser(defaults={
|
||||||
u'here': self.script_path
|
u'here': self.script_path,
|
||||||
|
u'projects': os.path.abspath(os.path.join(self.script_path,
|
||||||
|
'..', '..')),
|
||||||
})
|
})
|
||||||
self.config.read(os.path.abspath(self.args.config))
|
self.config.read(os.path.abspath(self.args.config))
|
||||||
|
|
||||||
@ -264,18 +269,16 @@ class MacosxBuilder(object):
|
|||||||
Set up a variety of paths that we use throughout the build process.
|
Set up a variety of paths that we use throughout the build process.
|
||||||
"""
|
"""
|
||||||
if self.args.branch:
|
if self.args.branch:
|
||||||
branch_path = self.args.branch
|
self.branch_path = os.path.abspath(self.args.branch)
|
||||||
else:
|
else:
|
||||||
branch_path = self.config.get(u'paths', u'branch')
|
self.branch_path = self.config.get(u'paths', u'branch')
|
||||||
self.branch_path = os.path.abspath(branch_path)
|
|
||||||
if self.args.docs:
|
if self.args.docs:
|
||||||
docs_path = self.args.docs
|
self.docs_path = os.path.abspath(self.args.docs)
|
||||||
else:
|
else:
|
||||||
docs_path = self.config.get(u'paths', u'documentation')
|
self.docs_path = self.config.get(u'paths', u'documentation')
|
||||||
self.docs_path = os.path.abspath(docs_path)
|
|
||||||
|
|
||||||
self.openlp_script = os.path.abspath(
|
self.openlp_script = os.path.abspath(
|
||||||
os.path.join(branch_path, u'openlp.pyw'))
|
os.path.join(self.branch_path, u'openlp.pyw'))
|
||||||
self.hooks_path = os.path.abspath(os.path.join(
|
self.hooks_path = os.path.abspath(os.path.join(
|
||||||
self.branch_path, self.config.get(u'paths', u'hooks')))
|
self.branch_path, self.config.get(u'paths', u'hooks')))
|
||||||
self.mac_icon = os.path.abspath(
|
self.mac_icon = os.path.abspath(
|
||||||
@ -371,11 +374,10 @@ class MacosxBuilder(object):
|
|||||||
raise Exception(u'Error running bzr log')
|
raise Exception(u'Error running bzr log')
|
||||||
output_ascii = unicode(output, errors=u'ignore')
|
output_ascii = unicode(output, errors=u'ignore')
|
||||||
latest = output_ascii.split(u':')[0]
|
latest = output_ascii.split(u':')[0]
|
||||||
version_string = latest == revision and tag or \
|
self.version_string = u'%s-bzr%s' % (tag, latest)
|
||||||
u'%s-bzr%s' % (tag, latest)
|
self.version_tag = tag
|
||||||
self.version_string = version_string
|
|
||||||
version_file = open(os.path.join(self.dist_path, u'.version'), u'w')
|
version_file = open(os.path.join(self.dist_path, u'.version'), u'w')
|
||||||
version_file.write(version_string)
|
version_file.write(self.version_string)
|
||||||
version_file.close()
|
version_file.close()
|
||||||
|
|
||||||
def copy_plugins(self):
|
def copy_plugins(self):
|
||||||
@ -450,8 +452,14 @@ class MacosxBuilder(object):
|
|||||||
raise Exception(u'No option named "username" found.')
|
raise Exception(u'No option named "username" found.')
|
||||||
if not self.config.has_option('transifex', 'password'):
|
if not self.config.has_option('transifex', 'password'):
|
||||||
raise Exception(u'No option named "password" found.')
|
raise Exception(u'No option named "password" found.')
|
||||||
username = self.config.get(u'transifex', u'username')
|
if self.args.transifex_user:
|
||||||
password = self.config.get(u'transifex', u'password')
|
username = self.args.transifex_user
|
||||||
|
else:
|
||||||
|
username = self.config.get(u'transifex', u'username')
|
||||||
|
if self.args.transifex_pass:
|
||||||
|
password = self.args.transifex_pass
|
||||||
|
else:
|
||||||
|
password = self.config.get(u'transifex', u'password')
|
||||||
os.chdir(os.path.split(self.i18n_utils)[0])
|
os.chdir(os.path.split(self.i18n_utils)[0])
|
||||||
translation_utils = Popen([self.python, self.i18n_utils, u'-qdpu',
|
translation_utils = Popen([self.python, self.i18n_utils, u'-qdpu',
|
||||||
u'-U', username, u'-P', password])
|
u'-U', username, u'-P', password])
|
||||||
@ -513,7 +521,12 @@ class MacosxBuilder(object):
|
|||||||
"""
|
"""
|
||||||
self._print(u'Creating dmg file...')
|
self._print(u'Creating dmg file...')
|
||||||
|
|
||||||
dmg_name = 'OpenLP-' + self.version_string + '.dmg'
|
# Release version does not contain revision in .dmg name.
|
||||||
|
if self.args.devel:
|
||||||
|
dmg_name = 'OpenLP-' + self.version_string + '.dmg'
|
||||||
|
else:
|
||||||
|
dmg_name = 'OpenLP-' + self.version_tag + '.dmg'
|
||||||
|
|
||||||
dmg_file = os.path.join(self.branch_path, 'build', dmg_name)
|
dmg_file = os.path.join(self.branch_path, 'build', dmg_name)
|
||||||
# Remove dmg if it exists.
|
# Remove dmg if it exists.
|
||||||
if os.path.exists(dmg_file):
|
if os.path.exists(dmg_file):
|
||||||
@ -548,13 +561,33 @@ class MacosxBuilder(object):
|
|||||||
u'Could not copy app bundle, dmg creation failed.'
|
u'Could not copy app bundle, dmg creation failed.'
|
||||||
)
|
)
|
||||||
|
|
||||||
self._print('... Copying the background image.')
|
# Set icon for dmg file.
|
||||||
os.mkdir(os.path.join(dmg_volume_path, '.background'))
|
# http://endrift.com/blog/2010/06/14/dmg-files-volume-icons-cli/
|
||||||
self._run_command(['cp', self.dmg_background_img,
|
self._print('... Setting the dmg icon.')
|
||||||
os.path.join(dmg_volume_path,
|
dmg_icon = os.path.join(dmg_volume_path, '.VolumeIcon.icns')
|
||||||
'.background/installer-background.png')],
|
self._run_command(['cp', self.mac_icon, dmg_icon],
|
||||||
u'Could not copy the background image, dmg creation failed.'
|
u'Could not copy the dmg icon file, dmg creation failed.'
|
||||||
)
|
)
|
||||||
|
# Set proper dmg icon attributes.
|
||||||
|
self._run_command(['SetFile', '-c', 'icnC', dmg_icon],
|
||||||
|
'Could not set dmg icon attributes.')
|
||||||
|
# Ensures dmg icon will be used while mounted.
|
||||||
|
self._run_command(['SetFile', '-a', 'C', dmg_volume_path],
|
||||||
|
'Could not set dmg icon attributes.')
|
||||||
|
|
||||||
|
# Set dmg background. Requires running Mac OS X gui.
|
||||||
|
# TODO: better formatting and code refactoring
|
||||||
|
if not self.args.devel:
|
||||||
|
self._print('... Setting the background image.')
|
||||||
|
|
||||||
|
os.mkdir(os.path.join(dmg_volume_path, '.background'))
|
||||||
|
self._run_command(['cp', self.dmg_background_img,
|
||||||
|
os.path.join(dmg_volume_path,
|
||||||
|
'.background/installer-background.png')],
|
||||||
|
u'Could not copy the background image, dmg creation failed.'
|
||||||
|
)
|
||||||
|
|
||||||
|
self.adjust_dmg_view(os.path.basename(dmg_volume_path))
|
||||||
|
|
||||||
# Unmount dmg file.
|
# Unmount dmg file.
|
||||||
self._print('... unmounting the dmg.')
|
self._print('... unmounting the dmg.')
|
||||||
@ -590,10 +623,23 @@ class MacosxBuilder(object):
|
|||||||
self._print('Finished creating dmg file, resulting file: %s' %
|
self._print('Finished creating dmg file, resulting file: %s' %
|
||||||
compressed_dmg)
|
compressed_dmg)
|
||||||
|
|
||||||
# TODO Reimplement following actions.
|
self.dmg_file = compressed_dmg
|
||||||
#adjust_package_view(settings, adjustview_scriptname)
|
|
||||||
#compress_view(settings, seticon_scriptname, dmg_file)
|
|
||||||
|
|
||||||
|
def adjust_dmg_view(self, dmg_volume_name):
|
||||||
|
try:
|
||||||
|
# TODO: Use only one applescript file. Remove one for osx 10.5.
|
||||||
|
f = open(os.path.join(self.script_path,
|
||||||
|
'applescript-adjust-dmg-view.master'))
|
||||||
|
p = Popen([self.osascript], stdin=PIPE)
|
||||||
|
p.communicate(f.read() % (dmg_volume_name, 'OpenLP'))
|
||||||
|
f.close()
|
||||||
|
result = p.returncode
|
||||||
|
if (result != 0):
|
||||||
|
self._print('Adjusting dmg view failed.')
|
||||||
|
sys.exit(1)
|
||||||
|
except (IOError, OSError):
|
||||||
|
self._print('Adjusting dmg view failed.')
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
def main(self):
|
def main(self):
|
||||||
"""
|
"""
|
||||||
@ -607,7 +653,7 @@ class MacosxBuilder(object):
|
|||||||
self._print_verbose(u'Source path: .............%s', self.source_path)
|
self._print_verbose(u'Source path: .............%s', self.source_path)
|
||||||
self._print_verbose(u'"dist.app" path: .........%s', self.dist_app_path)
|
self._print_verbose(u'"dist.app" path: .........%s', self.dist_app_path)
|
||||||
self._print_verbose(u'"dist" path: .............%s', self.dist_path)
|
self._print_verbose(u'"dist" path: .............%s', self.dist_path)
|
||||||
self._print_verbose(u'"hooks" path: .............%s', self.hooks_path)
|
self._print_verbose(u'"hooks" path: ............%s', self.hooks_path)
|
||||||
self._print_verbose(u'PyInstaller: .............%s', self.pyinstaller)
|
self._print_verbose(u'PyInstaller: .............%s', self.pyinstaller)
|
||||||
self._print_verbose(u'Documentation branch path:%s', self.docs_path)
|
self._print_verbose(u'Documentation branch path:%s', self.docs_path)
|
||||||
self._print_verbose(u'')
|
self._print_verbose(u'')
|
||||||
@ -639,76 +685,3 @@ class MacosxBuilder(object):
|
|||||||
|
|
||||||
if __name__ == u'__main__':
|
if __name__ == u'__main__':
|
||||||
MacosxBuilder().main()
|
MacosxBuilder().main()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# TODO reimplement following options. They arenecessary for release builds.
|
|
||||||
def compress_view(settings, seticon_scriptname, dmg_file):
|
|
||||||
logging.info('[%s] setting icon of the dmg file...', script_name)
|
|
||||||
try:
|
|
||||||
f = open(seticon_scriptname)
|
|
||||||
p = subp.Popen(["osascript"], stdin=subp.PIPE)
|
|
||||||
p.communicate(f.read() % ((os.getcwd() + '/' +
|
|
||||||
settings['openlp_dmg_icon_file']), dmg_file))
|
|
||||||
f.close()
|
|
||||||
result = p.returncode
|
|
||||||
if (result != 0):
|
|
||||||
logging.error('[%s] could not set the icon to the dmg file, \
|
|
||||||
dmg creation failed!', script_name)
|
|
||||||
sys.exit(1)
|
|
||||||
except IOError, e:
|
|
||||||
logging.error('[%s] could not adjust the view (%s), dmg creation \
|
|
||||||
failed!', script_name, e)
|
|
||||||
sys.exit(1)
|
|
||||||
except OSError, e:
|
|
||||||
logging.error('[%s] could not set the icon to the dmg file(%s), \
|
|
||||||
dmg creation failed!', script_name, e)
|
|
||||||
sys.exit(1)
|
|
||||||
|
|
||||||
def adjust_package_view(settings, adjustview_scriptname):
|
|
||||||
logging.info('[%s] making adjustments to the view...', script_name)
|
|
||||||
try:
|
|
||||||
f = open(adjustview_scriptname)
|
|
||||||
p = subp.Popen(["osascript"], stdin=subp.PIPE)
|
|
||||||
p.communicate(f.read() % ((os.getcwd() + '/' + \
|
|
||||||
settings['openlp_dmg_icon_file']),
|
|
||||||
settings['openlp_appname'],
|
|
||||||
settings['openlp_appname'],
|
|
||||||
settings['openlp_appname']))
|
|
||||||
f.close()
|
|
||||||
result = p.returncode
|
|
||||||
if (result != 0):
|
|
||||||
logging.error('[%s] could not adjust the view, dmg creation \
|
|
||||||
failed!', script_name)
|
|
||||||
sys.exit(1)
|
|
||||||
except IOError, e:
|
|
||||||
logging.error('[%s] could not adjust the view (%s), dmg creation \
|
|
||||||
failed!', script_name, e)
|
|
||||||
sys.exit(1)
|
|
||||||
except OSError, e:
|
|
||||||
logging.error('[%s] could not adjust the view (%s), dmg creation \
|
|
||||||
failed!', script_name, e)
|
|
||||||
sys.exit(1)
|
|
||||||
|
|
||||||
def old_main():
|
|
||||||
|
|
||||||
version = platform.mac_ver()[0]
|
|
||||||
# we only need the differenciation between leopard and snow leopard
|
|
||||||
if version.startswith("10.6") or version.startswith("10.7"):
|
|
||||||
SNOWLEOPARD = True
|
|
||||||
logging.info('[%s] using snow leopard scripts (version = %s)',
|
|
||||||
script_name, version)
|
|
||||||
adjustview_scriptname = "applescript-adjustview-10-6.master"
|
|
||||||
seticon_scriptname = "applescript-seticon-10-6.master"
|
|
||||||
else:
|
|
||||||
SNOWLEOPARD = False
|
|
||||||
logging.info('[%s] using leopard scripts (version = %s)', script_name,
|
|
||||||
version)
|
|
||||||
adjustview_scriptname = "applescript-adjustview-10-5.master"
|
|
||||||
seticon_scriptname = "applescript-seticon-10-5.master"
|
|
||||||
|
|
||||||
if not os.path.isfile(adjustview_scriptname) \
|
|
||||||
or not os.path.isfile(seticon_scriptname):
|
|
||||||
logging.error('[%s] could not find apple scripts for given OS X '
|
|
||||||
+ 'version %s', script_name, version)
|
|
||||||
sys.exit(1)
|
|
||||||
|
Loading…
Reference in New Issue
Block a user