mirror of
https://github.com/arsenetar/dupeguru.git
synced 2025-03-09 21:24:36 +00:00
Added build support for ME in the new waf script (but I haven't converted ME's pref panel to xibless yet).
--HG-- branch : xibless
This commit is contained in:
parent
79e9251511
commit
903ecd9eae
21
build.py
21
build.py
@ -19,7 +19,7 @@ from setuptools import setup, Extension
|
|||||||
|
|
||||||
from hscommon import sphinxgen
|
from hscommon import sphinxgen
|
||||||
from hscommon.build import (add_to_pythonpath, print_and_do, copy_packages, filereplace,
|
from hscommon.build import (add_to_pythonpath, print_and_do, copy_packages, filereplace,
|
||||||
get_module_version, move_all, copy_sysconfig_files_for_embed, copy_all, move, copy,
|
get_module_version, move_all, copy_sysconfig_files_for_embed, copy_all, move,
|
||||||
create_osx_app_structure)
|
create_osx_app_structure)
|
||||||
from hscommon import loc
|
from hscommon import loc
|
||||||
|
|
||||||
@ -66,7 +66,8 @@ def build_xibless(edition):
|
|||||||
xibless.generate('cocoa/base/ui/details_panel.py', 'cocoa/autogen/DetailsPanel_UI', localizationTable='Localizable')
|
xibless.generate('cocoa/base/ui/details_panel.py', 'cocoa/autogen/DetailsPanel_UI', localizationTable='Localizable')
|
||||||
if edition == 'se':
|
if edition == 'se':
|
||||||
xibless.generate('cocoa/se/ui/preferences_panel.py', 'cocoa/autogen/PreferencesPanel_UI', localizationTable='Localizable')
|
xibless.generate('cocoa/se/ui/preferences_panel.py', 'cocoa/autogen/PreferencesPanel_UI', localizationTable='Localizable')
|
||||||
|
if edition == 'me':
|
||||||
|
xibless.generate('cocoa/se/ui/preferences_panel.py', 'cocoa/autogen/PreferencesPanel_UI', localizationTable='Localizable')
|
||||||
|
|
||||||
def build_cocoa(edition, dev):
|
def build_cocoa(edition, dev):
|
||||||
ed = lambda s: s.format(edition)
|
ed = lambda s: s.format(edition)
|
||||||
@ -74,10 +75,8 @@ def build_cocoa(edition, dev):
|
|||||||
build_cocoa_proxy_module()
|
build_cocoa_proxy_module()
|
||||||
build_cocoa_bridging_interfaces(edition)
|
build_cocoa_bridging_interfaces(edition)
|
||||||
print("Building the cocoa layer")
|
print("Building the cocoa layer")
|
||||||
from pluginbuilder import copy_embeddable_python_dylib, get_python_header_folder, collect_dependencies
|
from pluginbuilder import copy_embeddable_python_dylib, collect_dependencies
|
||||||
copy_embeddable_python_dylib('build')
|
copy_embeddable_python_dylib('build')
|
||||||
if not op.exists('build/PythonHeaders'):
|
|
||||||
os.symlink(get_python_header_folder(), 'build/PythonHeaders')
|
|
||||||
if not op.exists('build/py'):
|
if not op.exists('build/py'):
|
||||||
os.mkdir('build/py')
|
os.mkdir('build/py')
|
||||||
cocoa_project_path = ed('cocoa/{}')
|
cocoa_project_path = ed('cocoa/{}')
|
||||||
@ -103,21 +102,21 @@ def build_cocoa(edition, dev):
|
|||||||
filereplace('InfoTemplate.plist', 'Info.plist', version=app_version)
|
filereplace('InfoTemplate.plist', 'Info.plist', version=app_version)
|
||||||
print("Compiling with WAF")
|
print("Compiling with WAF")
|
||||||
os.chdir('..')
|
os.chdir('..')
|
||||||
os.system('{0} waf configure && {0} waf'.format(sys.executable))
|
os.system('{0} waf configure --edition {1} && {0} waf'.format(sys.executable, edition))
|
||||||
os.chdir('..')
|
os.chdir('..')
|
||||||
print("Creating the .app folder")
|
print("Creating the .app folder")
|
||||||
image_path = ed('cocoa/{}/dupeguru.icns')
|
image_path = ed('cocoa/{}/dupeguru.icns')
|
||||||
resources = [image_path, 'cocoa/base/dsa_pub.pem', 'build/dg_cocoa.py',
|
resources = [image_path, 'cocoa/base/dsa_pub.pem', 'build/dg_cocoa.py',
|
||||||
'build/py', 'build/help'] + glob.glob('cocoa/base/*.lproj')
|
'build/py', 'build/help'] + glob.glob('cocoa/base/*.lproj')
|
||||||
frameworks = ['build/Python', 'cocoalib/Sparkle.framework']
|
frameworks = ['build/Python', 'cocoalib/Sparkle.framework']
|
||||||
create_osx_app_structure('build/dupeGuru.app', 'cocoa/build/dupeGuru', ed('cocoa/{}/Info.plist'),
|
|
||||||
resources, frameworks, symlink_resources=dev)
|
|
||||||
print("Creating the run.py file")
|
|
||||||
app_path = {
|
app_path = {
|
||||||
'se': 'build/dupeGuru.app',
|
'se': 'build/dupeGuru.app',
|
||||||
'me': 'build/dupeGuru\\ ME.app',
|
'me': 'build/dupeGuru ME.app',
|
||||||
'pe': 'build/dupeGuru\\ PE.app',
|
'pe': 'build/dupeGuru PE.app',
|
||||||
}[edition]
|
}[edition]
|
||||||
|
create_osx_app_structure(app_path, 'cocoa/build/dupeGuru', ed('cocoa/{}/Info.plist'),
|
||||||
|
resources, frameworks, symlink_resources=dev)
|
||||||
|
print("Creating the run.py file")
|
||||||
tmpl = open('run_template_cocoa.py', 'rt').read()
|
tmpl = open('run_template_cocoa.py', 'rt').read()
|
||||||
run_contents = tmpl.replace('{{app_path}}', app_path)
|
run_contents = tmpl.replace('{{app_path}}', app_path)
|
||||||
open('run.py', 'wt').write(run_contents)
|
open('run.py', 'wt').write(run_contents)
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
<key>CFBundleDevelopmentRegion</key>
|
<key>CFBundleDevelopmentRegion</key>
|
||||||
<string>English</string>
|
<string>English</string>
|
||||||
<key>CFBundleExecutable</key>
|
<key>CFBundleExecutable</key>
|
||||||
<string>${EXECUTABLE_NAME}</string>
|
<string>dupeGuru</string>
|
||||||
<key>CFBundleHelpBookFolder</key>
|
<key>CFBundleHelpBookFolder</key>
|
||||||
<string>dupeguru_me_help</string>
|
<string>dupeguru_me_help</string>
|
||||||
<key>CFBundleHelpBookName</key>
|
<key>CFBundleHelpBookName</key>
|
||||||
@ -17,7 +17,7 @@
|
|||||||
<key>CFBundleInfoDictionaryVersion</key>
|
<key>CFBundleInfoDictionaryVersion</key>
|
||||||
<string>6.0</string>
|
<string>6.0</string>
|
||||||
<key>CFBundleName</key>
|
<key>CFBundleName</key>
|
||||||
<string>${PRODUCT_NAME}</string>
|
<string>dupeGuru ME</string>
|
||||||
<key>CFBundlePackageType</key>
|
<key>CFBundlePackageType</key>
|
||||||
<string>APPL</string>
|
<string>APPL</string>
|
||||||
<key>CFBundleSignature</key>
|
<key>CFBundleSignature</key>
|
||||||
|
@ -8,8 +8,13 @@ out = 'build'
|
|||||||
|
|
||||||
def options(opt):
|
def options(opt):
|
||||||
opt.load('compiler_c python')
|
opt.load('compiler_c python')
|
||||||
|
opt.add_option('--edition', default='se', help="dupeGuru edition to build (se, me pe)")
|
||||||
|
|
||||||
def configure(conf):
|
def configure(conf):
|
||||||
|
if conf.options.edition not in ('se', 'me', 'pe'):
|
||||||
|
conf.options.edition = 'se'
|
||||||
|
print("Building dupeGuru {}".format(conf.options.edition.upper()))
|
||||||
|
conf.env.DGEDITION = conf.options.edition
|
||||||
# We use clang to compile our app
|
# We use clang to compile our app
|
||||||
conf.env.CC = 'clang'
|
conf.env.CC = 'clang'
|
||||||
# WAF has a "pyembed" feature allowing us to automatically find Python and compile by linking
|
# WAF has a "pyembed" feature allowing us to automatically find Python and compile by linking
|
||||||
@ -44,7 +49,7 @@ def build(ctx):
|
|||||||
'controllers/HSColumns', 'controllers/HSGUIController', 'controllers/HSTable',
|
'controllers/HSColumns', 'controllers/HSGUIController', 'controllers/HSTable',
|
||||||
'controllers/HSOutline', 'controllers/HSPopUpList', 'controllers/HSSelectableList']
|
'controllers/HSOutline', 'controllers/HSPopUpList', 'controllers/HSSelectableList']
|
||||||
cocoalib_src = [cocoalib_node.find_node(usename + '.m') for usename in cocoalib_uses] + cocoalib_node.ant_glob('autogen/*.m')
|
cocoalib_src = [cocoalib_node.find_node(usename + '.m') for usename in cocoalib_uses] + cocoalib_node.ant_glob('autogen/*.m')
|
||||||
project_folders = ['autogen', 'base', 'se']
|
project_folders = ['autogen', 'base', ctx.env.DGEDITION]
|
||||||
project_src = sum([ctx.srcnode.ant_glob('%s/*.m' % folder) for folder in project_folders], [])
|
project_src = sum([ctx.srcnode.ant_glob('%s/*.m' % folder) for folder in project_folders], [])
|
||||||
|
|
||||||
# Compile
|
# Compile
|
||||||
|
@ -4,7 +4,7 @@ import sys
|
|||||||
import os
|
import os
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
return os.system('open {{app_path}}')
|
return os.system('open "{{app_path}}"')
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
sys.exit(main())
|
sys.exit(main())
|
Loading…
x
Reference in New Issue
Block a user