setup.py: remove intltool dependency

This commit is contained in:
André Apitzsch 2017-09-08 23:32:19 +02:00
parent 06102e7d97
commit 7751c3e722
3 changed files with 17 additions and 30 deletions

View File

@ -1,7 +1,7 @@
[Desktop Entry] [Desktop Entry]
Categories=Network;InstantMessaging;RemoteAccess;ConsoleOnly; Categories=Network;InstantMessaging;RemoteAccess;ConsoleOnly;
_Name=Open URI using Gajim Name=Open URI using Gajim
_Keywords=chat;messaging;im;jabber;xmpp;bonjour;voip; Keywords=chat;messaging;im;jabber;xmpp;bonjour;voip;
Version=1.0 Version=1.0
Exec=gajim-remote handle_uri %u Exec=gajim-remote handle_uri %u
TryExec=gajim-remote TryExec=gajim-remote

View File

@ -1,9 +1,9 @@
[Desktop Entry] [Desktop Entry]
Categories=Network;InstantMessaging;GTK;GNOME; Categories=Network;InstantMessaging;GTK;GNOME;
_Name=Gajim Name=Gajim
_GenericName=Jabber IM Client GenericName=Jabber IM Client
_Comment=A GTK+ Jabber client Comment=A GTK+ Jabber client
_Keywords=chat;messaging;im;xmpp;bonjour;voip; Keywords=chat;messaging;im;xmpp;bonjour;voip;
Version=1.0 Version=1.0
Exec=gajim Exec=gajim
Icon=org.gajim.Gajim Icon=org.gajim.Gajim

View File

@ -83,9 +83,9 @@ def build_intl(build_cmd):
data_files = build_cmd.distribution.data_files data_files = build_cmd.distribution.data_files
base = cwd base = cwd
merge_files = (('data/org.gajim.Gajim.desktop', 'share/applications', '-d'), merge_files = (('data/org.gajim.Gajim.desktop', 'share/applications', '--desktop'),
('data/gajim-remote.desktop', 'share/applications', '-d'), ('data/gajim-remote.desktop', 'share/applications', '--desktop'),
('data/org.gajim.Gajim.appdata.xml', 'share/metainfo', '-x')) ('data/org.gajim.Gajim.appdata.xml', 'share/metainfo', '--xml'))
for filename, target, option in merge_files: for filename, target, option in merge_files:
filenamelocal = convert_path(filename) filenamelocal = convert_path(filename)
@ -110,30 +110,17 @@ def substitute_variables(filename_in, filename_out, subst_vars):
f_out.close() f_out.close()
def merge(in_file, out_file, option, po_dir='po', cache=True): def merge(in_file, out_file, option, po_dir='po'):
''' '''
Run the intltool-merge command. Run the msgfmt command.
''' '''
option += ' -u'
if cache:
cache_file = os.path.join('po', '.intltool-merge-cache')
option += ' -c ' + cache_file
if (not os.path.exists(out_file) and os.path.exists(in_file)): if (not os.path.exists(out_file) and os.path.exists(in_file)):
if sys.platform == 'win32': cmd = (('msgfmt %(opt)s -d %(po_dir)s --template %(in_file)s '
cmd = (('set LC_ALL=C && perl -S intltool-merge %(opt)s %(po_dir)s %(in_file)s ' '-o %(out_file)s') %
'%(out_file)s') % {'opt' : option,
{'opt' : option, 'po_dir' : po_dir,
'po_dir' : po_dir, 'in_file' : in_file,
'in_file' : in_file, 'out_file' : out_file})
'out_file' : out_file})
else:
cmd = (('LC_ALL=C intltool-merge %(opt)s %(po_dir)s %(in_file)s '
'%(out_file)s') %
{'opt' : option,
'po_dir' : po_dir,
'in_file' : in_file,
'out_file' : out_file})
if os.system(cmd) != 0: if os.system(cmd) != 0:
msg = ('ERROR: %s was not merged into the translation files!\n' % msg = ('ERROR: %s was not merged into the translation files!\n' %
out_file) out_file)