Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[sdl3-image] Add new port sdl3-image #42849

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions ports/sdl3-image/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO libsdl-org/SDL_image
REF "preview-${VERSION}"
SHA512 e139fd9474213757f473ca96cb7df78e6b122ac1a0f8b88e66d28955b8ee0390f83ee14dfe4f188aa4ba14b812c5522ce366e61a00609a3079930d68d8233921
HEAD_REF main
)

vcpkg_check_features(
OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
libjpeg-turbo SDLIMAGE_JPG
libwebp SDLIMAGE_WEBP
tiff SDLIMAGE_TIF
)

vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
${FEATURE_OPTIONS}
-DSDLIMAGE_BACKEND_IMAGEIO=OFF
-DSDLIMAGE_BACKEND_STB=OFF
-DSDLIMAGE_DEPS_SHARED=OFF
-DSDLIMAGE_SAMPLES=OFF
-DSDLIMAGE_VENDORED=OFF
)

vcpkg_cmake_install()
vcpkg_copy_pdbs()

if(EXISTS "${CURRENT_PACKAGES_DIR}/cmake")
vcpkg_cmake_config_fixup(PACKAGE_NAME SDL3_image CONFIG_PATH cmake)
elseif(EXISTS "${CURRENT_PACKAGES_DIR}/SDL3_image.framework/Resources")
vcpkg_cmake_config_fixup(PACKAGE_NAME SDL3_image CONFIG_PATH SDL3_image.framework/Resources)
else()
vcpkg_cmake_config_fixup(PACKAGE_NAME SDL3_image CONFIG_PATH lib/cmake/SDL3_image)
endif()

vcpkg_fixup_pkgconfig()

if(NOT VCPKG_TARGET_IS_LINUX AND NOT VCPKG_TARGET_IS_ANDROID AND NOT VCPKG_BUILD_TYPE)
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/SDL3-image.pc" "-lSDL3_image" "-lSDL3_imaged")
endif()

file(REMOVE_RECURSE
"${CURRENT_PACKAGES_DIR}/debug/share"
"${CURRENT_PACKAGES_DIR}/debug/include"
"${CURRENT_PACKAGES_DIR}/SDL3_image.framework"
"${CURRENT_PACKAGES_DIR}/debug/SDL3_image.framework"
)

file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE.txt")
4 changes: 4 additions & 0 deletions ports/sdl3-image/usage
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
sdl3-image provides CMake targets:

find_package(SDL3_image CONFIG REQUIRED)
target_link_libraries(main PRIVATE $<IF:$<TARGET_EXISTS:SDL3_image::SDL3_image>,SDL3_image::SDL3_image,SDL3_image::SDL3_image-static>)
45 changes: 45 additions & 0 deletions ports/sdl3-image/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"name": "sdl3-image",
"version": "3.1.0",
"description": "SDL_image is an image file loading library. It loads images as SDL surfaces and textures, and supports the following formats: BMP, GIF, JPEG, LBM, PCX, PNG, PNM, TGA, TIFF, WEBP, XCF, XPM, XV",
"homepage": "https://github.com/libsdl-org/SDL_image",
"license": "Zlib",
"dependencies": [
"libpng",
{
"name": "sdl3",
"default-features": false
},
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
],
"features": {
"libjpeg-turbo": {
"description": "Support for JPEG image format",
"dependencies": [
"libjpeg-turbo"
]
},
"libwebp": {
"description": "Support for WEBP image format.",
"dependencies": [
"libwebp"
]
},
"tiff": {
"description": "Support for TIFF image format",
"dependencies": [
{
"name": "tiff",
"default-features": false
}
]
}
}
}
12 changes: 8 additions & 4 deletions versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -6580,10 +6580,6 @@
"baseline": "1.5.1",
"port-version": 1
},
"orange-math": {
"baseline": "1.0.1",
"port-version": 0
},
"omniorb": {
"baseline": "4.3.0",
"port-version": 3
Expand Down Expand Up @@ -6824,6 +6820,10 @@
"baseline": "0.12+20221121",
"port-version": 1
},
"orange-math": {
"baseline": "1.0.1",
"port-version": 0
},
"orc": {
"baseline": "2.0.0",
"port-version": 0
Expand Down Expand Up @@ -8264,6 +8264,10 @@
"baseline": "3.1.6-preview",
"port-version": 2
},
"sdl3-image": {
"baseline": "3.1.0",
"port-version": 0
},
"seacas": {
"baseline": "2022-11-22",
"port-version": 7
Expand Down
14 changes: 14 additions & 0 deletions versions/s-/sdl3-image.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"versions": [
{
"git-tree": "3616178507f673bbd2bcbabedddd8163fa92c7f4",
"version": "3.1.0",
"port-version": 0
},
{
"git-tree": "027866e96dcf638a36703757752d4b31e4bf017d",
"version": "3.1.0-preview",
"port-version": 0
}
]
}