commit:     0d6587457d4c4a9cce3ccfa2672361440b48d4a1
Author:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
AuthorDate: Sat Jun 15 18:06:23 2024 +0000
Commit:     Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Sat Jun 15 18:08:31 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0d658745

media-gfx/monica: EAPI 8 & minor fixes

Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org>
Closes: https://bugs.gentoo.org/740008

 media-gfx/monica/files/monica-3.7-exit.patch       | 61 ++++++++++++++++++++++
 media-gfx/monica/files/monica-3.7-fprintf.patch    | 46 ++++++++++++++++
 .../monica/files/monica-3.7-makefile-cleanup.patch | 33 ++++++++++++
 .../{monica-3.7.ebuild => monica-3.7-r1.ebuild}    |  9 ++--
 4 files changed, 145 insertions(+), 4 deletions(-)

diff --git a/media-gfx/monica/files/monica-3.7-exit.patch 
b/media-gfx/monica/files/monica-3.7-exit.patch
new file mode 100644
index 000000000000..afd347c28257
--- /dev/null
+++ b/media-gfx/monica/files/monica-3.7-exit.patch
@@ -0,0 +1,61 @@
+--- monica-3.7.orig/monica.cpp 2024-06-15 10:17:52.270992952 -0700
++++ monica-3.7/monica.cpp      2024-06-15 10:53:54.255394576 -0700
+@@ -1276,7 +1276,7 @@
+       int bcheck = system("echo $SHELL | grep bash");
+       if (bcheck) {
+               fl_alert("Monica senses that BASH is not\nyour login 
shell...\n\nSince Monica uses bash init scripts to \nimplement gamma 
corrections on system login, \nyou will have to paste the call to monicarc 
\ninto your startup scripts by hand.\n\nAlternatively, you can make a direct 
call \nto xgamma in your X config file.");
+-              __builtin_exit (0);
++              exit (0);
+       } 
+   
+     fn_r = get_shell_rc_path();
+@@ -1563,13 +1563,13 @@
+ }
+ //---------------------------------------------------------------------
+ void exit_cb(Fl_Widget *, void *) {
+-  __builtin_exit(0);
++  exit(0);
+ }
+ //---------------------------------------------------------------------
+ void exit_save_cb(Fl_Widget *, void *s) {
+   int res = write_monicarc((Sliders*)s); 
+   if (res) res = add_monicarc_to_startup();
+-  __builtin_exit(0);
++  exit(0);
+ }
+ //---------------------------------------------------------------------
+ 
+@@ -1704,7 +1704,7 @@
+ //    if (no_ati_gamma && no_x_gamma) {
+     if (no_x_gamma) {
+               fl_alert("Monica cannot detect the presence\n of xgamma on your 
machine...\n\nIt is distributed with all versions of XFree86 \nand Xorg to 
date, so if you have X installed, \nit should be around or something might be 
\nwrong with your installation.\n\nXgamma is needed for Monica to function.");
+-              __builtin_exit (0);
++              exit (0);
+       }
+ //-- set global value of "xgamma" command string, accomodating ATI's 
fglrx_xgamma ---
+ //    if ( ! no_ati_gamma ) {
+@@ -1739,13 +1739,13 @@
+       printf("Copyright (C) 2005 Paul Sherman\n\n");
+       printf("Copyright (C) 2002 Tilo Riemer\n\n");
+       printf("Monica is published under a BSD like licence.\nSee Monica 
-l\n\n");
+-      __builtin_exit(0);
++      exit(0);
+       }
+       if ( (strcmp(argv[i], "-l") == 0) 
+           || (strcmp(argv[i], "--licence") == 0) 
+           || (strcmp(argv[i], "--license") == 0) ) {
+         printf("\n%s\n\n", LICENCE);
+-      __builtin_exit(0);
++      exit(0);
+       }
+       if ( (strcmp(argv[i], "-h") == 0) || (strcmp(argv[i], "--help") == 0) ) 
{
+       printf("\nUsage: Monica [options]\nwhere options are:\n");
+@@ -1766,7 +1766,7 @@
+       printf("\t-s[cheme]         scheme\n");
+       printf("\t-t[itle]          windowtitle\n\n");
+ 
+-      __builtin_exit(0);
++      exit(0);
+       } 
+       if ( (strcmp(argv[i], "-o") == 0) || (strcmp(argv[i], "--onthefly") == 
0) ) {
+       g_toggle_apply_on_the_fly_checkbox = 1;

diff --git a/media-gfx/monica/files/monica-3.7-fprintf.patch 
b/media-gfx/monica/files/monica-3.7-fprintf.patch
new file mode 100644
index 000000000000..55959e246f43
--- /dev/null
+++ b/media-gfx/monica/files/monica-3.7-fprintf.patch
@@ -0,0 +1,46 @@
+--- monica-3.7.orig/monica.cpp 2024-06-15 10:16:59.594465873 -0700
++++ monica-3.7/monica.cpp      2024-06-15 10:17:18.277749251 -0700
+@@ -1301,9 +1301,9 @@
+           while (fgets (buffer, BUF_SIZE, f_r)) {
+               if (strstr(buffer, ". .monicarc")) {//skip old entries
+                  continue;  
+-              } else fprintf(f_w, buffer);
++              } else fprintf(f_w, "%s", buffer);
+           }
+-                fprintf(f_w, ". .monicarc   #monitor calibration");
++                fprintf(f_w, "%s", ". .monicarc   #monitor calibration");
+           fclose(f_w);
+           // script edited, so back up the original and put the ".tmp" in its 
place
+           rename(fn_r.c_str(), fn_old.c_str());
+@@ -1348,18 +1348,18 @@
+          while (fgets (buffer, BUF_SIZE, f_r)) {
+            if (buffer[0] != '#') {
+                if (!wrote_monicarc) {//add line for calling .monicarc
+-                 fprintf(f_w, "$HOME/.monicarc   #monitor calibration\n");
++                 fprintf(f_w, "%s", "$HOME/.monicarc   #monitor 
calibration\n");
+                  wrote_monicarc = 1;
+                }
+                if (strstr(buffer, "xgamma")) {
+                  strcpy(mod_buffer, "#");
+                  strncat(mod_buffer, buffer, BUF_SIZE);
+                  mod_buffer[BUF_SIZE + 1] = '\0';
+-                 fprintf(f_w, mod_buffer);
++                 fprintf(f_w, "%s", mod_buffer);
+                } else if (strstr(buffer, "$HOME/.monicarc")) {//skip old 
entries of .monicarc
+                   continue;  
+-               } else fprintf(f_w, buffer);
+-           } else fprintf(f_w, buffer);
++               } else fprintf(f_w, "%s", buffer);
++           } else fprintf(f_w, "%s", buffer);
+          }
+ 
+          fclose(f_w);
+@@ -1395,7 +1395,7 @@
+                               if (strstr(buffer, str_to_remove.c_str())) {
+                                       continue;  
+                         } else {
+-                          fprintf(f_w, buffer);
++                          fprintf(f_w, "%s", buffer);
+                                       line_count += 1;
+                         }
+                       }

