8
8
from ConfigParser import RawConfigParser
9
9
from picard import __version__
11
# Install gettext "noop" function.
13
__builtin__.__dict__['N_'] = lambda a: a
14
from picard.const import UI_LANGUAGES
12
17
if sys.version_info < (2, 5):
13
18
print "*** You need Python 2.5 or higher to use Picard."
449
454
'picard.plugins', 'picard.formats',
450
455
'picard.formats.mutagenext', 'picard.ui',
451
456
'picard.ui.options', 'picard.util'),
452
'locales': [('picard', os.path.split(po)[1][:-3], po) for po in glob.glob('po/*.po')],
457
'locales': [('picard', lang[0], os.path.join('po', lang[0]+".po")) for lang in UI_LANGUAGES],
453
458
'ext_modules': ext_modules,
454
459
'data_files': [],
484
489
generate_file('scripts/picard.py2exe.in', 'scripts/picard', {})
485
490
self.distribution.data_files.append(
486
491
("", ["discid.dll", "libfftw3-3.dll", "libofa.dll",
488
494
for locale in self.distribution.locales:
489
495
self.distribution.data_files.append(
490
496
("locale/" + locale[1] + "/LC_MESSAGES",
491
497
["build/locale/" + locale[1] + "/LC_MESSAGES/" + locale[0] + ".mo"]))
492
#self.distribution.data_files.append(
493
# ("imageformats", ["C:\\Qt\\4.2.3\\plugins\\imageformats\\qjpeg1.dll"]))
498
self.distribution.data_files.append(
499
("imageformats", [find_file_in_path("PyQt4/plugins/imageformats/qgif4.dll"),
500
find_file_in_path("PyQt4/plugins/imageformats/qjpeg4.dll"),
501
find_file_in_path("PyQt4/plugins/imageformats/qtiff4.dll")]))
496
504
print "*** creating the NSIS setup script ***"
497
pathname = "installer/picard-setup.nsi"
505
pathname = "installer\picard-setup.nsi"
498
506
generate_file(pathname + ".in", pathname,
499
507
{'name': 'MusicBrainz Picard',
500
508
'version': __version__})
501
509
print "*** compiling the NSIS setup script ***"
502
510
from ctypes import windll
503
res = windll.shell32.ShellExecuteA(0, "compile", pathname, None, None, 0)
511
operation = 'compile'
512
res = windll.shell32.ShellExecuteA(0, operation, pathname, None, None, 0)
505
raise RuntimeError, "ShellExecute failed, error %d" % res
514
raise RuntimeError, 'ShellExecute failed executing "%s %s", error %d' % (
515
operation, pathname, res)
507
517
args['cmdclass']['bdist_nsis'] = bdist_nsis
508
518
args['windows'] = [{
512
522
args['options'] = {
514
'includes': ['sip', 'PyQt4._qt'] + [e.name for e in ext_modules],
524
'includes': ['sip'] + [e.name for e in ext_modules],
515
525
'excludes': ['ssl', 'socket', 'bz2'],