public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: x11-plugins/wmcalendar/files/, x11-plugins/wmcalendar/
@ 2018-07-19 13:28 Bernard Cafarelli
  0 siblings, 0 replies; 2+ messages in thread
From: Bernard Cafarelli @ 2018-07-19 13:28 UTC (permalink / raw
  To: gentoo-commits

commit:     1f4dada784da01b4a9cff7cff3ef44045f245c7d
Author:     Michael Mair-Keimberger <m.mairkeimberger <AT> gmail <DOT> com>
AuthorDate: Sun Jul  8 14:11:49 2018 +0000
Commit:     Bernard Cafarelli <voyageur <AT> gentoo <DOT> org>
CommitDate: Thu Jul 19 13:25:23 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1f4dada7

x11-plugins/wmcalendar: EAPI7, improve ebuild

 .../files/wmcalendar-0.5.2-exit-sin-and-cos.patch  | 12 ++++----
 .../wmcalendar/files/wmcalendar-0.5.2-ical.patch   |  8 ++---
 .../files/wmcalendar-0.5.2-rename_kill_func.patch  |  4 +--
 x11-plugins/wmcalendar/wmcalendar-0.5.2-r2.ebuild  | 34 ++++++++++++++++++++++
 4 files changed, 46 insertions(+), 12 deletions(-)

diff --git a/x11-plugins/wmcalendar/files/wmcalendar-0.5.2-exit-sin-and-cos.patch b/x11-plugins/wmcalendar/files/wmcalendar-0.5.2-exit-sin-and-cos.patch
index 1f51b17889e..1d68111fc26 100644
--- a/x11-plugins/wmcalendar/files/wmcalendar-0.5.2-exit-sin-and-cos.patch
+++ b/x11-plugins/wmcalendar/files/wmcalendar-0.5.2-exit-sin-and-cos.patch
@@ -1,5 +1,5 @@
---- a/Src/calendarfunc.c	2003-07-13 17:41:02.000000000 +0300
-+++ b/Src/calendarfunc.c	2008-05-03 10:03:06.000000000 +0300
+--- a/calendarfunc.c	2003-07-13 17:41:02.000000000 +0300
++++ b/calendarfunc.c	2008-05-03 10:03:06.000000000 +0300
 @@ -22,7 +22,7 @@
  
  #include "calendarfunc.h"
@@ -9,8 +9,8 @@
  
  
  long persian_jdn(struct icaltimetype dt)
---- a/Src/dockapp.c	2003-07-15 18:15:12.000000000 +0300
-+++ b/Src/dockapp.c	2008-05-03 10:03:34.000000000 +0300
+--- a/dockapp.c	2003-07-15 18:15:12.000000000 +0300
++++ b/dockapp.c	2008-05-03 10:03:34.000000000 +0300
 @@ -23,6 +23,7 @@
   * modified by Seiichi SATO <ssato@sh.rim.or.jp>
   */
@@ -19,8 +19,8 @@
  #include "dockapp.h"
  
  #define WINDOWED_SIZE_W 64
---- a/Src/Makefile	2003-07-15 18:19:26.000000000 +0300
-+++ b/Src/Makefile	2008-05-03 10:11:48.000000000 +0300
+--- a/Makefile	2003-07-15 18:19:26.000000000 +0300
++++ b/Makefile	2008-05-03 10:11:48.000000000 +0300
 @@ -1,19 +1,15 @@
 -CC     = gcc
 +CC     ?= gcc

diff --git a/x11-plugins/wmcalendar/files/wmcalendar-0.5.2-ical.patch b/x11-plugins/wmcalendar/files/wmcalendar-0.5.2-ical.patch
index 76a92a65b1d..9297717a355 100644
--- a/x11-plugins/wmcalendar/files/wmcalendar-0.5.2-ical.patch
+++ b/x11-plugins/wmcalendar/files/wmcalendar-0.5.2-ical.patch
@@ -1,13 +1,13 @@
---- a/Src/calendar.h
-+++ b/Src/calendar.h
+--- a/calendar.h
++++ b/calendar.h
 @@ -1,4 +1,4 @@
 -#include <ical.h>
 +#include <libical/ical.h>
  #include <stdlib.h>
  #include <gtk/gtk.h>
  #include <string.h>
---- a/Src/calendarfunc.h
-+++ b/Src/calendarfunc.h
+--- a/calendarfunc.h
++++ b/calendarfunc.h
 @@ -22,7 +22,7 @@
  
  #include <unistd.h>

diff --git a/x11-plugins/wmcalendar/files/wmcalendar-0.5.2-rename_kill_func.patch b/x11-plugins/wmcalendar/files/wmcalendar-0.5.2-rename_kill_func.patch
index fc648a6b60d..e11a8b1b98c 100644
--- a/x11-plugins/wmcalendar/files/wmcalendar-0.5.2-rename_kill_func.patch
+++ b/x11-plugins/wmcalendar/files/wmcalendar-0.5.2-rename_kill_func.patch
@@ -1,5 +1,5 @@
---- a/Src/calendar.c
-+++ b/Src/calendar.c
+--- a/calendar.c
++++ b/calendar.c
 @@ -48,7 +48,7 @@
  
  

diff --git a/x11-plugins/wmcalendar/wmcalendar-0.5.2-r2.ebuild b/x11-plugins/wmcalendar/wmcalendar-0.5.2-r2.ebuild
new file mode 100644
index 00000000000..bda76dc009c
--- /dev/null
+++ b/x11-plugins/wmcalendar/wmcalendar-0.5.2-r2.ebuild
@@ -0,0 +1,34 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+inherit toolchain-funcs
+
+DESCRIPTION="a calendar dockapp"
+HOMEPAGE="http://wmcalendar.sourceforge.net"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~sparc ~x86"
+
+RDEPEND="
+	dev-libs/libical
+	x11-libs/gtk+:2
+	x11-libs/libX11
+	x11-libs/libXext
+	x11-libs/libXpm
+"
+BDEPEND="virtual/pkgconfig"
+
+DOCS=( ../{BUGS,CHANGES,HINTS,README,TODO} )
+
+S=${WORKDIR}/${P}/Src
+
+PATCHES=( "${FILESDIR}"/${P}-exit-sin-and-cos.patch
+	"${FILESDIR}"/${P}-rename_kill_func.patch
+	"${FILESDIR}"/${P}-ical.patch )
+
+src_compile() {
+	tc-export CC PKG_CONFIG
+}


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: x11-plugins/wmcalendar/files/, x11-plugins/wmcalendar/
@ 2024-04-28  6:55 Sam James
  0 siblings, 0 replies; 2+ messages in thread
From: Sam James @ 2024-04-28  6:55 UTC (permalink / raw
  To: gentoo-commits

commit:     054d5d2c0cfd27716cf924e7f5b335a43dcf1217
Author:     Eli Schwartz <eschwartz93 <AT> gmail <DOT> com>
AuthorDate: Sun Apr 28 05:42:46 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Apr 28 06:54:26 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=054d5d2c

x11-plugins/wmcalendar: add patches to fix horrible missing function decls

We kill two birds with one stone. It fails the c99 porting tracker and
will not compile with Modern C compilers such as gcc 14 or clang 16, and
it ALSO fixes LTO errors since -Werror=lto-type-mismatch complained when
the implicit function declaration's assumed type was incorrect and
didn't match the type of the actual live instance of the function.

While we are at it, fix some additional (memory access) errors
discovered by LTO in the form of -Waggressive-loop-optimizations.

Closes: https://bugs.gentoo.org/875530
Closes: https://bugs.gentoo.org/881461
Signed-off-by: Eli Schwartz <eschwartz93 <AT> gmail.com>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 ...-typo-causing-out-of-bounds-memory-access.patch | 27 ++++++++++
 x11-plugins/wmcalendar/files/wmcalendar-c99.patch  | 63 ++++++++++++++++++++++
 x11-plugins/wmcalendar/wmcalendar-0.5.2-r3.ebuild  | 39 ++++++++++++++
 3 files changed, 129 insertions(+)

diff --git a/x11-plugins/wmcalendar/files/0001-fix-obvious-typo-causing-out-of-bounds-memory-access.patch b/x11-plugins/wmcalendar/files/0001-fix-obvious-typo-causing-out-of-bounds-memory-access.patch
new file mode 100644
index 000000000000..8565fe879b29
--- /dev/null
+++ b/x11-plugins/wmcalendar/files/0001-fix-obvious-typo-causing-out-of-bounds-memory-access.patch
@@ -0,0 +1,27 @@
+From ce49fa7696aadb61bb770bc42181d258af4407de Mon Sep 17 00:00:00 2001
+From: Eli Schwartz <eschwartz93@gmail.com>
+Date: Sun, 28 Apr 2024 01:36:55 -0400
+Subject: [PATCH] fix obvious typo causing out of bounds memory access
+
+The size in the .h file doesn't match the loop access in the .c file.
+Detected via LTO and -Waggressive-loop-optimizations
+---
+ wmCalendar.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/wmCalendar.c b/wmCalendar.c
+index bf5640b..bfe68a1 100644
+--- a/wmCalendar.c
++++ b/wmCalendar.c
+@@ -71,7 +71,7 @@ void initValues(){
+     for(i = 0; i < 12; ++i) 
+ 	for( j = 0; j < 6; ++j)
+ 	    xdMonth[j][i] = xeMonth[j][i] - xsMonth[j][i] + 1;
+-    for(i = 0; i < 12; ++i) 
++    for(i = 0; i < 10; ++i)
+ 	for( j = 0; j < 2; ++j)
+ 	    xdYear[j][i] = xeYear[j][i] - xsYear[j][i] + 1;
+     for(i = 0; i < MAXBUTTON; ++i) 
+-- 
+2.43.2
+

diff --git a/x11-plugins/wmcalendar/files/wmcalendar-c99.patch b/x11-plugins/wmcalendar/files/wmcalendar-c99.patch
new file mode 100644
index 000000000000..fb37477108cd
--- /dev/null
+++ b/x11-plugins/wmcalendar/files/wmcalendar-c99.patch
@@ -0,0 +1,63 @@
+From eb19c3c29d65b4e0e4f30d49c568846296ea4287 Mon Sep 17 00:00:00 2001
+From: Eli Schwartz <eschwartz93@gmail.com>
+Date: Fri, 29 Mar 2024 10:21:50 -0400
+Subject: [PATCH 1/2] fix missing includes/prototypes that violate c99
+
+Fixes various -Werror=implicit-function-declaration issues.
+---
+ calendar.c | 2 ++
+ calendar.h | 1 +
+ 2 files changed, 3 insertions(+)
+
+diff --git a/calendar.c b/calendar.c
+index 4da3650..c847853 100644
+--- a/calendar.c
++++ b/calendar.c
+@@ -1,4 +1,6 @@
+ #include "calendar.h"
++#include "settings.h"
++#include "calendarfunc.h"
+ 
+ time_t  modtime;
+ struct  calobj* calRoot;
+diff --git a/calendar.h b/calendar.h
+index bc9e576..7803d0c 100644
+--- a/calendar.h
++++ b/calendar.h
+@@ -33,4 +33,5 @@ int  getDayType(struct icaltimetype dt);
+ int  calcDayType(struct icaltimetype dt);
+ char* read_stream(char *s, size_t size, void *d);
+ void checkicalversion();
++int eventOnDay(struct icaltimetype dt, struct calobj* it);
+ 
+-- 
+2.43.2
+
+
+From a6f7c549f79a8fa50456f06352a3fd1457937c62 Mon Sep 17 00:00:00 2001
+From: Eli Schwartz <eschwartz93@gmail.com>
+Date: Sun, 28 Apr 2024 01:34:58 -0400
+Subject: [PATCH 2/2] cast a struct pointing to itself to avoid
+ -Werror=incompatible-pointer-types
+
+This is already done the other way around at the beginning of the block.
+---
+ calendar.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/calendar.c b/calendar.c
+index c847853..f8f875b 100644
+--- a/calendar.c
++++ b/calendar.c
+@@ -326,7 +326,7 @@ void deleteCalObjs(){
+ 	free(calRoot->text);
+ 	free(calRoot->comp);
+ 	free(calRoot);
+-	calRoot = help;
++	calRoot = (struct calobj*) help;
+     }
+     for(i = 0; i < 32; i++)
+ 	datetype[i][1] = 0;
+-- 
+2.43.2
+

diff --git a/x11-plugins/wmcalendar/wmcalendar-0.5.2-r3.ebuild b/x11-plugins/wmcalendar/wmcalendar-0.5.2-r3.ebuild
new file mode 100644
index 000000000000..ff36a3411c04
--- /dev/null
+++ b/x11-plugins/wmcalendar/wmcalendar-0.5.2-r3.ebuild
@@ -0,0 +1,39 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+inherit toolchain-funcs
+
+DESCRIPTION="a calendar dockapp"
+HOMEPAGE="https://wmcalendar.sourceforge.net"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~sparc ~x86"
+
+RDEPEND="
+	dev-libs/libical
+	x11-libs/gtk+:2
+	x11-libs/libX11
+	x11-libs/libXext
+	x11-libs/libXpm"
+DEPEND="${RDEPEND}"
+BDEPEND="virtual/pkgconfig"
+
+DOCS=( ../{BUGS,CHANGES,HINTS,README,TODO} )
+
+S=${WORKDIR}/${P}/Src
+
+PATCHES=( "${FILESDIR}"/${P}-exit-sin-and-cos.patch
+	"${FILESDIR}"/${P}-rename_kill_func.patch
+	"${FILESDIR}"/${P}-ical.patch
+	"${FILESDIR}"/${P}-fno-common.patch
+	"${FILESDIR}"/wmcalendar-c99.patch
+	"${FILESDIR}"/0001-fix-obvious-typo-causing-out-of-bounds-memory-access.patch
+)
+
+src_compile() {
+	tc-export CC PKG_CONFIG
+	default
+}


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-04-28  6:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-07-19 13:28 [gentoo-commits] repo/gentoo:master commit in: x11-plugins/wmcalendar/files/, x11-plugins/wmcalendar/ Bernard Cafarelli
  -- strict thread matches above, loose matches on Subject: below --
2024-04-28  6:55 Sam James

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox