Merge lp:~mikemc/ubuntuone-windows-installer/add-cocoa-menu into lp:ubuntuone-windows-installer

Proposed by Mike McCracken
Status: Merged
Approved by: Mike McCracken
Approved revision: 153
Merged at revision: 152
Proposed branch: lp:~mikemc/ubuntuone-windows-installer/add-cocoa-menu
Merge into: lp:ubuntuone-windows-installer
Prerequisite: lp:~mikemc/ubuntuone-windows-installer/fix-import-sso-constants
Diff against target: 130 lines (+50/-6)
2 files modified
scripts/devsetup/buildout.cfg (+7/-1)
scripts/setup-mac.py (+43/-5)
To merge this branch: bzr merge lp:~mikemc/ubuntuone-windows-installer/add-cocoa-menu
Reviewer Review Type Date Requested Status
dobey (community) Approve
Review via email: mp+135284@code.launchpad.net

Commit message

- add building and bundling pyobjc cocoa version of the indicator menu

Description of the change

- add building and bundling pyobjc cocoa version of the indicator menu

Testing requires having lp:ubuntuone-cocoa-menu in $PARTS in your buildout.

To post a comment you must log in.
Revision history for this message
dobey (dobey) :
review: Approve
Revision history for this message
Ubuntu One Auto Pilot (otto-pilot) wrote :

