Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 953472 - media-libs/sdl2-image-2.8.5: src/IMG_webp.c: In function ‘IMG_LoadWEBPAnimation_RW’: error: ‘SDL_PIXELFORMAT_RGBX32’ undeclared (first use in this function); did you mean ‘SDL_PIXELFORMAT_RGBA32’?
Summary: media-libs/sdl2-image-2.8.5: src/IMG_webp.c: In function ‘IMG_LoadWEBPAnimati...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Games
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-04-09 13:09 UTC by Michael Moon
Modified: 2025-04-19 08:59 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log (media-libs-sdl2-image-2.8.5-build_log.txt,23.59 KB, text/plain)
2025-04-09 13:09 UTC, Michael Moon
Details
emerge --info (emerge-info.txt,12.24 KB, text/plain)
2025-04-09 13:10 UTC, Michael Moon
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Moon 2025-04-09 13:09:59 UTC
Created attachment 924202 [details]
build.log

FAILED: CMakeFiles/SDL2_image.dir/src/IMG_webp.c.o
/usr/bin/x86_64-pc-linux-gnu-gcc -DBUILD_SDL -DDLL_EXPORT -DLOAD_BMP -DLOAD_GIF -DLOAD_JPG -DLOAD_JXL -DLOAD_LBM -DLOAD_PCX -DLOAD_PNG -DLOAD_PNM -DLOAD_QOI -DLOAD_SVG -DLOAD_TGA -DLOAD_TIF -DLOAD_WEBP -DLOAD_XCF -DLOAD_XPM -DLOAD_XV -DSDL_BUILD_MAJOR_VERSION=2 -DSDL_BUILD_MICRO_VERSION=5 -DSDL_BUILD_MINOR_VERSION=8 -DSDL_IMAGE_SAVE_JPG=1 -DSDL_IMAGE_SAVE_PNG=1 -I/var/tmp/portage/media-libs/sdl2-image-2.8.5/work/SDL2_image-2.8.5/include -isystem /usr/include/SDL2  -O2 -pipe -march=native -ftree-vectorize -fPIC -fvisibility=hidden -MD -MT CMakeFiles/SDL2_image.dir/src/IMG_webp.c.o -MF CMakeFiles/SDL2_image.dir/src/IMG_webp.c.o.d -o CMakeFiles/SDL2_image.dir/src/IMG_webp.c.o -c /var/tmp/portage/media-libs/sdl2-image-2.8.5/work/SDL2_image-2.8.5/src/IMG_webp.c
/var/tmp/portage/media-libs/sdl2-image-2.8.5/work/SDL2_image-2.8.5/src/IMG_webp.c: In function ‘IMG_LoadWEBPAnimation_RW’:
/var/tmp/portage/media-libs/sdl2-image-2.8.5/work/SDL2_image-2.8.5/src/IMG_webp.c:329:115: error: ‘SDL_PIXELFORMAT_RGBX32’ undeclared (first use in this function); did you mean ‘SDL_PIXELFORMAT_RGBA32’?
  329 |     canvas = SDL_CreateRGBSurfaceWithFormat(0, anim->w, anim->h, 0, features.has_alpha ? SDL_PIXELFORMAT_RGBA32 : SDL_PIXELFORMAT_RGBX32);
      |                                                                                                                   ^~~~~~~~~~~~~~~~~~~~~~
      |                                                                                                                   SDL_PIXELFORMAT_RGBA32
/var/tmp/portage/media-libs/sdl2-image-2.8.5/work/SDL2_image-2.8.5/src/IMG_webp.c:329:115: note: each undeclared identifier is reported only once for each function it appears in
Comment 1 Michael Moon 2025-04-09 13:10:25 UTC
Created attachment 924203 [details]
emerge --info
Comment 2 Michael Moon 2025-04-09 13:19:05 UTC
Curiously,