diff --git a/media-gfx/monica/files/monica-3.7-makefile-cleanup.patch 
b/media-gfx/monica/files/monica-3.7-makefile-cleanup.patch
new file mode 100644
index 000000000000..4d7501254ada
--- /dev/null
+++ b/media-gfx/monica/files/monica-3.7-makefile-cleanup.patch
@@ -0,0 +1,33 @@
+diff -Nuar monica-3.6.orig/Makefile monica-3.6/Makefile
+--- monica-3.6.orig/Makefile   2005-03-14 22:00:18.000000000 -0800
++++ monica-3.6/Makefile        2007-11-15 00:48:39.000000000 -0800
+@@ -2,22 +2,24 @@
+ CXX      = g++
+ LINK     = g++
+ CFLAGS   = -Wall -O2
+-CXXFLAGS = `fltk-config --cxxflags` -Wall -O2
+-LDFLAGS  = `fltk-config --ldflags`
++CXXFLAGS = -Wall -O2
++FLTK_CXXFLAGS = $(shell fltk-config --cxxflags)
++LDFLAGS  = 
++FLTK_LDFLAGS  = $(shell fltk-config --ldflags)
+ TARGET   = monica
+-DESTINATION = /usr/bin
++DESTINATION = $(DESTDIR)/usr/bin
+ OBJECTS = monica.o
+ 
+ all: $(TARGET)
+ 
+ $(TARGET): $(OBJECTS)
+-      $(LINK) -o $(TARGET) $(OBJECTS) $(LDFLAGS)
++      $(LINK) -o $(TARGET) $(OBJECTS) $(FLTK_LDFLAGS) $(LDFLAGS)
+ 
+ 
+ monica.o: monica.cpp
+-      $(CXX) -c $(CXXFLAGS) $(INCPATH) -o monica.o monica.cpp
++      $(CXX) -c $(FLTK_CXXFLAGS) $(CXXFLAGS) $(INCPATH) -o monica.o monica.cpp
+ 
+ clean: 
+       rm -f $(OBJECTS)
+       rm -f monica
+       

diff --git a/media-gfx/monica/monica-3.7.ebuild 
b/media-gfx/monica/monica-3.7-r1.ebuild
similarity index 65%
rename from media-gfx/monica/monica-3.7.ebuild
rename to media-gfx/monica/monica-3.7-r1.ebuild
index 08697029c232..b6be41461371 100644
--- a/media-gfx/monica/monica-3.7.ebuild
+++ b/media-gfx/monica/monica-3.7-r1.ebuild
@@ -1,18 +1,17 @@
 # Copyright 1999-2020 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI=6
+EAPI=8
 
 inherit toolchain-funcs
 
 DESCRIPTION="Monica is a Monitor Calibration Tool"
-HOMEPAGE="http://freshmeat.sourceforge.net/projects/monica";
+HOMEPAGE="https://web.archive.org/web/20201111203551/http://freshmeat.sourceforge.net/projects/monica
 
https://web.archive.org/web/20051016203856/http://www.pcbypaul.com:80/linux/monica.html";
 SRC_URI="mirror://gentoo/${P}.tar.bz2"
 
 LICENSE="BSD"
 SLOT="0"
 KEYWORDS="amd64 ppc x86"
-IUSE=""
 
 DEPEND=">=x11-libs/fltk-1.1:1"
 RDEPEND="${DEPEND}
@@ -20,8 +19,10 @@ RDEPEND="${DEPEND}
 
 DOCS=( authors ChangeLog news readme )
 PATCHES=(
-       "${FILESDIR}"/${PN}-3.6-makefile-cleanup.patch
+       "${FILESDIR}"/${PN}-3.7-makefile-cleanup.patch
        "${FILESDIR}"/${P}-gcc44.patch
+       "${FILESDIR}"/${P}-fprintf.patch
+       "${FILESDIR}"/${P}-exit.patch
 )
 
 src_compile() {

Reply via email to