git: a55f03d90f6b - main - graphics/sdl2_image: update 2.0.5 → 2.6.2

From: Dmitry Marakasov <amdmi3_at_FreeBSD.org>
Date: Wed, 31 Aug 2022 10:16:22 UTC
The branch main has been updated by amdmi3:

URL: https://cgit.FreeBSD.org/ports/commit/?id=a55f03d90f6bf5a5da822a6e7e68e89814c60b9d

commit a55f03d90f6bf5a5da822a6e7e68e89814c60b9d
Author:     Dmitry Marakasov <amdmi3@FreeBSD.org>
AuthorDate: 2022-08-30 18:17:46 +0000
Commit:     Dmitry Marakasov <amdmi3@FreeBSD.org>
CommitDate: 2022-08-31 10:15:29 +0000

    graphics/sdl2_image: update 2.0.5 → 2.6.2
---
 graphics/sdl2_image/Makefile                       | 41 ++++++++++++++--------
 graphics/sdl2_image/distinfo                       |  6 ++--
 .../files/patch-cmake_FindSDL2test.cmake           | 10 ++++++
 graphics/sdl2_image/pkg-descr                      | 20 +++--------
 graphics/sdl2_image/pkg-plist                      | 10 ++++--
 5 files changed, 51 insertions(+), 36 deletions(-)

diff --git a/graphics/sdl2_image/Makefile b/graphics/sdl2_image/Makefile
index 5e678c08381b..d21458271cf7 100644
--- a/graphics/sdl2_image/Makefile
+++ b/graphics/sdl2_image/Makefile
@@ -1,34 +1,45 @@
 PORTNAME=	sdl2_image
-PORTVERSION=	2.0.5
+DISTVERSIONPREFIX=	release-
+DISTVERSION=	2.6.2
 CATEGORIES=	graphics
-MASTER_SITES=	https://www.libsdl.org/projects/SDL_image/release/
-DISTNAME=	SDL2_image-${PORTVERSION}
 
 MAINTAINER=	amdmi3@FreeBSD.org
 COMMENT=	Simple library to load images of various formats as SDL surfaces
 
 LICENSE=	ZLIB
-LICENSE_FILE=	${WRKSRC}/COPYING.txt
+LICENSE_FILE=	${WRKSRC}/LICENSE.txt
 
-USES=		gmake libtool localbase pkgconfig pathfix sdl
+USES=		cmake sdl
+USE_GITHUB=	yes
+GH_ACCOUNT=	libsdl-org
+GH_PROJECT=	SDL_image
 USE_SDL=	sdl2
-GNU_CONFIGURE=	yes
-CONFIGURE_ARGS=	--disable-jpg-shared --disable-png-shared \
-		--disable-tif-shared --disable-webp-shared
-INSTALL_TARGET=	install-strip
+CMAKE_OFF=	SDL2IMAGE_DEPS_SHARED \
+		SDL2IMAGE_SAMPLES \
+		SDL2IMAGE_BACKEND_STB
+CMAKE_ARGS=	-DSDL2IMAGE_DEBUG_POSTFIX:STRING=
 USE_LDCONFIG=	yes
 
-OPTIONS_DEFINE=	JPEG PNG TIFF WEBP
-OPTIONS_DEFAULT=JPEG PNG TIFF WEBP
+OPTIONS_DEFINE=	AVIF JPEG JXL PNG TIFF WEBP TEST
+OPTIONS_DEFAULT=JPEG PNG
 
 JPEG_USES=		jpeg
-JPEG_CONFIGURE_ENABLE=	jpg
+JPEG_CMAKE_BOOL=	SDL2IMAGE_JPG
 PNG_LIB_DEPENDS=	libpng.so:graphics/png
-PNG_CONFIGURE_ENABLE=	png
+PNG_CMAKE_BOOL=		SDL2IMAGE_PNG
 TIFF_LIB_DEPENDS=	libtiff.so:graphics/tiff
-TIFF_CONFIGURE_ENABLE=	tif
+TIFF_CMAKE_BOOL=	SDL2IMAGE_TIF
 WEBP_LIB_DEPENDS=	libwebp.so:graphics/webp
-WEBP_CONFIGURE_ENABLE=	webp
+WEBP_CMAKE_BOOL=	SDL2IMAGE_WEBP
+AVIF_LIB_DEPENDS=	libavif.so:graphics/libavif
+AVIF_CMAKE_BOOL=	SDL2IMAGE_AVIF
+JXL_LIB_DEPENDS=	libjxl.so:graphics/libjxl
+JXL_CMAKE_BOOL=		SDL2IMAGE_JXL
+TEST_CMAKE_BOOL=	SDL2IMAGE_TESTS
+TEST_CONFIGURE_ENV=	LOCALBASE="${LOCALBASE}"
+TEST_LIB_DEPENDS=	libunwind.so:devel/libunwind
+TEST_TEST_TARGET=	test
+TEST_IMPLIES=		PNG JPEG  # does not build otherwise
 
 post-extract:
 	@${RM} -rf ${WRKSRC}/external
diff --git a/graphics/sdl2_image/distinfo b/graphics/sdl2_image/distinfo
index 5c8b95f26812..67a5883e2b4f 100644
--- a/graphics/sdl2_image/distinfo
+++ b/graphics/sdl2_image/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1562166413
-SHA256 (SDL2_image-2.0.5.tar.gz) = bdd5f6e026682f7d7e1be0b6051b209da2f402a2dd8bd1c4bd9c25ad263108d0
-SIZE (SDL2_image-2.0.5.tar.gz) = 11736518
+TIMESTAMP = 1661883495
+SHA256 (libsdl-org-SDL_image-release-2.6.2_GH0.tar.gz) = 5d91ea72b449a161821ef51464d0767efb6fedf7a773f923c43e483dc137e362
+SIZE (libsdl-org-SDL_image-release-2.6.2_GH0.tar.gz) = 9789569
diff --git a/graphics/sdl2_image/files/patch-cmake_FindSDL2test.cmake b/graphics/sdl2_image/files/patch-cmake_FindSDL2test.cmake
new file mode 100644
index 000000000000..bfc11a9f79fe
--- /dev/null
+++ b/graphics/sdl2_image/files/patch-cmake_FindSDL2test.cmake
@@ -0,0 +1,10 @@
+--- cmake/FindSDL2test.cmake.orig	2022-07-08 13:31:48 UTC
++++ cmake/FindSDL2test.cmake
+@@ -16,6 +16,7 @@ find_package_handle_standard_args(SDL2test
+ if(SDL2test_FOUND)
+     if(NOT TARGET SDL2::SDL2test)
+         add_library(SDL2::SDL2test UNKNOWN IMPORTED)
++        target_link_libraries(SDL2::SDL2test INTERFACE $ENV{LOCALBASE}/lib/libunwind.so)
+         set_target_properties(SDL2::SDL2test PROPERTIES
+             IMPORTED_LINK_INTERFACE_LANGUAGES "C"
+             IMPORTED_LOCATION "${SDL2_TEST_LIBRARY}"
diff --git a/graphics/sdl2_image/pkg-descr b/graphics/sdl2_image/pkg-descr
index 4988823c3fab..7223deef241f 100644
--- a/graphics/sdl2_image/pkg-descr
+++ b/graphics/sdl2_image/pkg-descr
@@ -1,18 +1,6 @@
 This is a simple library to load images of various formats as SDL surfaces.
-This library supports BMP, PPM, PCX, GIF, JPEG, PNG, TGA, and TIFF formats.
+It can load BMP, GIF, JPEG, LBM, PCX, PNG, PNM (PPM/PGM/PBM), QOI,
+TGA, XCF, XPM, and simple SVG format images. It can also load AVIF,
+JPEG-XL, TIFF, and WebP images, depending on build options
 
-API:
-#include "SDL_image.h"
-
-	SDL_Surface *IMG_Load(const char *file);
-or
-	SDL_Surface *IMG_Load_RW(SDL_RWops *src, int freesrc);
-or
-	SDL_Surface *IMG_Load_RW(SDL_RWops *src, int freesrc, char *type);
-
-where type is a string specifying the format (i.e. "PNG" or "pcx").
-Note that IMG_Load_RW cannot load TGA images.
-
-An example program 'showimage' is included, with source in showimage.c
-
-WWW: https://www.libsdl.org/projects/SDL_image/
+WWW: https://github.com/libsdl-org/SDL_image
diff --git a/graphics/sdl2_image/pkg-plist b/graphics/sdl2_image/pkg-plist
index 1eb3e059fb50..98c15a3a7cf6 100644
--- a/graphics/sdl2_image/pkg-plist
+++ b/graphics/sdl2_image/pkg-plist
@@ -1,6 +1,12 @@
 include/SDL2/SDL_image.h
+lib/cmake/SDL2_image/Findlibjxl.cmake
+lib/cmake/SDL2_image/Findwebp.cmake
+lib/cmake/SDL2_image/SDL2_image-shared-targets-%%CMAKE_BUILD_TYPE%%.cmake
+lib/cmake/SDL2_image/SDL2_image-shared-targets.cmake
+lib/cmake/SDL2_image/SDL2_imageConfig.cmake
+lib/cmake/SDL2_image/SDL2_imageConfigVersion.cmake
+lib/libSDL2_image-2.0.so
 lib/libSDL2_image-2.0.so.0
-lib/libSDL2_image-2.0.so.0.2.3
-lib/libSDL2_image.a
+lib/libSDL2_image-2.0.so.0.600.2
 lib/libSDL2_image.so
 libdata/pkgconfig/SDL2_image.pc