Accepting request 1174568 from games

I fixed the build according to docs, but I don't use that software, so probably it would be a good idea if somebody tests the fix. I added the patch to the relevant GitHub ticket as well, maybe somebody there tests it.


- fix build with boost 1.85 (fife-boost_1_85.patch)
- Applying swig4.patch on Leap 15.6/SLE15-SP6 too
  * swig 4.1.1 has been added to SLE15-SP6

OBS-URL: https://build.opensuse.org/request/show/1174568
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/fife?expand=0&rev=8
This commit is contained in:
Ana Guerrero 2024-05-16 15:17:04 +00:00 committed by Git OBS Bridge
commit 2e2055c652
3 changed files with 89 additions and 4 deletions

70
fife-boost_1_85.patch Normal file
View File

@ -0,0 +1,70 @@
diff -ur fifengine-0.4.2/engine/core/gui/fifechan/fifechanmanager.cpp fifengine-0.4.2_fix/engine/core/gui/fifechan/fifechanmanager.cpp
--- fifengine-0.4.2/engine/core/gui/fifechan/fifechanmanager.cpp 2019-01-11 18:24:38.000000000 +0100
+++ fifengine-0.4.2_fix/engine/core/gui/fifechan/fifechanmanager.cpp 2024-05-16 14:55:36.964378748 +0200
@@ -249,7 +249,13 @@
IFont* font = NULL;
GuiFont* guifont = NULL;
+ #if defined(USE_BOOST_FILESYSTEM_V3)
+ bfs::path p = fontpath;
+ std::string s = p.extension().string();
+ if( s == ".ttf" || s == ".ttc" ) {
+ #else
if( bfs::extension(fontpath) == ".ttf" || bfs::extension(fontpath) == ".ttc" ) {
+ #endif
font = new TrueTypeFont(fontpath, fontsize);
} else {
font = new SubImageFont(fontpath, fontglyphs);
diff -ur fifengine-0.4.2/engine/core/loaders/native/map/atlasloader.cpp fifengine-0.4.2_fix/engine/core/loaders/native/map/atlasloader.cpp
--- fifengine-0.4.2/engine/core/loaders/native/map/atlasloader.cpp 2019-01-11 18:24:38.000000000 +0100
+++ fifengine-0.4.2_fix/engine/core/loaders/native/map/atlasloader.cpp 2024-05-16 14:59:14.130949570 +0200
@@ -312,7 +312,12 @@
atlasElem->QueryValueAttribute("subimage_width", &subimageWidth);
atlasElem->QueryValueAttribute("subimage_height", &subimageHeight);
// file extension of the atlas is also used as subimage extension
- std::string extension = bfs::extension(*atlasSource);
+ #if defined(USE_BOOST_FILESYSTEM_V3)
+ bfs::path p = *atlasSource;
+ std::string extension = p.extension().string();
+ #else
+ std::string extension = bfs::extension(*atlasSource);
+ #endif
// we need an atlas id
if (!atlasId) {
atlasId = atlasSource;
diff -ur fifengine-0.4.2/engine/core/loaders/native/map/maploader.cpp fifengine-0.4.2_fix/engine/core/loaders/native/map/maploader.cpp
--- fifengine-0.4.2/engine/core/loaders/native/map/maploader.cpp 2019-01-11 18:24:38.000000000 +0100
+++ fifengine-0.4.2_fix/engine/core/loaders/native/map/maploader.cpp 2024-05-16 14:59:24.034430591 +0200
@@ -838,7 +838,13 @@
for (iter = files.begin(); iter != files.end(); ++iter) {
// TODO - vtchill - may need a way to allow clients to load things other
// than .xml and .zip files
- std::string ext = bfs::extension(*iter);
+ #if defined(USE_BOOST_FILESYSTEM_V3)
+ bfs::path p = *iter;
+ std::string ext = p.extension().string();
+ #else
+ std::string ext = bfs::extension(*iter)
+ #endif
+
if (ext == ".xml" || ext == ".zip") {
loadImportFile(*iter, importDirectoryString);
}
diff -ur fifengine-0.4.2/engine/core/loaders/native/map/objectloader.cpp fifengine-0.4.2_fix/engine/core/loaders/native/map/objectloader.cpp
--- fifengine-0.4.2/engine/core/loaders/native/map/objectloader.cpp 2019-01-11 18:24:38.000000000 +0100
+++ fifengine-0.4.2_fix/engine/core/loaders/native/map/objectloader.cpp 2024-05-16 14:59:19.167691348 +0200
@@ -702,7 +702,13 @@
for (iter = files.begin(); iter != files.end(); ++iter) {
// TODO - vtchill - may need a way to allow clients to load things other
// than .xml and .zip files
- std::string ext = bfs::extension(*iter);
+ #if defined(USE_BOOST_FILESYSTEM_V3)
+ bfs::path p = *iter;
+ std::string ext = p.extension().string();
+ #else
+ std::string ext = bfs::extension(*iter)
+ #endif
+
if (ext == ".xml" || ext == ".zip") {
loadImportFile(*iter, importDirectoryString);
}

View File

@ -1,3 +1,14 @@
-------------------------------------------------------------------
Thu May 16 13:00:56 UTC 2024 - Dirk Stoecker <opensuse@dstoecker.de>
- fix build with boost 1.85 (fife-boost_1_85.patch)
-------------------------------------------------------------------
Mon May 6 13:38:58 UTC 2024 - Max Lin <mlin@suse.com>
- Applying swig4.patch on Leap 15.6/SLE15-SP6 too
* swig 4.1.1 has been added to SLE15-SP6
-------------------------------------------------------------------
Mon Feb 26 08:36:34 UTC 2024 - Dominique Leuenberger <dimstar@opensuse.org>

View File

@ -1,7 +1,7 @@
#
# spec file for package fife
#
# Copyright (c) 2023 SUSE LLC
# Copyright (c) 2024 SUSE LLC
# Copyright (c) 2011 Nelson Marques <nmarques@opensuse.org>
#
# All modifications and additions to the file contributed by third parties
@ -32,6 +32,8 @@ Source: https://github.com/fifengine/fifengine/archive/%{version}/%{onam
Patch0: swig4.patch
# PATCH-FIX-UPSTREAM
Patch1: fife-boost_1_77.patch
# PATCH-FIX-UPSTREAM https://github.com/fifengine/fifengine/issues/1085
Patch2: fife-boost_1_85.patch
BuildRequires: cmake
BuildRequires: fifechan-devel
BuildRequires: gcc-c++
@ -94,11 +96,12 @@ game using Python interfaces.
%prep
%setup -q -n %{oname}-%{version}
# only apply the patch if swig 4 is used (currently: Tumbleweed)
%if 0%{?suse_version} > 1500
# only apply the patch if swig 4 is used (currently: Tumbleweed and Leap 15.6)
%if 0%{?suse_version} > 1500 || (0%{?suse_version} == 1500 && 0%{?sle_version} > 150500)
%patch -P 0 -p1
%endif
%patch -P 1 -p1
%patch -P 2 -p1
%build
%define __builddir py3
@ -108,7 +111,8 @@ game using Python interfaces.
-Drend-grid=ON \
-Dlibrocket=ON \
-Dbuild-python=ON \
-DPYTHON_SITE_PACKAGES=%{python3_sitearch}
-DPYTHON_SITE_PACKAGES=%{python3_sitearch} \
-DCMAKE_CXX_FLAGS='-DUSE_BOOST_FILESYSTEM_V3'
make VERBOSE=1 %{?_smp_mflags}
cd ..