There are additional revisions which have not been approved in review. Please seek review and approval of these new revisions.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'scripts/devsetup/buildout.cfg'
--- scripts/devsetup/buildout.cfg 2012-10-30 15:31:27 +0000
+++ scripts/devsetup/buildout.cfg 2012-12-10 18:32:20 +0000
@@ -40,6 +40,8 @@
40 http://launchpad.net/configglue/trunk/1.0/+download/configglue-1.0.tar.gz#egg=configglue40 http://launchpad.net/configglue/trunk/1.0/+download/configglue-1.0.tar.gz#egg=configglue
41 http://u1.to/ralsina/7/Twisted-11.1.0-py2.7-win32.egg#egg=twisted41 http://u1.to/ralsina/7/Twisted-11.1.0-py2.7-win32.egg#egg=twisted
42 http://people.canonical.com/~dobey/pyflakes-0.5.0-2ubuntu2.bo2.tar.gz#egg=pyflakes42 http://people.canonical.com/~dobey/pyflakes-0.5.0-2ubuntu2.bo2.tar.gz#egg=pyflakes
43 http://u1.to/~mikemc/g/pyobjc_core-2.5.0b1-py2.7-macosx-10.6-x86_64.egg#egg=pyobjc-core-2.5.0b1
44 http://u1.to/~mikemc/7/pyobjc_framework_Cocoa-2.5.0b1-py2.7-macosx-10.6-x86_64.egg#egg=pyobjc-framework-Cocoa-2.5.0b1
43unzip = true45unzip = true
44newest = false46newest = false
45versions = versions47versions = versions
@@ -64,7 +66,7 @@
64 ... if platform.platform().startswith('Windows'):66 ... if platform.platform().startswith('Windows'):
65 ... self.options['eggs'] = 'comtypes'67 ... self.options['eggs'] = 'comtypes'
66 ... else:68 ... else:
67 ... self.options['eggs'] = ''69 ... self.options['eggs'] = 'pyobjc-core\npyobjc-framework-Cocoa'
6870
69# z3c.recipe.scripts generates a python interpreter that handles the71# z3c.recipe.scripts generates a python interpreter that handles the
70# same python command line options as the real interpreter72# same python command line options as the real interpreter
@@ -91,6 +93,7 @@
91 simplejson93 simplejson
92 pylint94 pylint
93 pyflakes95 pyflakes
96 mock
94versions = versions97versions = versions
95interpreter = python98interpreter = python
96# Use extra-paths so generated python interpreter can see the source99# Use extra-paths so generated python interpreter can see the source
@@ -169,6 +172,9 @@
169oauth = 1.0.1172oauth = 1.0.1
170py2exe = 0.6.9173py2exe = 0.6.9
171comtypes = 0.6.2174comtypes = 0.6.2
175pyobjc-core = 2.5.0b1
176pyobjc-framework-Cocoa = 2.5.0b1
177mock = 1.0
172178
173[sources]179[sources]
174recipe = bazaarrecipeinfrae180recipe = bazaarrecipeinfrae
175181
=== modified file 'scripts/setup-mac.py'
--- scripts/setup-mac.py 2012-11-21 00:05:32 +0000
+++ scripts/setup-mac.py 2012-12-10 18:32:20 +0000
@@ -52,6 +52,8 @@
52 print "or see http://bitbucket.com/ronaldoussoren/py2app/"52 print "or see http://bitbucket.com/ronaldoussoren/py2app/"
53 sys.exit()53 sys.exit()
5454
55assert(py2app)
56
55# NOTE - this needs to be the full CN, not just a substring.57# NOTE - this needs to be the full CN, not just a substring.
56# /usr/bin/codesign will find the right cert if you pass it a58# /usr/bin/codesign will find the right cert if you pass it a
57# substring, but the rest of the system wants an exact match.59# substring, but the rest of the system wants an exact match.
@@ -448,7 +450,7 @@
448 with open(os.path.join("data", "logging.conf"), "wb") as logconf:450 with open(os.path.join("data", "logging.conf"), "wb") as logconf:
449 logconf.write(data)451 logconf.write(data)
450452
451 # build fsevents daemon453 print "building fsevents daemon"
452 log_file_name = os.path.join(INSTALL_DIR,454 log_file_name = os.path.join(INSTALL_DIR,
453 "fsevents-daemon-build.log")455 "fsevents-daemon-build.log")
454 with open(log_file_name, 'w') as logfile:456 with open(log_file_name, 'w') as logfile:
@@ -478,6 +480,30 @@
478 os.path.join(dest_dir, "ubuntuone",480 os.path.join(dest_dir, "ubuntuone",
479 "fseventsd.py"))481 "fseventsd.py"))
480482
483 print "building pyobjc cocoa menu"
484 log_file_name = os.path.join(INSTALL_DIR,
485 "cocoa-menu-build.log")
486 with open(log_file_name, 'w') as logfile:
487 proj_path = os.path.join(self.source_dir,
488 "ubuntuone-cocoa-menu")
489 file_abs_path = os.path.abspath(__file__)
490 dist_path = os.path.join(os.path.dirname(file_abs_path),
491 'dist')
492 cmd = ("cd %s && "
493 "PYTHONPATH=$PYTHONPATH:%s/lib/site-packages/ "
494 "U1_SETUP_DIST_PATH=%s "
495 "python setup.py py2app -d %s" %
496 (proj_path, INSTALL_DIR, dist_path, dist_path))
497 logfile.write("# %s\n" % cmd)
498 retval = subprocess.call(cmd,
499 shell=True,
500 stderr=subprocess.STDOUT,
501 stdout=logfile
502 )
503 if retval != 0:
504 print "error running %r in %r. look in %r for details" %\
505 (cmd, os.getcwd(), logfile.name)
506
481 # clear path_importer_cache to make sure that a following507 # clear path_importer_cache to make sure that a following
482 # py2app step can see the newly-copied508 # py2app step can see the newly-copied
483 # INSTALL_PATH/lib/site-packages/ubuntu_sso module without509 # INSTALL_PATH/lib/site-packages/ubuntu_sso module without
@@ -534,7 +560,11 @@
534 # make sure we can see the prepared libraries:560 # make sure we can see the prepared libraries:
535 sys.path.insert(0, os.path.join(INSTALL_DIR, "lib", "site-packages"))561 sys.path.insert(0, os.path.join(INSTALL_DIR, "lib", "site-packages"))
536562
537 helper_app_paths = []563 # start helper_app_paths with path to cocoa menu, which was built
564 # in the prepare step:
565 cocoa_menu_path = os.path.join('dist', 'Ubuntu One Menu.app')
566
567 helper_app_paths = [cocoa_menu_path]
538568
539 def do_setup(is_background, id, exename,569 def do_setup(is_background, id, exename,
540 verbose=False,570 verbose=False,
@@ -763,13 +793,21 @@
763793
764 helper_src_resources = os.listdir(helper_src_resources_path)794 helper_src_resources = os.listdir(helper_src_resources_path)
765795
766 # copy everything in resources that isn't include, lib, or *.app:796 # copy everything in resources that isn't include or lib
767 resources_to_copy = [p for p in helper_src_resources if797 resources_to_copy = [p for p in helper_src_resources if
768 p not in resource_subdirs_to_link]798 p not in resource_subdirs_to_link]
769799
770 for rsrc_name in resources_to_copy:800 for rsrc_name in resources_to_copy:
771 shutil.copy(os.path.join(helper_src_resources_path, rsrc_name),801 src_rsrc_path = os.path.join(helper_src_resources_path, rsrc_name)
772 os.path.join(helper_dest_resources_path, rsrc_name))802 dest_rsrc_path = os.path.join(helper_dest_resources_path,
803 rsrc_name)
804 if os.path.isdir(src_rsrc_path):
805 if rsrc_name == 'English.lproj':
806 shutil.copytree(src_rsrc_path, dest_rsrc_path)
807 else:
808 print "WARNING: ignoring unexpected source directory",
809 else:
810 shutil.copy(src_rsrc_path, dest_rsrc_path)
773811
774 # link to resources/include and resources/lib from the main bundle:812 # link to resources/include and resources/lib from the main bundle:
775 resources_to_link = [os.path.join("Resources", p)813 resources_to_link = [os.path.join("Resources", p)

Subscribers

People subscribed via source and target branches