Hello community,
here is the log from the commit of package solarus for openSUSE:Factory checked in at 2019-09-02 13:26:44
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/solarus (Old)
and /work/SRC/openSUSE:Factory/.solarus.new.7948 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "solarus"
Mon Sep 2 13:26:44 2019 rev:6 rq:727602 version:1.6.2
Changes:
--------
--- /work/SRC/openSUSE:Factory/solarus/solarus.changes 2019-08-22 10:54:41.993681145 +0200
+++ /work/SRC/openSUSE:Factory/.solarus.new.7948/solarus.changes 2019-09-02 13:26:45.465296527 +0200
@@ -1,0 +2,7 @@
+Sun Sep 1 10:01:01 UTC 2019 - antoine.belvire@opensuse.org
+
+- Fix translation loading:
+ * Update solarus-1.6.2-install-gui-translations.patch with
+ final version pushed to upstream.
+
+-------------------------------------------------------------------
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ solarus.spec ++++++
--- /var/tmp/diff_new_pack.a8lKQQ/_old 2019-09-02 13:26:45.977296430 +0200
+++ /var/tmp/diff_new_pack.a8lKQQ/_new 2019-09-02 13:26:45.981296430 +0200
@@ -24,7 +24,7 @@
Group: Amusements/Games/RPG
URL: https://www.solarus-games.org/
Source0: %{name}-%{version}.tar.bz2
-# PATCH-FEATURE-UPSTREAM -- install gui translations
+# PATCH-FEATURE-UPSTREAM -- https://gitlab.com/solarus-games/solarus/merge_requests/1311
Patch0: solarus-1.6.2-install-gui-translations.patch
BuildRequires: cmake
BuildRequires: gcc-c++
++++++ solarus-1.6.2-install-gui-translations.patch ++++++
--- /var/tmp/diff_new_pack.a8lKQQ/_old 2019-09-02 13:26:46.001296426 +0200
+++ /var/tmp/diff_new_pack.a8lKQQ/_new 2019-09-02 13:26:46.001296426 +0200
@@ -1,32 +1,54 @@
-From c9b890dfcc20c2d74039d8cd0bfe225562450da1 Mon Sep 17 00:00:00 2001
+From 640b293046ed7eec41d5034a5c45c9c707d89347 Mon Sep 17 00:00:00 2001
From: Antoine Belvire
-Date: Sun, 11 Aug 2019 14:45:00 +0200
-Subject: [PATCH] Install translations
+Date: Sat, 24 Aug 2019 14:14:07 +0200
+Subject: [PATCH] Install translations for GUI
+This adds a CMake install target for GUI qm files and allows the application to
+load them from installation path.
---
- cmake/AddInstallTargets.cmake | 4 ++++
+ cmake/AddInstallTargets.cmake | 1 +
+ gui/CMakeLists.txt | 1 +
+ gui/cmake/AddDefines.cmake | 3 +++
gui/cmake/AddInstallTargets.cmake | 4 ++++
- gui/src/{main.cpp => main.cpp.in} | 5 ++++-
- 3 files changed, 12 insertions(+), 1 deletion(-)
- rename gui/src/{main.cpp => main.cpp.in} (96%)
+ gui/src/main.cpp | 6 +++++-
+ 5 files changed, 14 insertions(+), 1 deletion(-)
+ create mode 100644 gui/cmake/AddDefines.cmake
diff --git a/cmake/AddInstallTargets.cmake b/cmake/AddInstallTargets.cmake
-index 953497449..8e50ed48e 100644
+index 953497449..73710c4ae 100644
--- a/cmake/AddInstallTargets.cmake
+++ b/cmake/AddInstallTargets.cmake
-@@ -15,6 +15,10 @@ else()
+@@ -15,6 +15,7 @@ else()
endif()
set(SOLARUS_MANUAL_INSTALL_DESTINATION "share/man" CACHE PATH "Manual install destination")
set(SOLARUS_HEADERS_INSTALL_DESTINATION "include" CACHE PATH "Headers install destination")
-+set(SOLARUS_GUI_TRANSLATIONS_INSTALL_DESTINATION "share/solarus-gui/translations" CACHE PATH "GUI translations install destination")
-+
-+# Set translation path to load .qm file from
-+configure_file("${CMAKE_SOURCE_DIR}/gui/src/main.cpp.in" "${CMAKE_SOURCE_DIR}/gui/src/main.cpp")
++set(SOLARUSGUI_INSTALL_DATADIR "share/solarus-gui" CACHE PATH "GUI data install destination")
# Files to install with make install.
# Install the shared library and the solarus-run executable.
+diff --git a/gui/CMakeLists.txt b/gui/CMakeLists.txt
+index 7e3d80f3f..505ea1dfd 100644
+--- a/gui/CMakeLists.txt
++++ b/gui/CMakeLists.txt
+@@ -5,6 +5,7 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON)
+ # Tell CMake to run moc automatically when needed
+ set(CMAKE_AUTOMOC ON)
+
++include(cmake/AddDefines.cmake)
+ include(cmake/AddDependencies.cmake)
+ include(cmake/AddIncludeDirectories.cmake)
+ include(cmake/AddSolarusGuiLibrary.cmake)
+diff --git a/gui/cmake/AddDefines.cmake b/gui/cmake/AddDefines.cmake
+new file mode 100644
+index 000000000..0d1aaa725
+--- /dev/null
++++ b/gui/cmake/AddDefines.cmake
+@@ -0,0 +1,3 @@
++# Add defines for the install path and the build path to help guess the assets
++# location at runtime
++add_definitions(-DSOLARUSGUI_TRANSLATION_PATH="${CMAKE_INSTALL_PREFIX}/${SOLARUSGUI_INSTALL_DATADIR}/translations")
diff --git a/gui/cmake/AddInstallTargets.cmake b/gui/cmake/AddInstallTargets.cmake
-index 460032827..1ac9b65f7 100644
+index d99f75a43..a229e6e36 100644
--- a/gui/cmake/AddInstallTargets.cmake
+++ b/gui/cmake/AddInstallTargets.cmake
@@ -12,6 +12,10 @@ install(FILES
@@ -35,26 +57,24 @@
)
+install(FILES
+ ${solarus-gui_TRANSLATIONS_QM}
-+ DESTINATION "${SOLARUS_GUI_TRANSLATIONS_INSTALL_DESTINATION}"
++ DESTINATION "${SOLARUSGUI_INSTALL_DATADIR}/translations"
+)
# FreeDesktop compatible icons
if(UNIX AND NOT APPLE)
-diff --git a/gui/src/main.cpp b/gui/src/main.cpp.in
-similarity index 96%
-rename from gui/src/main.cpp
-rename to gui/src/main.cpp.in
-index 984c478f4..532d09a62 100644
+diff --git a/gui/src/main.cpp b/gui/src/main.cpp
+index 984c478f4..c8b602c74 100644
--- a/gui/src/main.cpp
-+++ b/gui/src/main.cpp.in
-@@ -73,7 +73,10 @@ int run_gui(int argc, char* argv[]) {
++++ b/gui/src/main.cpp
+@@ -73,7 +73,11 @@ int run_gui(int argc, char* argv[]) {
application.installTranslator(&qt_translator);
QTranslator translator;
- translator.load("solarus_" + QLocale::system().name());
-+ bool translationLoaded = translator.load("solarus_" + QLocale::system().name());
-+ if (!translationLoaded) {
-+ translator.load("solarus_" + QLocale::system().name(), "@SOLARUS_GUI_TRANSLATIONS_INSTALL_DESTINATION@");
++ QString filename = "solarus_" + QLocale::system().name();
++ bool translation_loaded = translator.load(filename);
++ if (!translation_loaded) {
++ translator.load(filename, SOLARUSGUI_TRANSLATION_PATH);
+ }
application.installTranslator(&translator);