From 0f5fcd7c787413e36860f8f52fe79c8548eb9f30 Mon Sep 17 00:00:00 2001 From: Andy Mender Date: Nov 27 2020 14:39:10 +0000 Subject: [PATCH 1/3] Update to build21 and fix related issues Signed-off-by: Andy Mender --- diff --git a/.gitignore b/.gitignore index b628ff6..bf9afc0 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ Widelands-Build14-src.7z /widelands-build18-src.tar.bz2 /widelands-build19-src-gcc7.tar.bz2 /widelands-build20.tar.bz2 +/widelands-build21.tar.gz diff --git a/sources b/sources index 2f2daee..6320802 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (widelands-build20.tar.bz2) = 25280db6a57adeb37d13db35ce9eb41a5478534b04772240f6228c180f5a41a55fc414dab66e724945442985cbbba7a8a59a582291aca176e0bd8ae6c08760e5 +SHA512 (widelands-build21.tar.gz) = 8d36bd0407a72e4e221155121f9ab4ce7fdfb6d81ca70a2772baf12c3397fc6abbcad5006336adb471d2c5127a90b4cda735e941d69cf779be1f923d4a38960e diff --git a/widelands-build19-ppc64le.patch b/widelands-build19-ppc64le.patch index e8ba79c..ccc42fa 100644 --- a/widelands-build19-ppc64le.patch +++ b/widelands-build19-ppc64le.patch @@ -1,7 +1,8 @@ -diff -up widelands-build20/CMakeLists.txt~ widelands-build20/CMakeLists.txt ---- widelands-build20/CMakeLists.txt~ 2019-05-02 07:23:39.000000000 +0200 -+++ widelands-build20/CMakeLists.txt 2019-05-13 15:21:05.368834756 +0200 -@@ -167,7 +167,7 @@ else() +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 018d9ea08a..8fadae6402 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -205,7 +205,7 @@ else() message(FATAL_ERROR "Unknown CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}") endif() @@ -9,4 +10,4 @@ diff -up widelands-build20/CMakeLists.txt~ widelands-build20/CMakeLists.txt +wl_add_flag(WL_GENERIC_CXX_FLAGS "-std=gnu++11") if(OPTION_ASAN) - message(STATUS "Using AddressSanitizer http://clang.llvm.org/docs/AddressSanitizer.html") + message(STATUS "Using AddressSanitizer https://clang.llvm.org/docs/AddressSanitizer.html") diff --git a/widelands-build20-boost173.patch b/widelands-build20-boost173.patch deleted file mode 100644 index 086727f..0000000 --- a/widelands-build20-boost173.patch +++ /dev/null @@ -1,19 +0,0 @@ ---- widelands-build20/src/editor/ui_menus/categorized_item_selection_menu.h~ 2020-06-03 00:22:10.694007616 +0100 -+++ widelands-build20/src/editor/ui_menus/categorized_item_selection_menu.h 2020-06-03 00:22:22.614014406 +0100 -@@ -25,6 +25,7 @@ - #include - - #include "boost/format.hpp" -+#include "boost/bind/bind.hpp" - - #include "base/i18n.h" - #include "graphic/image.h" -@@ -124,7 +125,7 @@ - - UI::Checkbox* cb = create_checkbox(horizontal, descriptions_.get(i)); - cb->set_state(tool_->is_enabled(i)); -- cb->changedto.connect(boost::bind(&CategorizedItemSelectionMenu::selected, this, i, _1)); -+ cb->changedto.connect(boost::bind(&CategorizedItemSelectionMenu::selected, this, i, boost::placeholders::_1)); - checkboxes_[i] = cb; - horizontal->add(cb); - horizontal->add_space(kSpacing); diff --git a/widelands-build20-gcc10.patch b/widelands-build20-gcc10.patch index 9ecdd86..53d6021 100644 --- a/widelands-build20-gcc10.patch +++ b/widelands-build20-gcc10.patch @@ -10,15 +10,6 @@ This fixes this. diff -Nrup a/src/ui_basic/box.cc b/src/ui_basic/box.cc --- a/src/ui_basic/box.cc 2019-05-01 23:23:39.000000000 -0600 +++ b/src/ui_basic/box.cc 2019-11-12 16:10:28.893117299 -0700 -@@ -104,7 +104,7 @@ void Box::update_desired_size() { - int maxbreadth = mindesiredbreadth_; - - for (uint32_t idx = 0; idx < items_.size(); ++idx) { -- int depth, breadth = 0; -+ int depth = 0, breadth = 0; - get_item_desired_size(idx, &depth, &breadth); - - totaldepth += depth; @@ -158,7 +158,7 @@ void Box::layout() { int totaldepth = 0; @@ -28,7 +19,7 @@ diff -Nrup a/src/ui_basic/box.cc b/src/ui_basic/box.cc get_item_desired_size(idx, &depth, &unused); totaldepth += depth; } -@@ -243,7 +243,7 @@ void Box::update_positions() { +@@ -246,7 +246,7 @@ void Box::update_positions() { } for (uint32_t idx = 0; idx < items_.size(); ++idx) { diff --git a/widelands-build20-gcc91.patch b/widelands-build20-gcc91.patch deleted file mode 100644 index 5bb7a06..0000000 --- a/widelands-build20-gcc91.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff -up widelands-build20/src/graphic/gl/fields_to_draw.h~ widelands-build20/src/graphic/gl/fields_to_draw.h ---- widelands-build20/src/graphic/gl/fields_to_draw.h~ 2019-05-02 07:23:39.000000000 +0200 -+++ widelands-build20/src/graphic/gl/fields_to_draw.h 2019-07-14 21:39:12.805869365 +0200 -@@ -102,15 +102,11 @@ private: - // coordinates in the map. Returns kInvalidIndex if this field is not in the - // fields_to_draw. - inline int calculate_index(int fx, int fy) const { -- uint16_t xidx = fx - min_fx_; -- if (xidx >= w_) { -+ if (fx < min_fx_ || fx > max_fx_ || -+ fy < min_fy_ || fy > max_fy_) { - return kInvalidIndex; - } -- uint16_t yidx = fy - min_fy_; -- if (yidx >= h_) { -- return kInvalidIndex; -- } -- return yidx * w_ + xidx; -+ return (fy - min_fy_) * w_ + (fx - min_fx_); - } - - // Minimum and maximum field coordinates (geometric) to render. Can be negative. diff --git a/widelands.appdata.xml b/widelands.appdata.xml deleted file mode 100644 index 706d681..0000000 --- a/widelands.appdata.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - widelands.desktop - CC0-1.0 - GPL-2.0+ - Widelands - Open source realtime-strategy game - -

