git: 5a58ab08535b - main - games/freeorion: unbreak build with boost-1.85

From: Dima Panov <fluffy_at_FreeBSD.org>
Date: Thu, 03 Oct 2024 10:27:26 UTC
The branch main has been updated by fluffy:

URL: https://cgit.FreeBSD.org/ports/commit/?id=5a58ab08535bdb3d19c5f9ae0fd2599fdfcd6954

commit 5a58ab08535bdb3d19c5f9ae0fd2599fdfcd6954
Author:     Dima Panov <fluffy@FreeBSD.org>
AuthorDate: 2024-10-02 23:30:56 +0000
Commit:     Dima Panov <fluffy@FreeBSD.org>
CommitDate: 2024-10-03 10:24:54 +0000

    games/freeorion: unbreak build with boost-1.85
    
    With hat:       office
    Sponsored by:   Future Crew, LLC
---
 games/freeorion/Makefile                           |  2 +-
 .../files/patch-GG_src_dialogs_FileDlg.cpp         | 42 ++++++++++++++++++++++
 games/freeorion/files/patch-util_Directories.cpp   | 31 ++++++++++++++++
 games/freeorion/files/patch-util_OptionsDB.cpp     | 12 +++++++
 4 files changed, 86 insertions(+), 1 deletion(-)

diff --git a/games/freeorion/Makefile b/games/freeorion/Makefile
index 30c3879cc34c..f83d9cf59f6d 100644
--- a/games/freeorion/Makefile
+++ b/games/freeorion/Makefile
@@ -1,7 +1,7 @@
 PORTNAME=	freeorion
 DISTVERSIONPREFIX=	v
 DISTVERSION=	0.5
-PORTREVISION=	3
+PORTREVISION=	4
 CATEGORIES=	games
 
 MAINTAINER=	amdmi3@FreeBSD.org
diff --git a/games/freeorion/files/patch-GG_src_dialogs_FileDlg.cpp b/games/freeorion/files/patch-GG_src_dialogs_FileDlg.cpp
new file mode 100644
index 000000000000..56afc2e3255f
--- /dev/null
+++ b/games/freeorion/files/patch-GG_src_dialogs_FileDlg.cpp
@@ -0,0 +1,42 @@
+--- GG/src/dialogs/FileDlg.cpp.orig	2023-03-21 15:16:58 UTC
++++ GG/src/dialogs/FileDlg.cpp
+@@ -9,7 +9,7 @@
+ 
+ #include <boost/cast.hpp>
+ #include <boost/algorithm/string/predicate.hpp>
+-#include <boost/filesystem/operations.hpp>
++#include <boost/filesystem.hpp>
+ #include <boost/format.hpp>
+ // boost::spirit::classic pulls in windows.h which in turn defines macro
+ // versions of min and max.  Defining NOMINMAX disables the creation of those
+@@ -215,7 +215,7 @@ void FileDlg::CompleteConstruction()
+ 
+     if (!m_init_filename.empty()) {
+         fs::path filename_path = fs::system_complete(fs::path(m_init_filename));
+-        m_files_edit->SetText(filename_path.leaf().string());
++        m_files_edit->SetText(filename_path.filename().string());
+     }
+ }
+ 
+@@ -548,7 +548,7 @@ void FileDlg::UpdateList()
+     if (!m_in_win32_drive_selection) {
+         // parent directory selector
+         if ((s_working_dir.string() != s_working_dir.root_path().string() &&
+-             !s_working_dir.branch_path().string().empty()) ||
++             !s_working_dir.parent_path().string().empty()) ||
+             Win32Paths())
+         {
+             auto row = Wnd::Create<ListBox::Row>();
+@@ -694,10 +694,10 @@ void FileDlg::OpenDirectory()
+     } else if (directory == "..") {
+         // move to parent directory of current directory
+         if (s_working_dir.string() != s_working_dir.root_path().string() &&
+-            !s_working_dir.branch_path().string().empty())
++            !s_working_dir.parent_path().string().empty())
+         {
+             // move to new directory
+-            SetWorkingDirectory(s_working_dir.branch_path());
++            SetWorkingDirectory(s_working_dir.parent_path());
+ 
+         } else {
+             // switch to drive selection mode
diff --git a/games/freeorion/files/patch-util_Directories.cpp b/games/freeorion/files/patch-util_Directories.cpp
new file mode 100644
index 000000000000..40f9b22f6b6d
--- /dev/null
+++ b/games/freeorion/files/patch-util_Directories.cpp
@@ -0,0 +1,31 @@
+--- util/Directories.cpp.orig	2023-03-21 15:16:58 UTC
++++ util/Directories.cpp
+@@ -4,9 +4,8 @@
+ #include "i18n.h"
+ 
+ #include <boost/algorithm/string/trim.hpp>
+-#include <boost/filesystem/convenience.hpp>
+-#include <boost/filesystem/operations.hpp>
+ #include <boost/date_time/posix_time/posix_time.hpp>
++#include <boost/filesystem.hpp>
+ 
+ #include <cstdlib>
+ #include <mutex>
+@@ -266,7 +265,7 @@ void InitBinDir(std::string const& argv0)
+ #if defined(FREEORION_WIN32)
+     try {
+         fs::path binary_file = fs::system_complete(FilenameToPath(argv0));
+-        bin_dir = binary_file.branch_path();
++        bin_dir = binary_file.parent_path();
+     } catch (const fs::filesystem_error &) {
+         bin_dir = fs::initial_path();
+     }
+@@ -315,7 +314,7 @@ void InitBinDir(std::string const& argv0)
+             std::string path_text(buf);
+ 
+             fs::path binary_file = fs::system_complete(fs::path(path_text));
+-            bin_dir = binary_file.branch_path();
++            bin_dir = binary_file.parent_path();
+ 
+             // check that a "freeoriond" file (hopefully the freeorion server binary) exists in the found directory
+             fs::path p(bin_dir);
diff --git a/games/freeorion/files/patch-util_OptionsDB.cpp b/games/freeorion/files/patch-util_OptionsDB.cpp
new file mode 100644
index 000000000000..90e022129ffc
--- /dev/null
+++ b/games/freeorion/files/patch-util_OptionsDB.cpp
@@ -0,0 +1,12 @@
+--- util/OptionsDB.cpp.orig	2023-03-21 15:16:58 UTC
++++ util/OptionsDB.cpp
+@@ -14,8 +14,7 @@
+ #include <boost/algorithm/string/classification.hpp>
+ #include <boost/algorithm/string/erase.hpp>
+ #include <boost/algorithm/string/predicate.hpp>
+-#include <boost/filesystem/fstream.hpp>
+-#include <boost/filesystem/operations.hpp>
++#include <boost/filesystem.hpp>
+ #include <boost/range/algorithm_ext/erase.hpp>
+ #include <boost/tokenizer.hpp>
+