summaryrefslogtreecommitdiff
path: root/dev-perl/SDL
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2024-05-03 00:00:22 +0100
committerV3n3RiX <venerix@koprulu.sector>2024-05-03 00:00:22 +0100
commita98588cfddf3d6e88a5f17d7f399b695163c7a85 (patch)
tree9f786257ac4bfd6be23a0d585c4b6c17361d37d2 /dev-perl/SDL
parentf5ef7f2371babf22c2c3fad17108692b09e4c98e (diff)
gentoo auto-resync : 03:05:2024 - 00:00:22
Diffstat (limited to 'dev-perl/SDL')
-rw-r--r--dev-perl/SDL/Manifest3
-rw-r--r--dev-perl/SDL/SDL-2.548.0-r3.ebuild58
-rw-r--r--dev-perl/SDL/files/SDL-2.548-refcount.patch27
-rw-r--r--dev-perl/SDL/files/SDL-2.548-uaf-surface.patch127
4 files changed, 215 insertions, 0 deletions
diff --git a/dev-perl/SDL/Manifest b/dev-perl/SDL/Manifest
index 2dad13fff0e2..2a4824484555 100644
--- a/dev-perl/SDL/Manifest
+++ b/dev-perl/SDL/Manifest
@@ -1,7 +1,10 @@
AUX SDL-2.546-implicit-func-decl.patch 1046 BLAKE2B 98e0d34de6e65c668341f0835239472378c9032317d87d551099ebf43128647942f33578734f799ffc532c8cee3a311f2fb53a9e803e5123bcd28ed7289df5c5 SHA512 f8475d56cf4c3fd48d0fa5528a7cfc0eb170f89f04c42c60c6f1af2af92d7722f0031c9732d818bbb129dfd21079b516f3ca738a693320aa7c2cb8f7716ff0ea
AUX SDL-2.546-pointer.patch 671 BLAKE2B 188280d823e6cffea2e7d33ede63ecb172a8a272aea98272df75a75ee2cb848ca11426912bcdf90cc5cbe61ef21bb86f37803b50f7907ee9903f6173b3253094 SHA512 25a03721a4ffe64b85512fd896cef2a08faf3284ffd2f9a93fe578f7df0e96bc40952a85e39f4023f38fbb664cd7435e5d5587a7d861e884a616835e7eaecec0
AUX SDL-2.548-perl537_sv_nv.patch 2049 BLAKE2B 4a705208e549e3ed89c8a00e0b835b9d83e5681130a0f79a3b4994d6d79206ccc0533fd1466e48bd2c117845f33978578df8dff9963040754a7d5cf377a173b8 SHA512 3eb544e75386d820de82711a8e7d0da24fb42c4fd0c892765159d32c54fb529ba8adcab1f7f522aa446a43d04bd4d683ad8bf8133100ebf550ad6c3d77b3f74d
+AUX SDL-2.548-refcount.patch 977 BLAKE2B d5018c4fb42e920d1655ab291e2509f8734759beefbe6c7018860995ece1dabed4c70a59f3ba36a5fdef3cd8b23701c86a7a616117ee3d09c0d77e65d01ae150 SHA512 48e33248e737c913f52d3188dd5032e06fcd79885a8e3c33344772e8abe79bfe506c6b9b4d8e97d741f5bfc49555e0c4a8baf856436f23e8e023ad8ee311ea56
+AUX SDL-2.548-uaf-surface.patch 3683 BLAKE2B ddc8383dd59192e057f9199c5d3168a43b45ba9cf2c740a2a23f37c75d92db1c1a9cc0a91a78e4c2f00e72f96675571862c202f6bc8e84322763ffbe52f117a1 SHA512 ed0460b321d47b961adaa4482dc89dc9932a6838fe67438c987e857029da310a334b6eeef5eea9be1e39bd96b0ab4e34ef351a6b9fadd8c197763bc58916ddf1
DIST SDL-2.548.tar.gz 2487708 BLAKE2B 1d17c5ffc8d966fd06b282632de1f504548df9c67754788e5dcbe2144057aa9d463a88e01b33b0f265a821cfb24847bafc1cb1215cdd6282cc29ff3aacea6c3c SHA512 bafc49dddb7e592861f822920915c73bf0c5eea3a6c567623b48a2332c7644caf1451e457545e6666adea5e314b23bcd85a3f3a52c770abfd498c0e4c0feae85
EBUILD SDL-2.548.0-r1.ebuild 1039 BLAKE2B 3d4aa73edfa27ed339b67030e3fdfe636cd7ed8512a7201623d1520d5973d29ae0f80d7ebd0654b4f2b2c3fe90561aa2598e01f1976f912f6f64081c921e2a5a SHA512 6e9bc680e2974893db281c643958a8fd08abdcb8c79dedb0e7e4f4a4227ea90d1767858d2634bd810a06777222ab8208aa4f58d72c8949d76987e7384396fc94
EBUILD SDL-2.548.0-r2.ebuild 1265 BLAKE2B 711eacbc7cdbe87e204193f3600e260a06102ea3099b29a53c5f477eecd31866d37a188485634dd88c21b3911e769d7ba192a3dfcda7adb29231887e182ccdfa SHA512 3304eb41a4b8ee6ccdac93365ecb64dd61ce052db43accf243cdf54f140948c1408526aec0bc6018742a4e57ba5193a86293be6ff300693b5b5a9e2c4561aa03
+EBUILD SDL-2.548.0-r3.ebuild 1353 BLAKE2B bb7b0e1e0bd2abfcc45d746890d4c58e6f0dab060e0ffa0e6d3fe9675ac1c38ac50c699edde9fb2bc7d65d4595ca07c499c4dbcbec6f188147db9929dbce51cc SHA512 6b02d4d9870da47feac07061ff73c0a4cfbd26032a57c849c4ea42d1a5e5a3db0cc9dfabc366377477cf1af1ec6a611730f3f69e1e8b01a8ee2c5c1543210ee1
MISC metadata.xml 5480 BLAKE2B 85c0374b2a8164223dad73037282a6bbd885f1fd841b0099aa37e12db5c5dadf5126d53352483fa112936e5057ffccd927422aca617f24cd0840e98806c0b82d SHA512 6940b411e173bb673ebdadefd7ddb0b7b6edfb950022400fc2f483027749180ef6026867acfd9906a5d48ec44702e540b43c23f87c11824215fbd1046d6a92ee
diff --git a/dev-perl/SDL/SDL-2.548.0-r3.ebuild b/dev-perl/SDL/SDL-2.548.0-r3.ebuild
new file mode 100644
index 000000000000..51fadb44ea35
--- /dev/null
+++ b/dev-perl/SDL/SDL-2.548.0-r3.ebuild
@@ -0,0 +1,58 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DIST_AUTHOR=FROGGS
+DIST_VERSION=2.548
+inherit perl-module
+
+DESCRIPTION="Simple DirectMedia Layer (SDL) bindings for perl"
+HOMEPAGE="http://sdl.perl.org/ https://search.cpan.org/dist/SDL/ https://github.com/PerlGameDev/SDL"
+
+LICENSE="GPL-2 OFL-1.1"
+SLOT="0"
+KEYWORDS="~amd64 ~hppa ~x86"
+
+RDEPEND="
+ >=dev-perl/Alien-SDL-1.446
+ dev-perl/Capture-Tiny
+ >=virtual/perl-CPAN-1.920.0
+ >=virtual/perl-ExtUtils-CBuilder-0.260.301
+ >=dev-perl/File-ShareDir-1.0.0
+ >=dev-perl/Module-Build-0.400.0
+ media-libs/libjpeg-turbo
+ virtual/perl-Scalar-List-Utils
+ dev-perl/Tie-Simple
+ media-libs/libpng:0
+ media-libs/libsdl
+ media-libs/sdl-gfx
+ media-libs/sdl-image
+ media-libs/sdl-mixer
+ media-libs/sdl-pango
+ media-libs/sdl-ttf
+ media-libs/smpeg
+ media-libs/tiff:0
+ virtual/glu
+ virtual/opengl
+"
+BDEPEND="${RDEPEND}
+ test? (
+ >=dev-perl/Test-Most-0.210.0
+ )
+"
+
+mydoc='CHANGELOG README TODO'
+
+PERL_RM_FILES=(
+ # Hangs, see bug #892011 and https://aur.archlinux.org/packages/perl-sdl#comment-903413.
+ t/core_video.t
+)
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-2.546-pointer.patch
+ "${FILESDIR}"/${PN}-2.546-implicit-func-decl.patch
+ "${FILESDIR}"/${PN}-2.548-perl537_sv_nv.patch
+ "${FILESDIR}"/${PN}-2.548-refcount.patch
+ "${FILESDIR}"/${PN}-2.548-uaf-surface.patch
+)
diff --git a/dev-perl/SDL/files/SDL-2.548-refcount.patch b/dev-perl/SDL/files/SDL-2.548-refcount.patch
new file mode 100644
index 000000000000..af150e35d2ba
--- /dev/null
+++ b/dev-perl/SDL/files/SDL-2.548-refcount.patch
@@ -0,0 +1,27 @@
+https://github.com/PerlGameDev/SDL/pull/308
+
+From fbf151a7481a5fda88bfe766d826fe55476cf4af Mon Sep 17 00:00:00 2001
+From: Colin Watson <cjwatson@debian.org>
+Date: Thu, 28 Mar 2024 13:21:47 +0000
+Subject: [PATCH] Fix reference-counting in set_event_filter
+
+This previously resulted in the following test failure with Perl 5.38.2
+on Debian unstable (https://bugs.debian.org/1064761):
+
+ t/core_events.t ................. 1/? Can't use an undefined value as a subroutine reference during global destruction.
+ t/core_events.t ................. Dubious, test returned 22 (wstat 5632, 0x1600)
+ All 691 subtests passed
+ (less 1 skipped subtest: 690 okay)
+--- a/src/Core/Events.xs
++++ b/src/Core/Events.xs
+@@ -102,7 +102,8 @@ void
+ events_set_event_filter(callback)
+ SV* callback
+ CODE:
+- eventfiltersv = callback;
++ SvREFCNT_dec(eventfiltersv);
++ eventfiltersv = SvREFCNT_inc_simple(callback);
+ SDL_SetEventFilter((SDL_EventFilter) eventfilter_cb);
+
+ AV *
+
diff --git a/dev-perl/SDL/files/SDL-2.548-uaf-surface.patch b/dev-perl/SDL/files/SDL-2.548-uaf-surface.patch
new file mode 100644
index 000000000000..d64d27eab89b
--- /dev/null
+++ b/dev-perl/SDL/files/SDL-2.548-uaf-surface.patch
@@ -0,0 +1,127 @@
+https://github.com/PerlGameDev/SDL/pull/306
+https://github.com/PerlGameDev/SDL/issues/305
+https://github.com/libsdl-org/sdl12-compat/issues/305
+
+From e9b907c08d9fcce4fccb3084ff38e65cb5c6828b Mon Sep 17 00:00:00 2001
+From: Simon McVittie <smcv@debian.org>
+Date: Tue, 18 Jul 2023 18:00:12 +0100
+Subject: [PATCH] Distinguish between owned and borrowed references to a
+ SDL_Surface
+
+In many SDL APIs that return a SDL_Surface *, the surface is considered
+to be owned by the caller, and must be freed by the caller.
+
+However, SDL_SetVideoMode and presumably SDL_GetVideoSurface return
+a pointer to SDL's internal video surface, which will be freed by SDL
+if necessary, and must not be freed by library users.
+Incorrectly freeing this surface can lead to a use-after-free crash,
+manifesting as a test failure in t/core_video.t.
+
+See also https://github.com/libsdl-org/sdl12-compat/issues/305
+
+Resolves: https://github.com/PerlGameDev/SDL/issues/305
+Signed-off-by: Simon McVittie <smcv@debian.org>
+---
+ src/Core/Video.xs | 6 ++++--
+ src/helper.h | 7 ++++---
+ typemap | 23 +++++++++++++++++++++++
+ 3 files changed, 31 insertions(+), 5 deletions(-)
+
+diff --git a/src/Core/Video.xs b/src/Core/Video.xs
+index 8efa4b4a..e0d1a679 100644
+--- a/src/Core/Video.xs
++++ b/src/Core/Video.xs
+@@ -10,6 +10,8 @@
+
+ #include <SDL.h>
+
++typedef SDL_Surface SDL_Surface_borrowed;
++
+ void _uinta_free(Uint16* av, int len_from_av_len)
+ {
+ if( av != NULL)
+@@ -56,7 +58,7 @@ See: L<http:/*www.libsdl.org/cgi/docwiki.cgi/SDL_API#head-813f033ec44914f267f321
+
+ =cut
+
+-SDL_Surface *
++SDL_Surface_borrowed *
+ video_get_video_surface()
+ PREINIT:
+ char* CLASS = "SDL::Surface";
+@@ -125,7 +127,7 @@ video_video_mode_ok ( width, height, bpp, flags )
+ RETVAL
+
+
+-SDL_Surface *
++SDL_Surface_borrowed *
+ video_set_video_mode ( width, height, bpp, flags )
+ int width
+ int height
+diff --git a/src/helper.h b/src/helper.h
+index 1d2ee9a5..6b8e4ab5 100644
+--- a/src/helper.h
++++ b/src/helper.h
+@@ -58,12 +58,13 @@ void objDESTROY(SV *bag, void (* callback)(void *object))
+ Uint32 *threadid = (Uint32*)(pointers[2]);
+
+ if(PERL_GET_CONTEXT == pointers[1]
+- && *threadid == SDL_ThreadID())
++ && (threadid == NULL || *threadid == SDL_ThreadID()))
+ {
+ pointers[0] = NULL;
+- if(object)
++ if(object && threadid != NULL)
+ callback(object);
+- safefree(threadid);
++ if (threadid != NULL)
++ safefree(threadid);
+ safefree(pointers);
+ }
+ }
+diff --git a/typemap b/typemap
+index c3ba997a..85a19265 100644
+--- a/typemap
++++ b/typemap
+@@ -34,6 +34,7 @@ SDL_UserEvent * O_OBJECT
+ SDL_QuitEvent * O_OBJECT
+ SDL_keysym * O_OBJECT
+ SDL_Surface * O_OBJECT
++SDL_Surface_borrowed * O_BORROWED
+ SDL_SysWMmsg * T_PTR
+ SDL_CD * O_OBJECT
+ SDL_CDtrack * O_OBJECT
+@@ -122,6 +123,17 @@ O_OBJECT
+ XSRETURN_UNDEF;
+ }
+
++O_BORROWED
++ if ($var) {
++ void** pointers = malloc(3 * sizeof(void*));
++ pointers[0] = (void*)$var;
++ pointers[1] = (void*)PERL_GET_CONTEXT;
++ pointers[2] = NULL;
++ sv_setref_pv( $arg, CLASS, (void*)pointers );
++ } else {
++ XSRETURN_UNDEF;
++ }
++
+ INPUT
+
+ O_OBJECT_NPGC
+@@ -136,3 +148,14 @@ O_OBJECT
+ } else {
+ XSRETURN_UNDEF;
+ }
++
++O_BORROWED
++ /* Same as O_OBJECT */
++ if( sv_isobject($arg) && (SvTYPE(SvRV($arg)) == SVt_PVMG) ) {
++ void** pointers = (void**)INT2PTR(void *, SvIV((SV *)SvRV( $arg )));
++ $var = ($type)(pointers[0]);
++ } else if ($arg == 0) {
++ XSRETURN(0);
++ } else {
++ XSRETURN_UNDEF;
++ }
+