Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 16 Oct 2024 19:03:16 GMT
From:      Nuno Teixeira <eduardo@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org
Subject:   git: 808053388a7c - main - editors/jucipp: Unbreak build with boost-1.85
Message-ID:  <202410161903.49GJ3Gkt047687@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by eduardo:

URL: https://cgit.FreeBSD.org/ports/commit/?id=808053388a7c67d21e521b8e9513883c49683823

commit 808053388a7c67d21e521b8e9513883c49683823
Author:     Mamadou Babaei <info@babaei.net>
AuthorDate: 2024-10-16 19:02:08 +0000
Commit:     Nuno Teixeira <eduardo@FreeBSD.org>
CommitDate: 2024-10-16 19:03:00 +0000

    editors/jucipp: Unbreak build with boost-1.85
    
    PR:             281961
---
 editors/jucipp/Makefile                          |   2 +-
 editors/jucipp/files/patch-src_source.cpp        | 106 +++++++++++++++++++++++
 editors/jucipp/files/patch-src_usages__clang.cpp |  32 +++++++
 editors/jucipp/files/patch-src_window.cpp        |  11 +++
 4 files changed, 150 insertions(+), 1 deletion(-)

diff --git a/editors/jucipp/Makefile b/editors/jucipp/Makefile
index ea0a9f1df63b..35f3e9e5a673 100644
--- a/editors/jucipp/Makefile
+++ b/editors/jucipp/Makefile
@@ -1,7 +1,7 @@
 PORTNAME=	jucipp
 DISTVERSIONPREFIX=	v
 DISTVERSION=	1.8.0
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	editors
 
 MAINTAINER=	info@babaei.net
diff --git a/editors/jucipp/files/patch-src_source.cpp b/editors/jucipp/files/patch-src_source.cpp
new file mode 100644
index 000000000000..27b739e533bc
--- /dev/null
+++ b/editors/jucipp/files/patch-src_source.cpp
@@ -0,0 +1,106 @@
+--- src/source.cpp.orig	2023-08-03 07:43:31 UTC
++++ src/source.cpp
+@@ -1193,57 +1193,61 @@ void Source::View::setup_format_style(bool is_generic_
+         try {
+           boost::property_tree::ptree pt;
+           boost::property_tree::xml_parser::read_xml(stdout_stream, pt);
+-          auto replacements_pt = pt.get_child("replacements", boost::property_tree::ptree());
+-          for(auto it = replacements_pt.rbegin(); it != replacements_pt.rend(); ++it) {
+-            if(it->first == "replacement") {
+-              auto offset = it->second.get<size_t>("<xmlattr>.offset");
+-              auto length = it->second.get<size_t>("<xmlattr>.length");
+-              auto replacement_str = it->second.get<std::string>("");
++          for(auto it_root = pt.begin(); it_root != pt.end(); ++it_root) {
++            if(it_root->first == "replacements") {
++              for(auto it = it_root->second.rbegin(); it != it_root->second.rend(); ++it) {
++                if(it->first == "replacement") {
++                  auto offset = it->second.get<size_t>("<xmlattr>.offset");
++                  auto length = it->second.get<size_t>("<xmlattr>.length");
++                  auto replacement_str = it->second.get<std::string>("");
+ 
+-              size_t bytes = 0;
+-              for(size_t c = 0; c < bytes_in_lines.size(); ++c) {
+-                auto previous_bytes = bytes;
+-                bytes += bytes_in_lines[c];
+-                if(offset < bytes || (c == bytes_in_lines.size() - 1 && offset == bytes)) {
+-                  std::pair<size_t, size_t> line_index(c, offset - previous_bytes);
+-                  auto start = get_buffer()->get_iter_at_line_index(line_index.first, line_index.second);
++                  size_t bytes = 0;
++                  for(size_t c = 0; c < bytes_in_lines.size(); ++c) {
++                    auto previous_bytes = bytes;
++                    bytes += bytes_in_lines[c];
++                    if(offset < bytes || (c == bytes_in_lines.size() - 1 && offset == bytes)) {
++                      std::pair<size_t, size_t> line_index(c, offset - previous_bytes);
++                      auto start = get_buffer()->get_iter_at_line_index(line_index.first, line_index.second);
+ 
+-                  // Use left gravity insert to avoid moving cursor from end of line
+-                  bool left_gravity_insert = false;
+-                  if(get_buffer()->get_insert()->get_iter() == start) {
+-                    auto iter = start;
+-                    do {
+-                      if(*iter != ' ' && *iter != '\t') {
+-                        left_gravity_insert = iter.ends_line();
+-                        break;
++                      // Use left gravity insert to avoid moving cursor from end of line
++                      bool left_gravity_insert = false;
++                      if(get_buffer()->get_insert()->get_iter() == start) {
++                        auto iter = start;
++                        do {
++                          if(*iter != ' ' && *iter != '\t') {
++                            left_gravity_insert = iter.ends_line();
++                            break;
++                          }
++                        } while(iter.forward_char());
+                       }
+-                    } while(iter.forward_char());
+-                  }
+ 
+-                  if(length > 0) {
+-                    auto offset_end = offset + length;
+-                    size_t bytes = 0;
+-                    for(size_t c = 0; c < bytes_in_lines.size(); ++c) {
+-                      auto previous_bytes = bytes;
+-                      bytes += bytes_in_lines[c];
+-                      if(offset_end < bytes || (c == bytes_in_lines.size() - 1 && offset_end == bytes)) {
+-                        auto end = get_buffer()->get_iter_at_line_index(c, offset_end - previous_bytes);
+-                        get_buffer()->erase(start, end);
+-                        start = get_buffer()->get_iter_at_line_index(line_index.first, line_index.second);
+-                        break;
++                      if(length > 0) {
++                        auto offset_end = offset + length;
++                        size_t bytes = 0;
++                        for(size_t c = 0; c < bytes_in_lines.size(); ++c) {
++                          auto previous_bytes = bytes;
++                          bytes += bytes_in_lines[c];
++                          if(offset_end < bytes || (c == bytes_in_lines.size() - 1 && offset_end == bytes)) {
++                            auto end = get_buffer()->get_iter_at_line_index(c, offset_end - previous_bytes);
++                            get_buffer()->erase(start, end);
++                            start = get_buffer()->get_iter_at_line_index(line_index.first, line_index.second);
++                            break;
++                          }
++                        }
+                       }
++                      if(left_gravity_insert) {
++                        Mark mark(start);
++                        get_buffer()->insert(start, replacement_str);
++                        get_buffer()->place_cursor(mark->get_iter());
++                      }
++                      else
++                        get_buffer()->insert(start, replacement_str);
++                      break;
+                     }
+                   }
+-                  if(left_gravity_insert) {
+-                    Mark mark(start);
+-                    get_buffer()->insert(start, replacement_str);
+-                    get_buffer()->place_cursor(mark->get_iter());
+-                  }
+-                  else
+-                    get_buffer()->insert(start, replacement_str);
+-                  break;
+                 }
+               }
++              break;
+             }
+           }
+         }
diff --git a/editors/jucipp/files/patch-src_usages__clang.cpp b/editors/jucipp/files/patch-src_usages__clang.cpp
new file mode 100644
index 000000000000..89b956a45b78
--- /dev/null
+++ b/editors/jucipp/files/patch-src_usages__clang.cpp
@@ -0,0 +1,32 @@
+--- src/usages_clang.cpp.orig	2023-08-03 07:43:31 UTC
++++ src/usages_clang.cpp
+@@ -562,7 +562,7 @@ Usages::Clang::PathSet Usages::Clang::find_paths(const
+     boost::system::error_code ec;
+     if(!boost::filesystem::is_regular_file(path, ec)) {
+       if(path == build_path || path == debug_path || path.filename() == ".git")
+-        it.no_push();
++        it.disable_recursion_pending();
+       continue;
+     }
+ 
+@@ -737,7 +737,7 @@ void Usages::Clang::write_cache(const boost::filesyste
+       stream.close();
+       boost::filesystem::rename(tmp_file, full_cache_path, ec);
+       if(ec) {
+-        boost::filesystem::copy_file(tmp_file, full_cache_path, boost::filesystem::copy_option::overwrite_if_exists);
++        boost::filesystem::copy_file(tmp_file, full_cache_path, boost::filesystem::copy_options::overwrite_existing);
+         boost::filesystem::remove(tmp_file, ec);
+       }
+     }
+@@ -759,9 +759,9 @@ Usages::Clang::Cache Usages::Clang::read_cache(const b
+   if(boost::filesystem::exists(cache_path, ec)) {
+     std::ifstream stream(cache_path.string());
+     if(stream) {
+-      Cache cache;
+-      boost::archive::text_iarchive text_iarchive(stream);
+       try {
++        Cache cache;
++        boost::archive::text_iarchive text_iarchive(stream);
+         text_iarchive >> cache;
+         return cache;
+       }
diff --git a/editors/jucipp/files/patch-src_window.cpp b/editors/jucipp/files/patch-src_window.cpp
new file mode 100644
index 000000000000..eed51beab9e4
--- /dev/null
+++ b/editors/jucipp/files/patch-src_window.cpp
@@ -0,0 +1,11 @@
+--- src/window.cpp.orig	2023-08-03 07:43:31 UTC
++++ src/window.cpp
+@@ -995,7 +995,7 @@ void Window::set_menu_actions() {
+         if(std::any_of(exclude_folders.begin(), exclude_folders.end(), [&filename](const std::string &exclude_folder) {
+              return filename == exclude_folder;
+            }))
+-          it.no_push();
++          it.disable_recursion_pending();
+         continue;
+       }
+       files.emplace_back(path);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202410161903.49GJ3Gkt047687>