#1 Update to build21 and fix related issues
Opened 3 years ago by andymenderunix. Modified 3 years ago
rpms/ andymenderunix/widelands master  into  rawhide

file modified
+1
@@ -5,3 +5,4 @@ 

  /widelands-build18-src.tar.bz2

  /widelands-build19-src-gcc7.tar.bz2

  /widelands-build20.tar.bz2

+ /widelands-build21.tar.gz

file modified
+1 -1
@@ -1,1 +1,1 @@ 

- SHA512 (widelands-build20.tar.bz2) = 25280db6a57adeb37d13db35ce9eb41a5478534b04772240f6228c180f5a41a55fc414dab66e724945442985cbbba7a8a59a582291aca176e0bd8ae6c08760e5

+ SHA512 (widelands-build21.tar.gz) = 8d36bd0407a72e4e221155121f9ab4ce7fdfb6d81ca70a2772baf12c3397fc6abbcad5006336adb471d2c5127a90b4cda735e941d69cf779be1f923d4a38960e

@@ -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 @@ 

  +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")

@@ -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 <string>

-  

-  #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);

file modified
+1 -10
@@ -10,15 +10,6 @@ 

  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 @@ 

   		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) {

@@ -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.

file removed
-34
@@ -1,34 +0,0 @@ 

- <?xml version="1.0" encoding="utf-8"?>

- <component type="desktop">

-   <id>widelands.desktop</id>

-   <metadata_license>CC0-1.0</metadata_license>

-   <project_license>GPL-2.0+</project_license>

-   <name>Widelands</name>

-   <summary>Open source realtime-strategy game</summary>

-   <description>

-     <p>

-       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. 

-     </p>

-     <p>

-       In Widelands, you are the regent of a small clan. You start out with

-       nothing but your headquarters, where all your resources are stored.

-     </p>

-     <p>

-       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).

-     </p>

-   </description>

-   <url type="homepage">https://wl.widelands.org/</url>

-   <url type="help">https://wl.widelands.org/wiki/Game%20Manual/</url>

-   <screenshots>

-     <screenshot type="default">https://wl.widelands.org/wlmedia/wlscreens/screens/Build%2019/Dolomites.png</screenshot>

-     <screenshot>https://wl.widelands.org/wlmedia/wlscreens/screens/Build%2019/Barbarian%20Buildings.png</screenshot>

-     <screenshot>https://wl.widelands.org/wlmedia/wlscreens/screens/Build%2019/Worker%20Icons.png</screenshot>

-   </screenshots>

-   <updatecontact>jwrdegoede_at_fedoraproject.org</updatecontact>

- </component>

file removed
-9
@@ -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;

file modified
+59 -36
@@ -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) font(frankruehlclm)

  

  Name:           widelands

  Version:        0

- Release:        0.80.%{buildid}%{?dist}

+ Release:        0.82.%{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: 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: 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 @@ 

  

  

  %prep

- %autosetup -p1 -n widelands-%{buildid}

+ %setup -q -n widelands-%{buildid}

  

+ %patch0 -p1

+ %patch1 -p1

  

  %build

  LDFLAGS=-lGL
@@ -63,17 +65,11 @@ 

  %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,41 @@ 

  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}" "frankruehlclm:bold") \

+   usr/share/%{name}/i18n/fonts/culmus-fonts/TaameyFrankCLM-Bold.ttf

+ 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}" "frankruehlclm:medium") \

+   usr/share/%{name}/i18n/fonts/culmus-fonts/TaameyFrankCLM-Medium.ttf

+ ln -s $(fc-match -f "%{file}" "frankruehlclm: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

  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 +171,31 @@ 

  %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

+ * Fri Nov 27 2020 Andy Mender <andymenderunix@fedoraproject.org> - 0-0.82.build21

+ - Unbundle Culmus fonts

+ 

+ * Thu Nov 26 2020 Andy Mender <andymenderunix@fedoraproject.org> - 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 <releng@fedoraproject.org> - 0-0.80.build20

  - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild

  

- * Wed Jun 03 2020 Jonathan Wakely <jwakely@redhat.com> - 0-0.79.

+ * Wed Jun 03 2020 Jonathan Wakely <jwakely@redhat.com> - 0-0.79.build20

  - Rebuilt for Boost 1.73

  

  * Sat May 16 2020 Pete Walter <pwalter@fedoraproject.org> - 0-0.78.build20

Signed-off-by: Andy Mender andymenderunix@gmail.com

This PR updates Widelands to build21 (latest stable from upstream) and fixes related issues:
- Changes the Source0 field to point to GitHub release tarballs, since I think this is the primary upstream source
- Removed the Source1 and Source2 files, since upstream now provides appdata XML and a desktop file
- Removed icon related tweaks (upstream now also correctly ships icons)
- Fixed font related issues (Sinhala is no longer used upstream, Nakula was added and replaced with Gargi from our repos)
- Records in %%files were updated

I still need to unbundle Culmus fonts as I forgot about it before.

1 new commit added

  • Unbundle Culmus fonts for Hebrew
3 years ago

1 new commit added

  • Fix Culmus font discovery and linking
3 years ago

Culmus fonts are now unbundled with fixed path discovery via fc-match. However, it is noted in the Widelands tarball that their bundled fonts are not identical to the Frank Ruehl CLM fonts usually shipped as packages:

"Taamey Frank" fonts family is my adaptation of the classical
Frank Ruehl Hebrew font. The letter forms are slightly
different then the "Frank Ruehl CLM" font. Since the font supports
cantillation marks positioning, the line spacing is wider then
in the standard fonts so as to leave space for all marks.
Yoram Gnat

I would consider this a "good enough" approach.

Koji build: https://koji.fedoraproject.org/koji/taskinfo?taskID=56335123

Thank you for your pull-req and sorry to be slow with responding. Are you perhaps already a Fedora packager? If so I would be more then happy to have you as a co-maintainer and give you commit access to widelands.

If not then I've put this on my TODO list and will hopefully get around to reviewing and merging this soon.

Yes, I already am a Fedora packager and maintain a couple of packages. I would be very happy to act as a co-maintainer for widelands :).

I would also like to apologize for the scope of this PR. What was originally meant as an update from build20 to build21 turned into a general "enhancement" effort.

If you'd like me to, I can split out the bits which deal with font unbundling into a separate PR.

I have given you commit access to the project. Feel free to push what you have as is, or if you want to split it into multiple commits to split the rebase vs the cleanup then that is fine too.

And of course don't forget to kickof a build once you're happy with what is in git.

Note I'm fine with pushing this to f33 (including creating a bodhi update for it) too, given that Fedora is usually about tracking upstream pretty closely. But if you are more comfortable with only pushing this to rawhide, then that is fine too.