~ubuntu-branches/ubuntu/saucy/clementine/saucy

« back to all changes in this revision

Viewing changes to dist/macdeploy.py

  • Committer: Package Import Robot
  • Author(s): Thomas PIERSON
  • Date: 2012-01-01 20:43:39 UTC
  • mfrom: (1.1.1)
  • Revision ID: package-import@ubuntu.com-20120101204339-lsb6nndwhfy05sde
Tags: 1.0.1+dfsg-1
New upstream release. (Closes: #653926, #651611, #657391)

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
import sys
22
22
 
23
23
FRAMEWORK_SEARCH_PATH=[
 
24
    '/target',
24
25
    '/Library/Frameworks',
25
26
    os.path.join(os.environ['HOME'], 'Library/Frameworks')
26
27
]
27
28
 
28
 
LIBRARY_SEARCH_PATH=['/usr/local/lib', '/sw/lib']
 
29
LIBRARY_SEARCH_PATH=['/target/lib', '/usr/local/lib', '/sw/lib']
29
30
 
30
 
XINE_PLUGINS = [
31
 
    'xineplug_ao_out_coreaudio.so',
32
 
    'xineplug_decode_a52.so',
33
 
    'xineplug_decode_dts.so',
34
 
    'xineplug_decode_faad.so',
35
 
    'xineplug_decode_mad.so',
36
 
    'xineplug_decode_mpc.so',
37
 
    'xineplug_decode_vorbis.so',
38
 
    'xineplug_dmx_audio.so',
39
 
    'xineplug_dmx_ogg.so',
40
 
    'xineplug_flac.so',
41
 
    'xineplug_inp_cdda.so',
42
 
    'xineplug_inp_file.so',
43
 
    'xineplug_inp_http.so',
44
 
    'xineplug_inp_net.so',
45
 
    'xineplug_inp_rtp.so',
46
 
    'xineplug_inp_rtsp.so',
47
 
    'xineplug_post_audio_filters.so',
48
 
]
49
 
XINEPLUGIN_SEARCH_PATH=[
50
 
    '/usr/local/lib/xine/plugins',
51
 
    '/usr/lib/xine/plugins',
52
 
    '/sw/lib/xine/plugins',
53
 
]
54
31
 
55
32
GSTREAMER_PLUGINS=[
56
33
    # Core plugins
 
34
    'libgstapp.so',
57
35
    'libgstaudioconvert.so',
58
36
    'libgstaudiofx.so',
59
37
    'libgstaudiotestsrc.so',
62
40
    'libgstcoreelements.so',
63
41
    'libgstdecodebin2.so',
64
42
    'libgstequalizer.so',
 
43
    'libgstgdp.so',
65
44
    'libgstosxaudio.so',
 
45
    'libgsttcp.so',
66
46
    'libgsttypefindfunctions.so',
67
47
    'libgstudp.so',
68
48
    'libgstvolume.so',
79
59
    'libgstlame.so',
80
60
    'libgstmad.so',
81
61
    'libgstmms.so',
 
62
    'libgstmpegaudioparse.so',
82
63
    'libgstmusepack.so',
83
64
    'libgstogg.so',
84
65
    'libgstqtdemux.so',
85
 
    'libgstqtwrapper.so',
86
66
    'libgstreplaygain.so',
87
67
    'libgstspeex.so',
 
68
    'libgsttaglib.so',
88
69
    'libgstvorbis.so',
89
70
    'libgstwavpack.so',
90
71
    'libgstwavparse.so',
95
76
    # Icecast support
96
77
    'libgsticydemux.so',
97
78
 
98
 
    # Fingerprinting support
99
 
    'libgstofa.so',
 
79
    # CD support
 
80
    'libgstcdio.so',
100
81
]
101
82
 
102
83
GSTREAMER_SEARCH_PATH=[
 
84
    '/target/lib/gstreamer-0.10',
 
85
    '/target/libexec/gstreamer-0.10',
 
86
    '/sw/lib/gstreamer-0.10',
103
87
    '/usr/local/lib/gstreamer-0.10',
104
 
    '/usr/local/lib/gstreamer-0.10/gstreamer-0.10',
105
 
    '/sw/lib/gstreamer-0.10',
106
 
    '/sw/lib/gstreamer-0.10/gstreamer-0.10',
107
88
]
108
89
 
109
90
QT_PLUGINS = [
125
106
    '/Developer/Applications/Qt/plugins',
126
107
]
127
108
 
128
 
SCRIPT_PLUGINS = [
129
 
    'sip.so',
130
 
    'PyQt4/QtCore.so',
131
 
    'PyQt4/QtGui.so',
132
 
    'PyQt4/QtNetwork.so',
133
 
]
134
 
SCRIPT_PLUGINS_SEARCH_PATH = [
135
 
    '/Library/Python/2.6/site-packages',
136
 
]
137
 
 
138
 
TUNEPIMP_PLUGINS = [
139
 
    'flac.tpp',
140
 
    'mp3.tpp',
141
 
    'mp4.tpp',
142
 
    'mpc.tpp',
143
 
    'speex.tpp',
144
 
    'tta.tpp',
145
 
    'vorbis.tpp',
146
 
    'wav.tpp',
147
 
    'wma.tpp',
148
 
    'wv.tpp',
149
 
]
150
 
TUNEPIMP_PLUGINS_SEARCH_PATH = [
151
 
    '/usr/local/lib/tunepimp/plugins',
152
 
]
153
 
 
154
109
 
155
110
class Error(Exception):
156
111
  pass
180
135
  pass
181
136
 
182
137
 
183
 
class CouldNotFindTunepimpPluginError(Error):
184
 
  pass
185
 
 
186
138
 
187
139
if len(sys.argv) < 2:
188
140
  print 'Usage: %s <bundle.app>' % sys.argv[0]
213
165
      continue
214
166
    if os.path.basename(binary) in line:
215
167
      continue
216
 
    if re.match(r'^\s*/System/', line):
 
168
    if 'libiconv' in line:
 
169
      broken_libs['libs'].append(line)
 
170
    elif re.match(r'^\s*/System/', line):
217
171
      continue  # System framework
218
172
    elif re.match(r'^\s*/usr/lib/', line):
219
173
      continue  # unix style system library
 
174
    elif re.match(r'Breakpad', line):
 
175
      continue  # Manually added by cmake.
220
176
    elif re.match(r'^\s*@executable_path', line) or re.match(r'^\s*@loader_path', line):
221
177
      # Potentially already fixed library
222
178
      relative_path = os.path.join(*line.split('/')[3:])
306
262
 
307
263
def CopyLibrary(path):
308
264
  new_path = os.path.join(frameworks_dir, os.path.basename(path))
309
 
  args = ['ditto', '--arch=i386', path, new_path]
 
265
  args = ['ditto', '--arch=x86_64', path, new_path]
310
266
  commands.append(args)
311
267
  return new_path
312
268
 
314
270
  new_path = os.path.join(plugins_dir, subdir, os.path.basename(path))
315
271
  args = ['mkdir', '-p', os.path.dirname(new_path)]
316
272
  commands.append(args)
317
 
  args = ['ditto', '--arch=i386', path, new_path]
 
273
  args = ['ditto', '--arch=x86_64', path, new_path]
318
274
  commands.append(args)
319
275
  return new_path
320
276
 
326
282
      break
327
283
  args = ['mkdir', '-p', full_path]
328
284
  commands.append(args)
329
 
  args = ['ditto', '--arch=i386', path, full_path]
 
285
  args = ['ditto', '--arch=x86_64', path, full_path]
330
286
  commands.append(args)
 
287
 
 
288
  menu_nib = os.path.join(os.path.split(path)[0], 'Resources', 'qt_menu.nib')
 
289
  if os.path.exists(menu_nib):
 
290
    args = ['cp', '-r', menu_nib, resources_dir]
 
291
    commands.append(args)
 
292
 
331
293
  return os.path.join(full_path, parts[-1])
332
294
 
333
295
def FixId(path, library_name):
334
296
  id = '@executable_path/../Frameworks/%s' % library_name
335
297
  args = ['install_name_tool', '-id', id, path]
336
298
  commands.append(args)
337
 
  
 
299
 
338
300
def FixLibraryId(path):
339
301
  library_name = os.path.basename(path)
340
302
  FixId(path, library_name)
347
309
  commands.append(args)
348
310
 
349
311
def FindSystemLibrary(library_name):
 
312
  if 'iconv' in library_name:
 
313
    return None
350
314
  for path in ['/lib', '/usr/lib']:
351
315
    full_path = os.path.join(path, library_name)
352
316
    if os.path.exists(full_path):
396
360
  raise CouldNotFindGstreamerPluginError(name)
397
361
 
398
362
 
399
 
def FindScriptPlugin(name):
400
 
  for path in SCRIPT_PLUGINS_SEARCH_PATH:
401
 
    if os.path.exists(path):
402
 
      if os.path.exists(os.path.join(path, name)):
403
 
        return os.path.join(path, name)
404
 
  raise CouldNotFindScriptPluginError(name)
405
 
 
406
 
 
407
 
def FindTunepimpPlugin(name):
408
 
  for path in TUNEPIMP_PLUGINS_SEARCH_PATH:
409
 
    if os.path.exists(path):
410
 
      if os.path.exists(os.path.join(path, name)):
411
 
        return os.path.join(path, name)
412
 
  raise CouldNotFindTunepimpPluginError(name)
413
 
 
414
 
 
415
363
FixBinary(binary)
416
364
 
417
365
for plugin in GSTREAMER_PLUGINS:
419
367
 
420
368
FixPlugin(FindGstreamerPlugin('gst-plugin-scanner'), '.')
421
369
 
 
370
try:
 
371
  FixPlugin('clementine-spotifyblob', '.')
 
372
except:
 
373
  print 'Failed to find spotify blob'
 
374
 
422
375
for plugin in QT_PLUGINS:
423
376
  FixPlugin(FindQtPlugin(plugin), os.path.dirname(plugin))
424
377
 
425
 
try:
426
 
  for plugin in SCRIPT_PLUGINS:
427
 
    FixPlugin(FindScriptPlugin(plugin), os.path.dirname(plugin))
428
 
 
429
 
  for plugin in TUNEPIMP_PLUGINS:
430
 
    FixPlugin(FindTunepimpPlugin(plugin), 'tunepimp')
431
 
except:
432
 
  print 'Failed to find script or tunepimp plugins'
433
 
 
434
378
if len(sys.argv) <= 2:
435
379
  print 'Would run %d commands:' % len(commands)
436
380
  for command in commands: