git: fd30adef308a - main - graphics/rawtherapee: replace workaround by cherry-pick

From: Matthias Andree <mandree_at_FreeBSD.org>
Date: Wed, 29 May 2024 00:32:33 UTC
The branch main has been updated by mandree:

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

commit fd30adef308a544af99ad204353915adffe609c6
Author:     Matthias Andree <mandree@FreeBSD.org>
AuthorDate: 2024-05-28 21:40:33 +0000
Commit:     Matthias Andree <mandree@FreeBSD.org>
CommitDate: 2024-05-29 00:32:21 +0000

    graphics/rawtherapee: replace workaround by cherry-pick
    
    ...of upstream's merged change here:
    https://github.com/Beep6581/RawTherapee/pull/7080
    
    PR:             279371
---
 graphics/rawtherapee/Makefile                      |  2 +-
 .../rawtherapee/files/patch-rtengine_jdatasrc.cc   | 56 +++++++++++++++++-----
 2 files changed, 46 insertions(+), 12 deletions(-)

diff --git a/graphics/rawtherapee/Makefile b/graphics/rawtherapee/Makefile
index 1753aab3ee68..883bc94aeca9 100644
--- a/graphics/rawtherapee/Makefile
+++ b/graphics/rawtherapee/Makefile
@@ -1,6 +1,6 @@
 PORTNAME=	rawtherapee
 PORTVERSION=	5.10
-PORTREVISION=	2
+PORTREVISION=	3
 CATEGORIES=	graphics
 MASTER_SITES=	https://rawtherapee.com/shared/source/ \
 		LOCAL/mandree/
diff --git a/graphics/rawtherapee/files/patch-rtengine_jdatasrc.cc b/graphics/rawtherapee/files/patch-rtengine_jdatasrc.cc
index 950b3b205be2..9bd4ac27ef90 100644
--- a/graphics/rawtherapee/files/patch-rtengine_jdatasrc.cc
+++ b/graphics/rawtherapee/files/patch-rtengine_jdatasrc.cc
@@ -1,20 +1,54 @@
+This is a combinediff of 
+https://github.com/Beep6581/RawTherapee/pull/7080/commits/efdc5bce3b9794847093baeb040937ab55eba86e
+https://github.com/Beep6581/RawTherapee/pull/7080/commits/7789a8574b454ebd874522a70930ae4b40726da4
+
 --- rtengine/jdatasrc.cc.orig	2024-02-16 05:12:09 UTC
 +++ rtengine/jdatasrc.cc
-@@ -409,6 +409,8 @@ my_jpeg_std_error (struct jpeg_error_mgr * err)
+@@ -247,20 +247,6 @@ my_error_exit (j_common_ptr cinfo)
+ #endif
+ }
+ 
+-
+-#ifdef _WIN32
+-#define JVERSION	"6b  27-Mar-1998"
+-#define JCOPYRIGHT_SHORT	"(C) 1998, Thomas G. Lane"
+-#define JMESSAGE(code,string)	string ,
+-
+-const char * const jpeg_std_message_table[] = {
+-#include "jerror.h"
+-  NULL
+-};
+-#else
+-extern const char * const jpeg_std_message_table[];
+-#endif
+-
+ /*
+  * Actual output of an error or trace message.
+  * Applications may override this method to send JPEG messages somewhere
+@@ -409,24 +395,10 @@ my_jpeg_std_error (struct jpeg_error_mgr * err)
  GLOBAL(struct jpeg_error_mgr *)
  my_jpeg_std_error (struct jpeg_error_mgr * err)
  {
-+    struct jpeg_error_mgr std_jpeg_err;
-+    (void)jpeg_std_error(&std_jpeg_err);
++    err = jpeg_std_error(err);
  
++    /* override these functions */
      err->error_exit = my_error_exit;
-     err->emit_message = emit_message;
-@@ -421,7 +423,7 @@ my_jpeg_std_error (struct jpeg_error_mgr * err)
-     err->msg_code = 0;        /* may be useful as a flag for "no error" */
- 
-     /* Initialize message table pointers */
+-    err->emit_message = emit_message;
+-    err->output_message = output_message;
+-    err->format_message = format_message;
+-    err->reset_error_mgr = reset_error_mgr;
+-
+-    err->trace_level = 0;     /* default = no tracing */
+-    err->num_warnings = 0;    /* no warnings emitted yet */
+-    err->msg_code = 0;        /* may be useful as a flag for "no error" */
+-
+-    /* Initialize message table pointers */
 -    err->jpeg_message_table = jpeg_std_message_table;
-+    err->jpeg_message_table = std_jpeg_err.jpeg_message_table;
-     err->last_jpeg_message = (int) JMSG_LASTMSGCODE - 1;
+-    err->last_jpeg_message = (int) JMSG_LASTMSGCODE - 1;
+-
+-    err->addon_message_table = nullptr;
+-    err->first_addon_message = 0; /* for safety */
+-    err->last_addon_message = 0;
  
-     err->addon_message_table = nullptr;
+     return err;
+ }