dolphin/Source/Core/DolphinWX/SConscript
Glenn Rice 4ccb31e7af Move translation po files to an external svn repository. The location is http://dolphin-emu-translations.googlecode.com/svn/trunk. I have given some of the primary dolphin committers write access to that repository. If you are a dolphin-emu committer, and I didn't give you access, and you want it, just let me know.
Now po files can be updated as often as we want without bumping up the svn revision numbers of dolphin itself.  I left the dolphin-emu.pot and primary build files in the primary dolphin-emu svn.  The dolphin-emu.pot file will still need to be updated on occasion to reflect changes to strings in the program.  The gettextize script will still work as before for this.
Also added Arabic translations to the build thanks to mansoor.


git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7343 8ced0084-cf51-0410-be5f-012b33b47a6e
2011-03-14 13:33:11 +00:00

139 lines
4.2 KiB
Python

# -*- python -*-
Import('env')
import os
import sys
from SconsTests import utils
if env['nowx']:
files = ['Src/MainNoGUI.cpp']
else:
files = [
'Src/ARCodeAddEdit.cpp',
'Src/AboutDolphin.cpp',
'Src/CheatsWindow.cpp',
'Src/ConfigMain.cpp',
'Src/Debugger/BreakpointDlg.cpp',
'Src/Debugger/BreakpointView.cpp',
'Src/Debugger/BreakpointWindow.cpp',
'Src/Debugger/CodeView.cpp',
'Src/Debugger/CodeWindow.cpp',
'Src/Debugger/CodeWindowFunctions.cpp',
'Src/Debugger/DSPDebugWindow.cpp',
'Src/Debugger/DSPRegisterView.cpp',
'Src/Debugger/DebuggerPanel.cpp',
'Src/Debugger/DebuggerUIUtil.cpp',
'Src/Debugger/JitWindow.cpp',
'Src/Debugger/MemoryCheckDlg.cpp',
'Src/Debugger/MemoryView.cpp',
'Src/Debugger/MemoryWindow.cpp',
'Src/Debugger/RegisterView.cpp',
'Src/Debugger/RegisterWindow.cpp',
'Src/Frame.cpp',
'Src/FrameAui.cpp',
'Src/FrameTools.cpp',
'Src/GameListCtrl.cpp',
'Src/GeckoCodeDiag.cpp',
'Src/HotkeyDlg.cpp',
'Src/ISOFile.cpp',
'Src/ISOProperties.cpp',
'Src/InputConfigDiag.cpp',
'Src/InputConfigDiagBitmaps.cpp',
'Src/LogConfigWindow.cpp',
'Src/LogWindow.cpp',
'Src/Main.cpp',
'Src/MemcardManager.cpp',
'Src/MemoryCards/GCMemcard.cpp',
'Src/MemoryCards/WiiSaveCrypted.cpp',
'Src/NetWindow.cpp',
'Src/PHackSettings.cpp',
'Src/PatchAddEdit.cpp',
'Src/UDPConfigDiag.cpp',
'Src/VideoConfigDiag.cpp',
'Src/WXInputBase.cpp',
'Src/WiimoteConfigDiag.cpp',
'Src/WxUtils.cpp',
]
if sys.platform == 'win32':
files += ['Src/stdafx.cpp']
elif sys.platform == 'darwin':
env['CPPPATH'] += ['#Externals']
env['FRAMEWORKPATH'] += ['Externals/Cg']
env['FRAMEWORKS'] += ['ApplicationServices', 'Carbon', 'Cocoa']
env['FRAMEWORKS'] += ['AudioUnit', 'IOBluetooth', 'IOKit', 'OpenGL']
env['FRAMEWORKSFLAGS'] = ['-Wl,-lazy_framework,Cg']
env['FRAMEWORKSFLAGS'] += ['-Wl,-weak_framework,OpenCL']
env['LIBS'] += ['iconv', 'z']
# XXX
env['FRAMEWORKSFLAGS'] += ['-Wl,-weak_framework,QuickTime']
env['FRAMEWORKSFLAGS'] += ['-Wl,-no_arch_warnings']
exe = '#' + env['prefix'] + '/Dolphin.app/Contents/MacOS/Dolphin'
if env['nowx']:
exe += 'NoGUI'
env.Install('#' + env['prefix'] + '/Dolphin.app/Contents/' +
'Frameworks/Cg.framework', source = [
'#Externals/Cg/Cg.framework/Cg',
'#Externals/Cg/Cg.framework/Resources'
])
env.Install(env['data_dir'], '#Data/Sys')
env.Install(env['data_dir'], '#Data/User')
env.Install(env['data_dir'],
'#Source/Core/DolphinWX/resources/Dolphin.icns')
languages = []
msgfmt = env.WhereIs('msgfmt')
if not msgfmt == None:
po_files = Glob('#Languages/po/*.po', strings = True)
for po in po_files:
index_lo = po.find('Languages/po/') + len('Languages/po/')
index_hi = po.find('.po')
lang = po[index_lo:index_hi]
lproj = os.sep + lang + '.lproj'
mo_dir = env['build_dir'] + '/Languages' + lproj
mo_file = mo_dir + '/dolphin-emu.mo'
env.Command('#' + mo_file, po, 'mkdir -p ' + mo_dir +
' && ' + msgfmt + ' -o ' + mo_file + ' ' + po)
env.Install(env['data_dir'] + lproj, '#' + mo_file)
languages += [lang]
from plistlib import writePlist
def createPlist(target, source, env):
for srcNode in source:
writePlist(srcNode.value, str(target[0]))
env.Append(BUILDERS = {'Plist' : Builder(action = createPlist)})
env.Plist('#' + env['prefix'] + '/Dolphin.app/Contents/Info.plist',
Value(dict(
CFBundleExecutable = 'Dolphin',
CFBundleIconFile = 'Dolphin.icns',
CFBundleIdentifier = 'com.dolphin-emulator.dolphin',
CFBundleLocalizations = languages,
CFBundlePackageType = 'APPL',
CFBundleShortVersionString =
utils.GenerateRevFile('', Dir('#None').abspath, None),
CFBundleVersion = '3.0',
LSMinimumSystemVersion = '10.5.4',
LSRequiresCarbon = True,
CFBundleDocumentTypes = [
dict(CFBundleTypeExtensions =
('ciso', 'dol', 'elf', 'gcm', 'gcz', 'iso', 'wad'),
CFBundleTypeIconFile = 'Dolphin.icns',
CFBundleTypeName = 'Nintendo GC/Wii file',
CFBundleTypeRole = 'Viewer')]
)))
env.Command('dummy', '#' + env['prefix'],
"find $SOURCES -name .svn -exec rm -rf {} +")
else:
files += ['Src/X11Utils.cpp']
exe = env['binary_dir'] + '/dolphin-emu'
if env['nowx']:
exe += '-nogui'
env.InstallAs(env['data_dir'] + '/sys', '#Data/Sys')
env.InstallAs(env['data_dir'] + '/user', '#Data/User')
env.Program(exe, files)