- Widelands is a free, open source real-time strategy game with - singleplayer campaigns and a multiplayer mode. It is easy to get - started through playable tutorials. -

-

- In Widelands, you are the regent of a small clan. You start out with - nothing but your headquarters, where all your resources are stored. -

-

- In the course of the game, you will build an ever growing settlement. - Every member of your clan will do his or her part to produce more - resources - wood, food, iron, gold and more - to further this growth. - The economic network is complex and different in the three tribes - (Barbarians, Imperials, and Atlanteans). -

-
- https://wl.widelands.org/ - https://wl.widelands.org/wiki/Game%20Manual/ - - https://wl.widelands.org/wlmedia/wlscreens/screens/Build%2019/Dolomites.png - https://wl.widelands.org/wlmedia/wlscreens/screens/Build%2019/Barbarian%20Buildings.png - https://wl.widelands.org/wlmedia/wlscreens/screens/Build%2019/Worker%20Icons.png - - jwrdegoede_at_fedoraproject.org -
diff --git a/widelands.desktop b/widelands.desktop deleted file mode 100644 index c43ffec..0000000 --- a/widelands.desktop +++ /dev/null @@ -1,9 +0,0 @@ -[Desktop Entry] -Type=Application -Name=Widelands -GenericName=Realtime Strategy Game -Comment=Build a growing settlement and rule the world -Icon=widelands -Exec=widelands -Categories=Game;StrategyGame; -Keywords=Game;RTS;Real-time;Strategy; diff --git a/widelands.spec b/widelands.spec index 6ff2622..9a91f4d 100644 --- a/widelands.spec +++ b/widelands.spec @@ -1,24 +1,22 @@ %undefine __cmake_in_source_build -%global buildno 20 +%global buildno 21 %global buildid build%{buildno} -# The game contains a copy of these fonts, we replaces these with symlinks to the system versions of these fonts -%global fonts font(amiri) font(dejavusans) font(dejavusansmono) font(dejavuserif) font(widelands) font(lklug) font(wenquanyimicrohei) +# The game contains a copy of these fonts, we replace these with symlinks to the system versions of these fonts +%global fonts font(amiri) font(dejavusans) font(dejavusansmono) font(dejavuserif) font(widelands) font(gargi) font(wenquanyimicrohei) Name: widelands Version: 0 -Release: 0.80.%{buildid}%{?dist} +Release: 0.81.%{buildid}%{?dist} Summary: Open source realtime-strategy game License: GPLv2+ URL: http://www.widelands.org -Source0: https://launchpad.net/widelands/%{buildid}/%{buildid}/+download/widelands-%{buildid}.tar.bz2 -Source1: %{name}.desktop -Source2: %{name}.appdata.xml +Source0: https://github.com/widelands/widelands/archive/%{buildid}/%{name}-%{buildid}.tar.gz +# gnu++11 fix in CMakeLists.txt for PPC64 little-endian Patch0: widelands-build19-ppc64le.patch -Patch1: widelands-build20-gcc91.patch -Patch2: widelands-build20-gcc10.patch -Patch3: widelands-build20-boost173.patch +# Fix failures on s390x due to uninitialized variables +Patch1: widelands-build20-gcc10.patch BuildRequires: SDL2-devel BuildRequires: SDL2_image-devel @@ -27,7 +25,8 @@ BuildRequires: SDL2_ttf-devel BuildRequires: boost-devel >= 1.48.0 BuildRequires: cmake BuildRequires: ctags -BuildRequires: desktop-file-utils libappstream-glib +BuildRequires: desktop-file-utils +BuildRequires: libappstream-glib BuildRequires: gettext BuildRequires: gcc BuildRequires: gcc-c++ @@ -35,7 +34,8 @@ BuildRequires: glew-devel BuildRequires: libpng-devel # For the %%build part generating the symlinks BuildRequires: fontconfig %{fonts} -Requires: hicolor-icon-theme %{fonts} +Requires: hicolor-icon-theme +Requires: %{fonts} %description Widelands is an open source (GPLed), realtime-strategy game, using SDL and @@ -45,8 +45,10 @@ perhaps will have a thought, what Widelands is all about. %prep -%autosetup -p1 -n widelands-%{buildid} +%setup -q -n widelands-%{buildid} +%patch0 -p1 +%patch1 -p1 %build LDFLAGS=-lGL @@ -63,17 +65,11 @@ LDFLAGS=-lGL %install %cmake_install -for i in 16 32 48 64 128; do - mkdir -p $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/${i}x${i}/apps - ln -s /usr/share/%{name}/images/logos/wl-ico-${i}.png $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/${i}x${i}/apps/%{name}.png -done +# Validate desktop file (provided by upstream) +desktop-file-validate $RPM_BUILD_ROOT%{_datadir}/applications/*.desktop -mkdir -p $RPM_BUILD_ROOT%{_datadir}/applications -desktop-file-install --dir $RPM_BUILD_ROOT%{_datadir}/applications %{SOURCE1} -mkdir -p $RPM_BUILD_ROOT%{_datadir}/appdata -install -p -m 644 %{SOURCE2} $RPM_BUILD_ROOT%{_datadir}/appdata -appstream-util validate-relax --nonet \ - $RPM_BUILD_ROOT%{_datadir}/appdata/%{name}.appdata.xml +# Validate appdata (provided by upstream) +appstream-util validate-relax --nonet $RPM_BUILD_ROOT%{_metainfodir}/*.appdata.xml pushd $RPM_BUILD_ROOT # Replace fonts with system fonts. We used to have symlinks directly from @@ -130,22 +126,28 @@ ln -s $(fc-match -f "%{file}" "monospace:italic") \ ln -s $(fc-match -f "%{file}" "monospace:bold:italic") \ usr/share/%{name}/i18n/fonts/dejavu-fonts/DejaVuSansMono-BoldOblique.ttf +# Chinese fonts rm -r usr/share/%{name}/i18n/fonts/MicroHei mkdir usr/share/%{name}/i18n/fonts/wqy-microhei-fonts ln -s wqy-microhei-fonts usr/share/%{name}/i18n/fonts/MicroHei ln -s $(fc-match -f "%{file}" "wenquanyimicrohei") \ usr/share/%{name}/i18n/fonts/wqy-microhei-fonts/wqy-microhei.ttc -rm -r usr/share/%{name}/i18n/fonts/Sinhala -mkdir usr/share/%{name}/i18n/fonts/lklug-fonts -ln -s lklug-fonts usr/share/%{name}/i18n/fonts/Sinhala -ln -s $(fc-match -f "%{file}" "lklug") \ - usr/share/%{name}/i18n/fonts/lklug-fonts/lklug.ttf +# Devanagari (Hindu) fonts +# Fedora doesn't ship Nakula, but other Devanagari font sets. +# Gargi is a TTF font set and should be compatible. +rm -r usr/share/%{name}/i18n/fonts/Nakula +mkdir usr/share/%{name}/i18n/fonts/gargi-fonts +ln -s gargi-fonts usr/share/%{name}/i18n/fonts/Nakula +ln -s $(fc-match -f "%{file}" "gargi") \ + usr/share/%{name}/i18n/fonts/gargi-fonts/nakula.ttf +# In-game Latin fonts - shipped as a separate package rm -r usr/share/%{name}/i18n/fonts/Widelands/* ln -s $(fc-match -f "%{file}" "widelands") \ usr/share/%{name}/i18n/fonts/Widelands/Widelands.ttf + # Scripting magic to add proper %%lang() markings to the locale files find usr/share/widelands/locale/ -maxdepth 1 -type d -name \*_\* | sed -n 's#\(usr/share/widelands/locale/\(.*\)_.*\)#%lang(\2) /\1#p' > %{_builddir}/widelands-%{buildid}/%{name}.files find usr/share/widelands/locale/ -maxdepth 1 -type d ! -name "*_*" | sed -n -e 's#\(usr/share/widelands/locale/\(.\+\)\)#%lang(\2) /\1#p' >> %{_builddir}/widelands-%{buildid}/%{name}.files @@ -156,23 +158,28 @@ popd %files -f %{name}.files %doc ChangeLog CREDITS %license COPYING +%{_mandir}/man6/widelands.6.gz %{_bindir}/%{name} -%{_datadir}/icons/hicolor/16x16/apps/%{name}.png -%{_datadir}/icons/hicolor/32x32/apps/%{name}.png -%{_datadir}/icons/hicolor/48x48/apps/%{name}.png -%{_datadir}/icons/hicolor/64x64/apps/%{name}.png -%{_datadir}/icons/hicolor/128x128/apps/%{name}.png -%{_datadir}/appdata/%{name}.appdata.xml -%{_datadir}/applications/%{name}.desktop +%{_datadir}/icons/hicolor/*/apps/*.png +%{_metainfodir}/*.appdata.xml +%{_datadir}/applications/*.desktop %dir %{_datadir}/%{name} %dir %{_datadir}/%{name}/locale %changelog +* Thu Nov 26 2020 Andy Mender - 0-0.81.build21 +- Update to build21 +- Clean up patches +- Point Source0 to GitHub release tarballs +- Fix new issues with fonts +- Use appdata and desktop file provided by upstream +- Update records in %%files section + * Wed Jul 29 2020 Fedora Release Engineering - 0-0.80.build20 - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild -* Wed Jun 03 2020 Jonathan Wakely - 0-0.79. +* Wed Jun 03 2020 Jonathan Wakely - 0-0.79.build20 - Rebuilt for Boost 1.73 * Sat May 16 2020 Pete Walter - 0-0.78.build20 From 9b88cec9b15ba0c4a252736b5a2411ad1ad23fb6 Mon Sep 17 00:00:00 2001 From: Andy Mender Date: Nov 27 2020 17:04:12 +0000 Subject: [PATCH 2/3] Unbundle Culmus fonts for Hebrew Signed-off-by: Andy Mender --- diff --git a/widelands.spec b/widelands.spec index 9a91f4d..cbc8446 100644 --- a/widelands.spec +++ b/widelands.spec @@ -3,11 +3,11 @@ %global buildno 21 %global buildid build%{buildno} # The game contains a copy of these fonts, we replace these with symlinks to the system versions of these fonts -%global fonts font(amiri) font(dejavusans) font(dejavusansmono) font(dejavuserif) font(widelands) font(gargi) font(wenquanyimicrohei) +%global fonts font(amiri) font(dejavusans) font(dejavusansmono) font(dejavuserif) font(widelands) font(gargi) font(wenquanyimicrohei) font(frankruehlclm) Name: widelands Version: 0 -Release: 0.81.%{buildid}%{?dist} +Release: 0.82.%{buildid}%{?dist} Summary: Open source realtime-strategy game License: GPLv2+ @@ -126,6 +126,19 @@ ln -s $(fc-match -f "%{file}" "monospace:italic") \ ln -s $(fc-match -f "%{file}" "monospace:bold:italic") \ usr/share/%{name}/i18n/fonts/dejavu-fonts/DejaVuSansMono-BoldOblique.ttf +# Hebrew fonts +rm -r usr/share/%{name}/i18n/fonts/Culmus +mkdir usr/share/%{name}/i18n/fonts/culmus-fonts +ln -s culmus-fonts usr/share/%{name}/i18n/fonts/Culmus +ln -s $(fc-match -f "%{file}" "frank:bold") \ + usr/share/%{name}/i18n/fonts/culmus-fonts/TaameyFrankCLM-Bold.ttf +ln -s $(fc-match -f "%{file}" "frank:bold:italic") \ + usr/share/%{name}/i18n/fonts/culmus-fonts/TaameyFrankCLM-BoldOblique.ttf +ln -s $(fc-match -f "%{file}" "frank:medium") \ + usr/share/%{name}/i18n/fonts/culmus-fonts/TaameyFrankCLM-Medium.ttf +ln -s $(fc-match -f "%{file}" "frank:medium:italic") \ + usr/share/%{name}/i18n/fonts/culmus-fonts/TaameyFrankCLM-MediumOblique.ttf + # Chinese fonts rm -r usr/share/%{name}/i18n/fonts/MicroHei mkdir usr/share/%{name}/i18n/fonts/wqy-microhei-fonts @@ -168,6 +181,9 @@ popd %changelog +* Fri Nov 27 2020 Andy Mender - 0-0.82.build21 +- Unbundle Culmus fonts + * Thu Nov 26 2020 Andy Mender - 0-0.81.build21 - Update to build21 - Clean up patches From d522fa65d7eed7fb68c99d76e1bef180b15d4155 Mon Sep 17 00:00:00 2001 From: Andy Mender Date: Nov 27 2020 18:21:13 +0000 Subject: [PATCH 3/3] Fix Culmus font discovery and linking Signed-off-by: Andy Mender --- diff --git a/widelands.spec b/widelands.spec index cbc8446..b326208 100644 --- a/widelands.spec +++ b/widelands.spec @@ -130,13 +130,13 @@ ln -s $(fc-match -f "%{file}" "monospace:bold:italic") \ rm -r usr/share/%{name}/i18n/fonts/Culmus mkdir usr/share/%{name}/i18n/fonts/culmus-fonts ln -s culmus-fonts usr/share/%{name}/i18n/fonts/Culmus -ln -s $(fc-match -f "%{file}" "frank:bold") \ +ln -s $(fc-match -f "%{file}" "frankruehlclm:bold") \ usr/share/%{name}/i18n/fonts/culmus-fonts/TaameyFrankCLM-Bold.ttf -ln -s $(fc-match -f "%{file}" "frank:bold:italic") \ +ln -s $(fc-match -f "%{file}" "frankruehlclm:bold:italic") \ usr/share/%{name}/i18n/fonts/culmus-fonts/TaameyFrankCLM-BoldOblique.ttf -ln -s $(fc-match -f "%{file}" "frank:medium") \ +ln -s $(fc-match -f "%{file}" "frankruehlclm:medium") \ usr/share/%{name}/i18n/fonts/culmus-fonts/TaameyFrankCLM-Medium.ttf -ln -s $(fc-match -f "%{file}" "frank:medium:italic") \ +ln -s $(fc-match -f "%{file}" "frankruehlclm:medium:italic") \ usr/share/%{name}/i18n/fonts/culmus-fonts/TaameyFrankCLM-MediumOblique.ttf # Chinese fonts