summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2023-03-17 21:21:37 +0000
committerSam James <sam@gentoo.org>2023-03-17 21:52:20 +0000
commit56703991485dfac2ce34bd1f177191807f69c5fe (patch)
treee529278f6e97b919d62368c419aad6d67bff41ef /dev-perl
parentapp-crypt/gpgme: add 1.19.0 (diff)
downloadgentoo-56703991485dfac2ce34bd1f177191807f69c5fe.tar.gz
gentoo-56703991485dfac2ce34bd1f177191807f69c5fe.tar.bz2
gentoo-56703991485dfac2ce34bd1f177191807f69c5fe.zip
dev-perl/SDL: fix build w/ clang 16
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'dev-perl')
-rw-r--r--dev-perl/SDL/SDL-2.548.0-r2.ebuild50
-rw-r--r--dev-perl/SDL/files/SDL-2.546-implicit-func-decl.patch40
2 files changed, 90 insertions, 0 deletions
diff --git a/dev-perl/SDL/SDL-2.548.0-r2.ebuild b/dev-perl/SDL/SDL-2.548.0-r2.ebuild
new file mode 100644
index 000000000000..59caa0f55c01
--- /dev/null
+++ b/dev-perl/SDL/SDL-2.548.0-r2.ebuild
@@ -0,0 +1,50 @@
+# Copyright 1999-2023 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'
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-2.546-pointer.patch
+ "${FILESDIR}"/${PN}-2.546-implicit-func-decl.patch
+)
diff --git a/dev-perl/SDL/files/SDL-2.546-implicit-func-decl.patch b/dev-perl/SDL/files/SDL-2.546-implicit-func-decl.patch
new file mode 100644
index 000000000000..9bbee3356486
--- /dev/null
+++ b/dev-perl/SDL/files/SDL-2.546-implicit-func-decl.patch
@@ -0,0 +1,40 @@
+https://github.com/PerlGameDev/SDL/pull/299
+
+From 90d7056288282df9febf04acce6712f4071e4103 Mon Sep 17 00:00:00 2001
+From: Ryan Schmidt <git@ryandesign.com>
+Date: Wed, 26 Jan 2022 02:55:04 -0600
+Subject: [PATCH] Fix implicit declaration of _calc_offset
+
+--- a/src/SDLx/Surface.xs
++++ b/src/SDLx/Surface.xs
+@@ -16,6 +16,14 @@
+ #include <SDL_gfxPrimitives.h>
+ #endif
+
++int _calc_offset ( SDL_Surface* surface, int x, int y )
++{
++ int offset;
++ offset = (surface->pitch * y) / surface->format->BytesPerPixel;
++ offset += x;
++ return offset;
++}
++
+ SV * get_pixel32 (SDL_Surface *surface, int x, int y)
+ {
+ /* Convert the pixels to 32 bit */
+@@ -52,14 +60,6 @@ SV * construct_p_matrix ( SDL_Surface *surface )
+ return newRV_noinc((SV *)matrix);
+ }
+
+-int _calc_offset ( SDL_Surface* surface, int x, int y )
+-{
+- int offset;
+- offset = (surface->pitch * y) / surface->format->BytesPerPixel;
+- offset += x;
+- return offset;
+-}
+-
+ unsigned int _get_pixel(SDL_Surface * surface, int offset)
+ {
+ unsigned int value;
+