From 479f5d3670050cf5668e466ccac60c92b6dd2b3e Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Wed, 3 Jun 2015 20:06:34 +0200 Subject: [PATCH] build system: build Qt translation files on MingW --- .gitignore | 1 + Rakefile | 13 ++++++++++++- ac/qt5.m4 | 2 ++ build-config.in | 1 + 4 files changed, 16 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 88d87e90c..ec834a688 100644 --- a/.gitignore +++ b/.gitignore @@ -44,6 +44,7 @@ /lib/saxon-he /po/*.mo /po/mkvtoolnix.pot +/po/qt/*.qm /rake.d/dependency.d /share/icons/*/*.h /src/common/common.h.gch diff --git a/Rakefile b/Rakefile index 8f4eeed7f..8a6e9a021 100755 --- a/Rakefile +++ b/Rakefile @@ -173,6 +173,9 @@ def define_default_task # The GUI help targets << "translations:guides" if c?(:USE_WXWIDGETS) + # The Qt translation files: only for Windows + targets << "translations:qt" if c?(:MINGW) && !c(:LCONVERT).blank? + task :default => targets do puts "Done. Enjoy :)" end @@ -251,6 +254,12 @@ rule '.mo' => '.po' do |t| runq " MSGFMT #{t.source}", "msgfmt -c -o #{t.name} #{t.sources.join(" ")}" end +if !c(:LCONVERT).blank? + rule '.qm' => '.ts' do |t| + runq "LCONVERT #{t.source}", "#{c(:LCONVERT)} -o #{t.name} -i #{t.sources.join(" ")}" + end +end + # HTML help book stuff rule '.hhk' => '.hhc' do |t| runq " GREP #{t.source}", "#{c(:GREP)} -v 'name=\"ID\"' #{t.sources.join(" ")} > #{t.name}" @@ -401,6 +410,8 @@ EOT [ :applications, :manpages, :guides ].each { |type| task type => $translations[type] } + task :qt => FileList[ "#{$top_srcdir }/po/qt/*.ts" ].collect { |file| file.ext 'qm' } + $available_languages[:manpages].each do |language| $manpages.each do |manpage| name = manpage.gsub(/man\//, "man/#{language}/") @@ -643,7 +654,7 @@ task :clean do share/icons/*x*/*.h src/info/ui/*.h src/mkvtoolnix-gui/forms/**/*.h src/**/*.moc src/**/*.moco src/mkvtoolnix-gui/qt_resources.cpp tests/unit/**/*.o tests/unit/**/*.a tests/unit/all - po/*.mo doc/guide/**/*.hhk + po/*.mo po/qt/*.qm doc/guide/**/*.hhk } patterns += $applications + $tools.collect { |name| "src/tools/#{name}" } diff --git a/ac/qt5.m4 b/ac/qt5.m4 index 6dfc1a9fd..edb1bea20 100644 --- a/ac/qt5.m4 +++ b/ac/qt5.m4 @@ -228,6 +228,8 @@ return 0; BUILD_MKVTOOLNIX_GUI=no fi + AC_PATH_PROG(LCONVERT, lconvert) + else echo '*** Not checking for Qt: disabled by user request' fi diff --git a/build-config.in b/build-config.in index 20af646a1..caf00a5b1 100644 --- a/build-config.in +++ b/build-config.in @@ -55,6 +55,7 @@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c +LCONVERT = @LCONVERT@ LD = @LD@ MOC = @MOC@ OBJEXT = @OBJEXT@