/var/tmp/portage/media-libs/sdl2-image-2.8.5 # grep -R SDL_PIXELFORMAT_RGBX32 work/
work/SDL2_image-2.8.5/src/IMG_webp.c:    canvas = SDL_CreateRGBSurfaceWithFormat(0, anim->w, anim->h, 0, features.has_alpha ? SDL_PIXELFORMAT_RGBA32 : SDL_PIXELFORMAT_RGBX32);
work/SDL2_image-2.8.5/Xcode/tvOS/SDL2.framework/Headers/SDL_pixels.h:    SDL_PIXELFORMAT_RGBX32 = SDL_PIXELFORMAT_RGBX8888,
work/SDL2_image-2.8.5/Xcode/tvOS/SDL2.framework/Headers/SDL_pixels.h:    SDL_PIXELFORMAT_RGBX32 = SDL_PIXELFORMAT_XBGR8888,
work/SDL2_image-2.8.5/Xcode/macOS/SDL2.framework/Headers/SDL_pixels.h:    SDL_PIXELFORMAT_RGBX32 = SDL_PIXELFORMAT_RGBX8888,
work/SDL2_image-2.8.5/Xcode/macOS/SDL2.framework/Headers/SDL_pixels.h:    SDL_PIXELFORMAT_RGBX32 = SDL_PIXELFORMAT_XBGR8888,
work/SDL2_image-2.8.5/Xcode/macOS/SDL2.framework/Versions/Current/Headers/SDL_pixels.h:    SDL_PIXELFORMAT_RGBX32 = SDL_PIXELFORMAT_RGBX8888,
work/SDL2_image-2.8.5/Xcode/macOS/SDL2.framework/Versions/Current/Headers/SDL_pixels.h:    SDL_PIXELFORMAT_RGBX32 = SDL_PIXELFORMAT_XBGR8888,
work/SDL2_image-2.8.5/Xcode/macOS/SDL2.framework/Versions/A/Headers/SDL_pixels.h:    SDL_PIXELFORMAT_RGBX32 = SDL_PIXELFORMAT_RGBX8888,
work/SDL2_image-2.8.5/Xcode/macOS/SDL2.framework/Versions/A/Headers/SDL_pixels.h:    SDL_PIXELFORMAT_RGBX32 = SDL_PIXELFORMAT_XBGR8888,
work/SDL2_image-2.8.5/Xcode/iOS/SDL2.framework/Headers/SDL_pixels.h:    SDL_PIXELFORMAT_RGBX32 = SDL_PIXELFORMAT_RGBX8888,
work/SDL2_image-2.8.5/Xcode/iOS/SDL2.framework/Headers/SDL_pixels.h:    SDL_PIXELFORMAT_RGBX32 = SDL_PIXELFORMAT_XBGR8888,

Only available for Xcode?

Or perhaps it's supposed to come from libsdl2:/usr/include/SDL2/SDL_pixels.h, but libsdl2 is barfing on some pipewire thing (which I'll report separately) and this doesn't depend on the necessary version of libsdl2?

If that's the case, perhaps sdl2-image-2.8.5 should depend on ≥libsdl2-2.30 or whatever version it needs?
Comment 3 Michael Moon 2025-04-09 13:36:50 UTC
I updated libsdl2 to 2.32.2 and it works, so it definitely needs a ≥ version dep added.

I couldn't test libsdl2-2.30.0 or libsdl2-2.32.0 though due to #953473
Comment 4 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2025-04-19 08:55:02 UTC
What version of libsdl2 did you have before?
Comment 5 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2025-04-19 08:58:12 UTC
https://github.com/libsdl-org/SDL/commit/666f81bace6765420aaba3aa06013e07ea9f9e65 for SDL 3 added SDL_PIXELFORMAT_RGBX32.

For libsdl2, it was added in:

commit 1bb5448fe80160a7e7549fee043e91c63da0b209
Author: Cameron Cawley <ccawley2011@gmail.com>
Date:   Fri Nov 17 18:40:50 2023 +0000

    Use the correct pixel formats for OpenGL ES on big endian

.. so indeed >= 2.30.0.
Comment 6 Larry the Git Cow gentoo-dev 2025-04-19 08:59:54 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fff550b1bccbb4d61bba3189229e3888e3c783fe

commit fff550b1bccbb4d61bba3189229e3888e3c783fe
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2025-04-19 08:58:51 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2025-04-19 08:59:30 +0000

    media-libs/sdl2-image: depend on >=dev-libs/libsdl2-2.30.0
    
    For libsdl2, SDL_PIXELFORMAT_RGBX32 was added in:
    
    commit 1bb5448fe80160a7e7549fee043e91c63da0b209
    Author: Cameron Cawley <ccawley2011@gmail.com>
    Date:   Fri Nov 17 18:40:50 2023 +0000
    
        Use the correct pixel formats for OpenGL ES on big endian
    
    Revbump given the bound was quite low before and may well have been
    missing actual functions needed.
    
    Closes: https://bugs.gentoo.org/953472
    Signed-off-by: Sam James <sam@gentoo.org>

 .../sdl2-image/{sdl2-image-2.8.5.ebuild => sdl2-image-2.8.5-r1.ebuild}  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)