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.
dobey (dobey) :
review: Approve
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
1=== modified file 'scripts/devsetup/buildout.cfg'
2--- scripts/devsetup/buildout.cfg 2012-10-30 15:31:27 +0000
3+++ scripts/devsetup/buildout.cfg 2012-12-10 18:32:20 +0000
4@@ -40,6 +40,8 @@
5 http://launchpad.net/configglue/trunk/1.0/+download/configglue-1.0.tar.gz#egg=configglue
6 http://u1.to/ralsina/7/Twisted-11.1.0-py2.7-win32.egg#egg=twisted
7 http://people.canonical.com/~dobey/pyflakes-0.5.0-2ubuntu2.bo2.tar.gz#egg=pyflakes
8+ http://u1.to/~mikemc/g/pyobjc_core-2.5.0b1-py2.7-macosx-10.6-x86_64.egg#egg=pyobjc-core-2.5.0b1
9+ 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
10 unzip = true
11 newest = false
12 versions = versions
13@@ -64,7 +66,7 @@
14 ... if platform.platform().startswith('Windows'):
15 ... self.options['eggs'] = 'comtypes'
16 ... else:
17- ... self.options['eggs'] = ''
18+ ... self.options['eggs'] = 'pyobjc-core\npyobjc-framework-Cocoa'
19
20 # z3c.recipe.scripts generates a python interpreter that handles the
21 # same python command line options as the real interpreter
22@@ -91,6 +93,7 @@
23 simplejson
24 pylint
25 pyflakes
26+ mock
27 versions = versions
28 interpreter = python
29 # Use extra-paths so generated python interpreter can see the source
30@@ -169,6 +172,9 @@
31 oauth = 1.0.1
32 py2exe = 0.6.9
33 comtypes = 0.6.2
34+pyobjc-core = 2.5.0b1
35+pyobjc-framework-Cocoa = 2.5.0b1
36+mock = 1.0
37
38 [sources]
39 recipe = bazaarrecipeinfrae
40
41=== modified file 'scripts/setup-mac.py'
42--- scripts/setup-mac.py 2012-11-21 00:05:32 +0000
43+++ scripts/setup-mac.py 2012-12-10 18:32:20 +0000
44@@ -52,6 +52,8 @@
45 print "or see http://bitbucket.com/ronaldoussoren/py2app/"
46 sys.exit()
47
48+assert(py2app)
49+
50 # NOTE - this needs to be the full CN, not just a substring.
51 # /usr/bin/codesign will find the right cert if you pass it a
52 # substring, but the rest of the system wants an exact match.
53@@ -448,7 +450,7 @@
54 with open(os.path.join("data", "logging.conf"), "wb") as logconf:
55 logconf.write(data)
56
57- # build fsevents daemon
58+ print "building fsevents daemon"
59 log_file_name = os.path.join(INSTALL_DIR,
60 "fsevents-daemon-build.log")
61 with open(log_file_name, 'w') as logfile:
62@@ -478,6 +480,30 @@
63 os.path.join(dest_dir, "ubuntuone",
64 "fseventsd.py"))
65
66+ print "building pyobjc cocoa menu"
67+ log_file_name = os.path.join(INSTALL_DIR,
68+ "cocoa-menu-build.log")
69+ with open(log_file_name, 'w') as logfile:
70+ proj_path = os.path.join(self.source_dir,
71+ "ubuntuone-cocoa-menu")
72+ file_abs_path = os.path.abspath(__file__)
73+ dist_path = os.path.join(os.path.dirname(file_abs_path),
74+ 'dist')
75+ cmd = ("cd %s && "
76+ "PYTHONPATH=$PYTHONPATH:%s/lib/site-packages/ "
77+ "U1_SETUP_DIST_PATH=%s "
78+ "python setup.py py2app -d %s" %
79+ (proj_path, INSTALL_DIR, dist_path, dist_path))
80+ logfile.write("# %s\n" % cmd)
81+ retval = subprocess.call(cmd,
82+ shell=True,
83+ stderr=subprocess.STDOUT,
84+ stdout=logfile
85+ )
86+ if retval != 0:
87+ print "error running %r in %r. look in %r for details" %\
88+ (cmd, os.getcwd(), logfile.name)
89+
90 # clear path_importer_cache to make sure that a following
91 # py2app step can see the newly-copied
92 # INSTALL_PATH/lib/site-packages/ubuntu_sso module without
93@@ -534,7 +560,11 @@
94 # make sure we can see the prepared libraries:
95 sys.path.insert(0, os.path.join(INSTALL_DIR, "lib", "site-packages"))
96
97- helper_app_paths = []
98+ # start helper_app_paths with path to cocoa menu, which was built
99+ # in the prepare step:
100+ cocoa_menu_path = os.path.join('dist', 'Ubuntu One Menu.app')
101+
102+ helper_app_paths = [cocoa_menu_path]
103
104 def do_setup(is_background, id, exename,
105 verbose=False,
106@@ -763,13 +793,21 @@
107
108 helper_src_resources = os.listdir(helper_src_resources_path)
109
110- # copy everything in resources that isn't include, lib, or *.app:
111+ # copy everything in resources that isn't include or lib
112 resources_to_copy = [p for p in helper_src_resources if
113 p not in resource_subdirs_to_link]
114
115 for rsrc_name in resources_to_copy:
116- shutil.copy(os.path.join(helper_src_resources_path, rsrc_name),
117- os.path.join(helper_dest_resources_path, rsrc_name))
118+ src_rsrc_path = os.path.join(helper_src_resources_path, rsrc_name)
119+ dest_rsrc_path = os.path.join(helper_dest_resources_path,
120+ rsrc_name)
121+ if os.path.isdir(src_rsrc_path):
122+ if rsrc_name == 'English.lproj':
123+ shutil.copytree(src_rsrc_path, dest_rsrc_path)
124+ else:
125+ print "WARNING: ignoring unexpected source directory",
126+ else:
127+ shutil.copy(src_rsrc_path, dest_rsrc_path)
128
129 # link to resources/include and resources/lib from the main bundle:
130 resources_to_link = [os.path.join("Resources", p)

Subscribers

People subscribed via source and target branches