public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: dev-perl/Tk/files/, dev-perl/Tk/
@ 2023-02-11  4:26 Sam James
  0 siblings, 0 replies; 3+ messages in thread
From: Sam James @ 2023-02-11  4:26 UTC (permalink / raw
  To: gentoo-commits

commit:     164c0cdd484ca9fcdfcc8b6a2cba98ffd77e689b
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sat Feb 11 04:24:06 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Feb 11 04:24:06 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=164c0cdd

dev-perl/Tk: fix configure w/ clang 16, backport other crash fixes

But still doesn't build w/ clang 16.

Bug: https://bugs.gentoo.org/883391
Signed-off-by: Sam James <sam <AT> gentoo.org>

 dev-perl/Tk/Tk-804.36.0-r1.ebuild                  |  69 +++++++++
 .../Tk/files/Tk-804.036-configure-clang16.patch    |  40 +++++
 dev-perl/Tk/files/Tk-804.036-crash.patch           | 167 +++++++++++++++++++++
 3 files changed, 276 insertions(+)

diff --git a/dev-perl/Tk/Tk-804.36.0-r1.ebuild b/dev-perl/Tk/Tk-804.36.0-r1.ebuild
new file mode 100644
index 000000000000..e7ee25baa373
--- /dev/null
+++ b/dev-perl/Tk/Tk-804.36.0-r1.ebuild
@@ -0,0 +1,69 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+DIST_AUTHOR=SREZIC
+DIST_VERSION=804.036
+DIST_EXAMPLES=("examples/*")
+inherit perl-module virtualx
+
+DESCRIPTION="A Perl Module for Tk"
+
+LICENSE+=" tcltk BSD"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~sparc-solaris ~x86-solaris"
+IUSE=""
+
+DEPEND="
+	media-libs/freetype
+	media-libs/libjpeg-turbo:=
+	>=media-libs/libpng-1.4:0
+	x11-libs/libX11
+	x11-libs/libXft
+"
+RDEPEND="${DEPEND}"
+
+PATCHES=(
+	"${FILESDIR}"/${PN}-804.034-xorg.patch
+	"${FILESDIR}"/${PN}-804.036-configure-clang16.patch
+	"${FILESDIR}"/${PN}-804.036-crash.patch
+)
+
+PERL_RM_FILES=( "t/pod.t" )
+
+src_prepare() {
+	myconf=( X11ROOT="${EPREFIX}"/usr XFT=1 -I"${EPREFIX}"/usr/include/ -l"${EPREFIX}"/usr/$(get_libdir) )
+	mydoc="ToDo VERSIONS"
+
+	perl-module_src_prepare
+	# fix detection logic for Prefix, bug #385621
+	sed -i -e "s:/usr:${EPREFIX}/usr:g" myConfig || die
+	# having this around breaks with perl-module and a case-IN-sensitive fs
+	rm build_ptk || die
+
+	# Remove all bundled libs, fixes #488194
+	local BUNDLED="PNG/libpng \
+					PNG/zlib \
+					JPEG/jpeg"
+
+	# Move files required for tests temporarily
+
+	mkdir -p "${T}/stash" || die "can't create temporary stash"
+	mv "${S}/JPEG/jpeg/testimg.jpg" "${T}/stash/testimg.jpg" || die "can't move testimg.jpg"
+
+	for dir in ${BUNDLED}; do
+		einfo "Removing bundled: ${dir}"
+		rm -r "${S}/${dir}" || die "Can't remove bundle"
+		# Makefile.PL can copy files to ${S}/${dir}, so recreate them back.
+		mkdir -p "${S}/${dir}" || die "Can't restore bundled dir"
+		sed -i "\#^${dir}#d" "${S}"/MANIFEST || die 'Can not remove bundled libs from MANIFEST'
+	done
+
+	# Restore test files
+	mv "${T}/stash/testimg.jpg" "${S}/JPEG/jpeg/testimg.jpg" || die "can't restore testimg.jpg"
+}
+
+src_test() {
+	virtx perl-module_src_test
+}

diff --git a/dev-perl/Tk/files/Tk-804.036-configure-clang16.patch b/dev-perl/Tk/files/Tk-804.036-configure-clang16.patch
new file mode 100644
index 000000000000..6d16a0505947
--- /dev/null
+++ b/dev-perl/Tk/files/Tk-804.036-configure-clang16.patch
@@ -0,0 +1,40 @@
+https://github.com/eserte/perl-tk/pull/79
+https://github.com/eserte/perl-tk/pull/80
+
+From f7565b07f40e0cc3820e8fb0c3d2e7b5abb5eeeb Mon Sep 17 00:00:00 2001
+From: Christopher Chavez <chrischavez@gmx.us>
+Date: Fri, 12 Mar 2021 07:24:18 -0600
+Subject: [PATCH] Fix some implicit function declarations
+
+Hstrdup.c: missing stdlib.h for exit()
+Hstrtoul.c: missing string.h for strcmp()
+--- a/pTk/config/Hstrdup.c
++++ b/pTk/config/Hstrdup.c
+@@ -1,3 +1,4 @@
++#include <stdlib.h>
+ #include <string.h>
+ 
+ #define STRING "Whatever"
+--- a/pTk/config/Hstrtoul.c
++++ b/pTk/config/Hstrtoul.c
+@@ -1,4 +1,5 @@
+ #include <stdlib.h>
++#include <string.h>
+ 
+ int main()
+ {char *e;
+
+From 47219864d6ef3fe0c5616cada78e3008447a96a1 Mon Sep 17 00:00:00 2001
+From: Christopher Chavez <chrischavez@gmx.us>
+Date: Fri, 12 Mar 2021 07:28:22 -0600
+Subject: [PATCH] signedchar.c: use int main to avoid C99 warning
+
+--- a/config/signedchar.c
++++ b/config/signedchar.c
+@@ -1,4 +1,4 @@
+-main()
++int main()
+ {
+  signed char x = 'a';
+  return (x - 'a');
+

diff --git a/dev-perl/Tk/files/Tk-804.036-crash.patch b/dev-perl/Tk/files/Tk-804.036-crash.patch
new file mode 100644
index 000000000000..f83b8103fdb8
--- /dev/null
+++ b/dev-perl/Tk/files/Tk-804.036-crash.patch
@@ -0,0 +1,167 @@
+https://github.com/eserte/perl-tk/pull/48
+https://github.com/eserte/perl-tk/pull/89
+
+From e7c5041b4fff6210bc0348c72b538efae32aede3 Mon Sep 17 00:00:00 2001
+From: Karl Williamson <khw@cpan.org>
+Date: Thu, 28 Mar 2019 22:59:17 -0500
+Subject: [PATCH 1/3] Fix segfaults due to parameter size mismatch
+
+See: https://rt.cpan.org/Ticket/Display.html?id=128955
+As also done upstream: https://core.tcl-lang.org/tk/info/0d9c0d50f9
+--- a/pTk/mTk/generic/tkCanvText.c
++++ b/pTk/mTk/generic/tkCanvText.c
+@@ -1234,8 +1234,7 @@ GetTextIndex(interp, canvas, itemPtr, obj, indexPtr)
+ 				 * index. */
+ {
+     TextItem *textPtr = (TextItem *) itemPtr;
+-    size_t length;
+-    int c;
++    int c, length;
+     TkCanvas *canvasPtr = (TkCanvas *) canvas;
+     Tk_CanvasTextInfo *textInfoPtr = textPtr->textInfoPtr;
+     char *string;
+--- a/pTk/mTk/generic/tkFrame.c
++++ b/pTk/mTk/generic/tkFrame.c
+@@ -493,8 +493,7 @@ CreateFrame(clientData, interp, objc, objv, type, appName)
+     CONST char *className, *screenName, *colormapName, *arg;
+     Tcl_Obj *visualName;
+     Tcl_Obj *useOption;
+-    int i, c, depth;
+-    size_t length;
++    int i, c, depth, length;
+     unsigned int mask;
+     Colormap colormap;
+     Visual *visual;
+@@ -749,8 +748,7 @@ FrameWidgetObjCmd(clientData, interp, objc, objv)
+     };
+     register Frame *framePtr = (Frame *) clientData;
+     int result = TCL_OK, index;
+-    size_t length;
+-    int c, i;
++    int c, i, length;
+     Tcl_Obj *objPtr;
+ 
+     if (objc < 2) {
+
+From 2bba8c45fcbcd9f3d45b7bc5f290e324d7c01a13 Mon Sep 17 00:00:00 2001
+From: Christopher Chavez <chrischavez@gmx.us>
+Date: Fri, 12 Feb 2021 11:28:48 -0600
+Subject: [PATCH 2/3] tkFrame.c: remove redundant casts
+
+--- a/pTk/mTk/generic/tkFrame.c
++++ b/pTk/mTk/generic/tkFrame.c
+@@ -522,7 +522,7 @@ CreateFrame(clientData, interp, objc, objv, type, appName)
+     visualName = NULL;
+     colormap = None;
+     for (i = 2; i < objc; i += 2) {
+-	arg = Tcl_GetStringFromObj(objv[i], (int *) &length);
++	arg = Tcl_GetStringFromObj(objv[i], &length);
+ 	if (length < 2) {
+ 	    continue;
+ 	}
+@@ -796,7 +796,7 @@ FrameWidgetObjCmd(clientData, interp, objc, objv)
+ 	     */
+ 
+ 	    for (i = 2; i < objc; i++) {
+-		char *arg = Tcl_GetStringFromObj(objv[i], (int *) &length);
++		char *arg = Tcl_GetStringFromObj(objv[i], &length);
+ 		if (length < 2) {
+ 		    continue;
+ 		}
+
+From 3dd0956e92df84ec0e788368ff0214e527d28dd8 Mon Sep 17 00:00:00 2001
+From: Christopher Chavez <chrischavez@gmx.us>
+Date: Fri, 12 Feb 2021 11:29:16 -0600
+Subject: [PATCH 3/3] tkImgPhoto.c: fix instances of RT #128955
+
+Remove unnecessary casts to (int *)
+As done upstream: https://core.tcl-lang.org/tk/info/0d9c0d50f9
+--- a/pTk/mTk/generic/tkImgPhoto.c
++++ b/pTk/mTk/generic/tkImgPhoto.c
+@@ -676,10 +676,9 @@ ImgPhotoCmd(clientData, interp, objc, objv)
+     XColor color;
+     Tk_PhotoImageFormat *imageFormat;
+     int imageWidth, imageHeight;
+-    int matched;
++    int length, matched;
+     Tcl_Channel chan;
+     Tk_PhotoHandle srcHandle;
+-    size_t length;
+     Tcl_Obj *obj;
+     int c;
+     ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+@@ -723,7 +722,7 @@ ImgPhotoCmd(clientData, interp, objc, objv)
+ 	    Tcl_WrongNumArgs(interp, 2, objv, "option");
+ 	    return TCL_ERROR;
+ 	}
+-	arg = Tcl_GetStringFromObj(objv[2], (int *) &length);
++	arg = Tcl_GetStringFromObj(objv[2], &length);
+ 	if (strncmp(arg,"-data", length) == 0) {
+ 	    if (masterPtr->dataString) {
+ 		Tcl_SetObjResult(interp, masterPtr->dataString);
+@@ -768,7 +767,7 @@ ImgPhotoCmd(clientData, interp, objc, objv)
+ 	    return TCL_OK;
+ 	}
+ 	if (objc == 3) {
+-	    char *arg = Tcl_GetStringFromObj(objv[2], (int *) &length);
++	    char *arg = Tcl_GetStringFromObj(objv[2], &length);
+ 	    if (!strncmp(arg, "-data", length)) {
+ 		Tcl_Obj *subobj = Tcl_NewStringObj("-data {} {} {}", 14);
+ 		if (masterPtr->dataString) {
+@@ -5753,8 +5752,8 @@ PhotoOptionFind(interp, obj)
+     Tcl_Interp *interp;         /* Interpreter that is being deleted. */
+     Tcl_Obj *obj;                       /* Name of option to be found. */
+ {
+-    size_t length;
+-    char *name = Tcl_GetStringFromObj(obj, (int *) &length);
++    int length;
++    char *name = Tcl_GetStringFromObj(obj, &length);
+     OptionAssocData *list;
+     char *prevname = NULL;
+     Tcl_ObjCmdProc *proc = (Tcl_ObjCmdProc *) NULL;
+
+From 0cc1fd7c599fc6b7050fcd7442f10824b032c462 Mon Sep 17 00:00:00 2001
+From: "jan.nijtmans" <nijtmans@users.sourceforge.net>
+Date: Thu, 3 Jan 2019 20:53:24 +0000
+Subject: [PATCH] Fix for conflicting symbols in X.h and Windows.h
+
+Backported from Tcl/Tk 8.6.10:
+see https://core.tcl-lang.org/tk/info/9e31fd944934
+
+Fixes #87
+--- a/pTk/mTk/xlib/X11/X.h
++++ b/pTk/mTk/xlib/X11/X.h
+@@ -73,7 +73,9 @@ typedef unsigned long KeyCode;	/* In order to use IME, the Macintosh needs
+  * RESERVED RESOURCE AND CONSTANT DEFINITIONS
+  *****************************************************************/
+ 
+-#define None                 0L	/* universal null resource or null atom */
++#ifndef _WIN32
++#   define None              0L      /* See bug [9e31fd9449] and below */
++#endif
+ 
+ #define ParentRelative       1L	/* background pixmap in CreateWindow
+ 				    and ChangeWindowAttributes */
+@@ -179,13 +181,20 @@ are reserved in the protocol for errors and replies. */
+ 
+ #define ShiftMask		(1<<0)
+ #define LockMask		(1<<1)
+-#define ControlMask		(1<<2)
++#ifndef _WIN32
++#   define ControlMask		(1<<2) /* See bug [9e31fd9449] and below */
++#endif
+ #define Mod1Mask		(1<<3)
+ #define Mod2Mask		(1<<4)
+ #define Mod3Mask		(1<<5)
+ #define Mod4Mask		(1<<6)
+ #define Mod5Mask		(1<<7)
+ 
++/* See bug [9e31fd9449], this way prevents conflicts with Win32 headers */
++#ifdef _WIN32
++enum _Bug9e31fd9449 { None = 0, ControlMask = (1<<2) };
++#endif
++
+ /* modifier names.  Used to build a SetModifierMapping request or
+    to read a GetModifierMapping request.  These correspond to the
+    masks defined above. */
+


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

* [gentoo-commits] repo/gentoo:master commit in: dev-perl/Tk/files/, dev-perl/Tk/
@ 2024-03-08 20:02 Sam James
  0 siblings, 0 replies; 3+ messages in thread
From: Sam James @ 2024-03-08 20:02 UTC (permalink / raw
  To: gentoo-commits

commit:     41fe4f8689b0e5062bf861d29cfca51b601d3502
Author:     Matoro Mahri <matoro_gentoo <AT> matoro <DOT> tk>
AuthorDate: Tue Jan 30 03:49:22 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Mar  8 20:00:30 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=41fe4f86

dev-perl/Tk: fix tests on 64-bit big-endian

See: https://salsa.debian.org/georgesk/perl-tk/-/blob/master/debian/patches/80-Fix-STRLEN-vs-int-pointer-confusion-in-Tcl_GetByteAr.patch?ref_type=heads
Bug: https://bugs.gentoo.org/916814
Signed-off-by: Matoro Mahri <matoro_gentoo <AT> matoro.tk>
Closes: https://github.com/gentoo/gentoo/pull/35086
Signed-off-by: Sam James <sam <AT> gentoo.org>

 dev-perl/Tk/Tk-804.36.0-r3.ebuild                  | 70 ++++++++++++++++++++++
 ...vs-int-pointer-confusion-in-Tcl_GetByteAr.patch | 48 +++++++++++++++
 2 files changed, 118 insertions(+)

diff --git a/dev-perl/Tk/Tk-804.36.0-r3.ebuild b/dev-perl/Tk/Tk-804.36.0-r3.ebuild
new file mode 100644
index 000000000000..f4609c38f79d
--- /dev/null
+++ b/dev-perl/Tk/Tk-804.36.0-r3.ebuild
@@ -0,0 +1,70 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+DIST_AUTHOR=SREZIC
+DIST_VERSION=804.036
+DIST_EXAMPLES=("examples/*")
+inherit perl-module virtualx
+
+DESCRIPTION="A Perl Module for Tk"
+
+LICENSE+=" tcltk BSD"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux"
+
+DEPEND="
+	media-libs/freetype
+	media-libs/libjpeg-turbo:=
+	>=media-libs/libpng-1.4:0
+	x11-libs/libX11
+	x11-libs/libXft
+"
+RDEPEND="${DEPEND}"
+
+PATCHES=(
+	"${FILESDIR}"/${PN}-804.034-xorg.patch
+	"${FILESDIR}"/${PN}-804.036-configure-clang16.patch
+	"${FILESDIR}"/${PN}-804.036-crash.patch
+	"${FILESDIR}"/${PN}-804.036-incompatible-function-pointer-types.patch
+	"${FILESDIR}"/${PN}-804.036-Fix-STRLEN-vs-int-pointer-confusion-in-Tcl_GetByteAr.patch
+)
+
+PERL_RM_FILES=( "t/pod.t" )
+
+src_prepare() {
+	myconf=( X11ROOT="${EPREFIX}"/usr XFT=1 -I"${EPREFIX}"/usr/include/ -l"${EPREFIX}"/usr/$(get_libdir) )
+	mydoc="ToDo VERSIONS"
+
+	perl-module_src_prepare
+	# fix detection logic for Prefix, bug #385621
+	sed -i -e "s:/usr:${EPREFIX}/usr:g" myConfig || die
+	# having this around breaks with perl-module and a case-IN-sensitive fs
+	rm build_ptk || die
+
+	# Remove all bundled libs, fixes #488194
+	local BUNDLED="PNG/libpng \
+					PNG/zlib \
+					JPEG/jpeg"
+
+	# Move files required for tests temporarily
+
+	mkdir -p "${T}/stash" || die "can't create temporary stash"
+	mv "${S}/JPEG/jpeg/testimg.jpg" "${T}/stash/testimg.jpg" || die "can't move testimg.jpg"
+
+	for dir in ${BUNDLED}; do
+		einfo "Removing bundled: ${dir}"
+		rm -r "${S}/${dir}" || die "Can't remove bundle"
+		# Makefile.PL can copy files to ${S}/${dir}, so recreate them back.
+		mkdir -p "${S}/${dir}" || die "Can't restore bundled dir"
+		sed -i "\#^${dir}#d" "${S}"/MANIFEST || die 'Can not remove bundled libs from MANIFEST'
+	done
+
+	# Restore test files
+	mv "${T}/stash/testimg.jpg" "${S}/JPEG/jpeg/testimg.jpg" || die "can't restore testimg.jpg"
+}
+
+src_test() {
+	virtx perl-module_src_test
+}

diff --git a/dev-perl/Tk/files/Tk-804.036-Fix-STRLEN-vs-int-pointer-confusion-in-Tcl_GetByteAr.patch b/dev-perl/Tk/files/Tk-804.036-Fix-STRLEN-vs-int-pointer-confusion-in-Tcl_GetByteAr.patch
new file mode 100644
index 000000000000..2d56412d1855
--- /dev/null
+++ b/dev-perl/Tk/files/Tk-804.036-Fix-STRLEN-vs-int-pointer-confusion-in-Tcl_GetByteAr.patch
@@ -0,0 +1,48 @@
+https://bugs.gentoo.org/916814
+https://salsa.debian.org/georgesk/perl-tk/-/blob/master/debian/patches/80-Fix-STRLEN-vs-int-pointer-confusion-in-Tcl_GetByteAr.patch?ref_type=heads
+
+From a26233c844c52f49ef9cca5f88dd9063aac60d0f Mon Sep 17 00:00:00 2001
+From: Niko Tyni <ntyni@debian.org>
+Date: Thu, 11 Jan 2024 18:28:58 +0000
+Subject: [PATCH] Fix STRLEN vs int pointer confusion in
+ Tcl_GetByteArrayFromObj()
+
+Perl 5.37.2, more precisely commit
+
+ https://github.com/Perl/perl5/commit/1ef9039bccbfe64f47f201b6cfb7d6d23e0b08a7
+
+changed the implementation of SvPV() et al., breaking t/balloon.t,
+t/canvas2.t and t/photo.t on big-endian 64-bit architectures such as
+ppc64 and s390x because StringMatchGIF() no longer recognized GIF files.
+
+This is because Tcl_GetByteArrayFromObj() was calling SvPV() with an int
+pointer instead of a correct STRLEN pointer, and the new implementation
+is more sensitive to this: it assigns the pointers as-is, resulting in
+the int pointer pointing at the wrong end of the 64-bit length.
+
+Other functions taking a length pointer, at least Tcl_GetStringFromObj()
+already seem to do things correctly, so presumably this is not a
+systematic issue.
+---
+ objGlue.c | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/objGlue.c b/objGlue.c
+index d4927ea..dbd6a50 100644
+--- a/objGlue.c
++++ b/objGlue.c
+@@ -627,7 +627,10 @@ Tcl_GetByteArrayFromObj(Tcl_Obj * objPtr, int * lengthPtr)
+  sv_utf8_downgrade(objPtr, 0);
+  if (lengthPtr)
+   {
+-   return (unsigned char *) SvPV(objPtr, *lengthPtr);
++   STRLEN len;
++   unsigned char *s = SvPV(objPtr, len);
++   *lengthPtr = len;
++   return s;
+   }
+  else
+   {
+-- 
+2.30.2
+


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

* [gentoo-commits] repo/gentoo:master commit in: dev-perl/Tk/files/, dev-perl/Tk/
@ 2024-06-14  6:33 Sam James
  0 siblings, 0 replies; 3+ messages in thread
From: Sam James @ 2024-06-14  6:33 UTC (permalink / raw
  To: gentoo-commits

commit:     af217418e5e0905eb688273cc2548d6b81c07967
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri Jun 14 06:31:58 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Jun 14 06:33:16 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=af217418

dev-perl/Tk: further Modern C fixes

Closes: https://bugs.gentoo.org/919179
Closes: https://bugs.gentoo.org/920309
Signed-off-by: Sam James <sam <AT> gentoo.org>

 dev-perl/Tk/Tk-804.36.0-r4.ebuild               | 73 +++++++++++++++++++++++++
 dev-perl/Tk/files/Tk-804.036-c99-old_warn.patch | 38 +++++++++++++
 dev-perl/Tk/files/Tk-804.036-c99-pregcomp.patch | 20 +++++++
 dev-perl/Tk/files/Tk-804.036-c99.patch          | 56 +++++++++++++++++++
 4 files changed, 187 insertions(+)

diff --git a/dev-perl/Tk/Tk-804.36.0-r4.ebuild b/dev-perl/Tk/Tk-804.36.0-r4.ebuild
new file mode 100644
index 000000000000..dae9c9bf25eb
--- /dev/null
+++ b/dev-perl/Tk/Tk-804.36.0-r4.ebuild
@@ -0,0 +1,73 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+DIST_AUTHOR=SREZIC
+DIST_VERSION=804.036
+DIST_EXAMPLES=("examples/*")
+inherit perl-module virtualx
+
+DESCRIPTION="A Perl Module for Tk"
+
+LICENSE+=" tcltk BSD"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux"
+
+DEPEND="
+	media-libs/freetype
+	media-libs/libjpeg-turbo:=
+	>=media-libs/libpng-1.4:0
+	x11-libs/libX11
+	x11-libs/libXft
+"
+RDEPEND="${DEPEND}"
+
+PATCHES=(
+	"${FILESDIR}"/${PN}-804.034-xorg.patch
+	"${FILESDIR}"/${PN}-804.036-configure-clang16.patch
+	"${FILESDIR}"/${PN}-804.036-crash.patch
+	"${FILESDIR}"/${PN}-804.036-incompatible-function-pointer-types.patch
+	"${FILESDIR}"/${PN}-804.036-Fix-STRLEN-vs-int-pointer-confusion-in-Tcl_GetByteAr.patch
+	"${FILESDIR}"/${PN}-804.036-c99.patch
+	"${FILESDIR}"/${PN}-804.036-c99-pregcomp.patch
+	"${FILESDIR}"/${PN}-804.036-c99-old_warn.patch
+)
+
+PERL_RM_FILES=( "t/pod.t" )
+
+src_prepare() {
+	myconf=( X11ROOT="${EPREFIX}"/usr XFT=1 -I"${EPREFIX}"/usr/include/ -l"${EPREFIX}"/usr/$(get_libdir) )
+	mydoc="ToDo VERSIONS"
+
+	perl-module_src_prepare
+	# fix detection logic for Prefix, bug #385621
+	sed -i -e "s:/usr:${EPREFIX}/usr:g" myConfig || die
+	# having this around breaks with perl-module and a case-IN-sensitive fs
+	rm build_ptk || die
+
+	# Remove all bundled libs, fixes #488194
+	local BUNDLED="PNG/libpng \
+					PNG/zlib \
+					JPEG/jpeg"
+
+	# Move files required for tests temporarily
+
+	mkdir -p "${T}/stash" || die "can't create temporary stash"
+	mv "${S}/JPEG/jpeg/testimg.jpg" "${T}/stash/testimg.jpg" || die "can't move testimg.jpg"
+
+	for dir in ${BUNDLED}; do
+		einfo "Removing bundled: ${dir}"
+		rm -r "${S}/${dir}" || die "Can't remove bundle"
+		# Makefile.PL can copy files to ${S}/${dir}, so recreate them back.
+		mkdir -p "${S}/${dir}" || die "Can't restore bundled dir"
+		sed -i "\#^${dir}#d" "${S}"/MANIFEST || die 'Can not remove bundled libs from MANIFEST'
+	done
+
+	# Restore test files
+	mv "${T}/stash/testimg.jpg" "${S}/JPEG/jpeg/testimg.jpg" || die "can't restore testimg.jpg"
+}
+
+src_test() {
+	virtx perl-module_src_test
+}

diff --git a/dev-perl/Tk/files/Tk-804.036-c99-old_warn.patch b/dev-perl/Tk/files/Tk-804.036-c99-old_warn.patch
new file mode 100644
index 000000000000..976a6a6dfefd
--- /dev/null
+++ b/dev-perl/Tk/files/Tk-804.036-c99-old_warn.patch
@@ -0,0 +1,38 @@
+https://src.fedoraproject.org/rpms/perl-Tk/blob/rawhide/f/perl-Tk-Avoid-using-incompatible-pointer-type-for-old_warn.patch
+
+From c4cd966ed0997e2acb1fdcaf112c55a78ed50847 Mon Sep 17 00:00:00 2001
+From: Christopher Chavez <chrischavez@gmx.us>
+Date: Mon, 19 Feb 2024 14:18:43 -0600
+Subject: [PATCH] Avoid using incompatible pointer type for `old_warn`
+
+See https://github.com/eserte/perl-tk/issues/98#issuecomment-1944054296
+--- a/Event/Event.xs
++++ b/Event/Event.xs
+@@ -1532,7 +1532,7 @@ PROTOTYPES: DISABLE
+ BOOT:
+  {
+ #ifdef pWARN_NONE
+-  SV *old_warn = PL_curcop->cop_warnings;
++  void *old_warn = PL_curcop->cop_warnings;
+   PL_curcop->cop_warnings = pWARN_NONE;
+ #endif
+   newXS("Tk::Event::INIT", XS_Tk__Event_INIT, file);
+--- a/tkGlue.c
++++ b/tkGlue.c
+@@ -5543,13 +5543,8 @@ _((pTHX))
+  char *XEventMethods = "abcdfhkmopstvwxyABDEKNRSTWXY#";
+  char buf[128];
+  CV *cv;
+-#if PERL_REVISION > 5 || (PERL_REVISION == 5 && PERL_VERSION >= 9)
+-#define COP_WARNINGS_TYPE STRLEN*
+-#else
+-#define COP_WARNINGS_TYPE SV*
+-#endif
+ #ifdef pWARN_NONE
+- COP_WARNINGS_TYPE old_warn = PL_curcop->cop_warnings;
++ void *old_warn = PL_curcop->cop_warnings;
+  PL_curcop->cop_warnings = pWARN_NONE;
+ #endif
+ 
+-- 
+2.43.0

diff --git a/dev-perl/Tk/files/Tk-804.036-c99-pregcomp.patch b/dev-perl/Tk/files/Tk-804.036-c99-pregcomp.patch
new file mode 100644
index 000000000000..6ec56b6905ab
--- /dev/null
+++ b/dev-perl/Tk/files/Tk-804.036-c99-pregcomp.patch
@@ -0,0 +1,20 @@
+https://bugs.gentoo.org/920309
+https://src.fedoraproject.org/rpms/perl-Tk/blob/rawhide/f/perl-Tk-pregcomp2.c-Avoid-using-incompatible-pointer-type.patch
+
+From 5c646b1cc55e18648918f101961afd1589a58168 Mon Sep 17 00:00:00 2001
+From: Christopher Chavez <chrischavez@gmx.us>
+Date: Mon, 19 Feb 2024 13:50:44 -0600
+Subject: [PATCH] pregcomp2.c: Avoid using incompatible pointer type
+
+See https://github.com/eserte/perl-tk/issues/98#issuecomment-1948125587
+--- a/config/pregcomp2.c
++++ b/config/pregcomp2.c
+@@ -4,5 +4,5 @@
+ 
+ int main() {
+     SV* sv = newSViv(0);
+-    regexp* rx = pregcomp(sv, 0);
++    void* rx = pregcomp(sv, 0);
+ }
+-- 
+2.43.0

diff --git a/dev-perl/Tk/files/Tk-804.036-c99.patch b/dev-perl/Tk/files/Tk-804.036-c99.patch
new file mode 100644
index 000000000000..357d6f13f3c1
--- /dev/null
+++ b/dev-perl/Tk/files/Tk-804.036-c99.patch
@@ -0,0 +1,56 @@
+https://bugs.gentoo.org/919179
+https://src.fedoraproject.org/rpms/perl-Tk/raw/rawhide/f/perl-Tk-c99.patch
+https://github.com/eserte/perl-tk/pull/91
+--- a/config/unsigned.c
++++ b/config/unsigned.c
+@@ -1,15 +1,16 @@
++#include <stdio.h>
+ int main()
+ {
+  char x[] = "\377";
+  if (x[0] > 0)
+   {
+    printf("char is unsigned type\n");
+-   exit(0);
++   return 0;
+   }
+  else
+   {
+    printf("char is signed type\n");
+-   exit(1);
++   return 1;
+   }
+ }
+ 
+--- a/pTk/config/Hstrdup.c
++++ b/pTk/config/Hstrdup.c
+@@ -7,7 +7,7 @@ int main()
+ {char *e;
+  char *p = strdup(STRING);
+  if (!p || strcmp(p,STRING))
+-  exit(1);
++  return 1;
+  return 0;
+ }
+ 
+--- a/pTk/mTk/generic/tkEvent.c
++++ b/pTk/mTk/generic/tkEvent.c
+@@ -1153,6 +1153,7 @@ TkEventDeadWindow(winPtr)
+ Time
+ TkCurrentTime(dispPtr, fallbackCurrent)
+     TkDisplay *dispPtr;		/* Display for which the time is desired. */
++    int fallbackCurrent;
+ {
+     register XEvent *eventPtr;
+     ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+--- a/pTk/mTk/generic/tkImage.c
++++ b/pTk/mTk/generic/tkImage.c
+@@ -1083,6 +1083,8 @@ int x;
+ int y;
+ int width;
+ int height;
++int imgWidth;
++int imgHeight;
+ {
+     Tk_Tile tile = (Tk_Tile) clientData;
+     Tk_TileChange *handler;


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

end of thread, other threads:[~2024-06-14  6:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-11  4:26 [gentoo-commits] repo/gentoo:master commit in: dev-perl/Tk/files/, dev-perl/Tk/ Sam James
  -- strict thread matches above, loose matches on Subject: below --
2024-03-08 20:02 Sam James
2024-06-14  6:33 Sam James

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