When I try to build cmake-based application which uses sdl2-image it fails
because of missing /usr/local/lib/libSDL2_image.so file.

Cmake files provided by sdl2-image are looking for
/usr/local/lib/libSDL2_image.so, which is obviously not found. I can see that
sdl2-image port misses some files which we have for other sdl2-* ports. For
example for devel/sdl2-ttf.

So, proposed patch fixes cmake files to look for
/usr/local/lib/libSDL2_image.so.1.1 instead of /usr/local/lib/libSDL2_image.so

diff --git a/devel/sdl2-image/Makefile b/devel/sdl2-image/Makefile
index 3ab8314ca..27ee3c0d3 100644
--- a/devel/sdl2-image/Makefile
+++ b/devel/sdl2-image/Makefile
@@ -39,4 +39,7 @@ CONFIGURE_ARGS +=     --disable-avif-shared \
                        --disable-webp-shared
 CONFIGURE_ENV +=       OBJC="${CC}"

+pre-configure:
+       ${SUBST_CMD} ${WRKSRC}/sdl2_image-config.cmake.in
+
 .include <bsd.port.mk>
diff --git a/devel/sdl2-image/patches/patch-sdl2_image-config_cmake_in 
b/devel/sdl2-image/patches/patch-sdl2_image-config_cmake_in
new file mode 100644
index 000000000..c4bf5c9ac
--- /dev/null
+++ b/devel/sdl2-image/patches/patch-sdl2_image-config_cmake_in
@@ -0,0 +1,12 @@
+Index: sdl2_image-config.cmake.in
+--- sdl2_image-config.cmake.in.orig
++++ sdl2_image-config.cmake.in
+@@ -78,7 +78,7 @@ if(NOT TARGET SDL2_image::SDL2_image)
+     else()
+         set_target_properties(SDL2_image::SDL2_image
+             PROPERTIES
+-                IMPORTED_LOCATION 
"${_sdl2image_libdir}/${CMAKE_SHARED_LIBRARY_PREFIX}SDL2_image${CMAKE_SHARED_LIBRARY_SUFFIX}"
++                IMPORTED_LOCATION 
"${_sdl2image_libdir}/${CMAKE_SHARED_LIBRARY_PREFIX}SDL2_image${CMAKE_SHARED_LIBRARY_SUFFIX}.${LIBSDL2_image_VERSION}"
+         )
+     endif()
+ endif()

--
Best regards, Viacheslav Chimishuk
vchimis...@yandex.ru
Ukraine, Khmelnitsky

Reply via email to