[sdl2] Add feature x11 (#21188)

* [ssdl2] Add feature x11

* Update dependencies

* Update version files
This commit is contained in:
NancyLi1013 2021-11-12 05:47:51 +08:00 committed by GitHub
parent 7d3aeba684
commit 897ff9372f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 109 additions and 35 deletions

View File

@ -1,7 +1,7 @@
{
"name": "ffmpeg",
"version": "4.4",
"port-version": 17,
"port-version": 18,
"description": [
"a library to decode, encode, transcode, mux, demux, stream, filter and play pretty much anything that humans and machines have created.",
"FFmpeg is the leading multimedia framework, able to decode, encode, transcode, mux, demux, stream, filter and play pretty much anything that humans and machines have created. It supports the most obscure ancient formats up to the cutting edge. No matter if they were designed by some standards committee, the community or a corporation. It is also highly portable: FFmpeg compiles, runs, and passes our testing infrastructure FATE across Linux, Mac OS X, Microsoft Windows, the BSDs, Solaris, etc. under a wide variety of build environments, machine architectures, and configurations."
@ -493,7 +493,18 @@
"sdl2": {
"description": "Sdl2 support",
"dependencies": [
"sdl2"
{
"name": "sdl2",
"default-features": false,
"features": [
"x11"
],
"platform": "linux"
},
{
"name": "sdl2",
"platform": "!linux"
}
]
},
"snappy": {

View File

@ -1,6 +1,7 @@
{
"name": "gamedev-framework",
"version-semver": "0.20.0",
"port-version": 1,
"maintainers": [
"Julien Bernard <julien.bernard@univ-fcomte.fr>",
"Arthur Hugeat <hugeat.arthur@gmail.com>"
@ -16,7 +17,18 @@
"boost-heap",
"freetype",
"pugixml",
"sdl2",
{
"name": "sdl2",
"default-features": false,
"features": [
"x11"
],
"platform": "linux"
},
{
"name": "sdl2",
"platform": "!linux"
},
"stb",
"zlib"
]

View File

@ -1,13 +1,24 @@
{
"name": "pixel",
"version-string": "0.3",
"port-version": 2,
"port-version": 3,
"description": "Simple 2D Graphics based on standard and portable OpenGL.",
"homepage": "https://github.com/dascandy/pixel",
"supports": "!windows",
"dependencies": [
"glew",
"opengl",
"sdl2"
{
"name": "sdl2",
"default-features": false,
"features": [
"x11"
],
"platform": "linux"
},
{
"name": "sdl2",
"platform": "!linux"
}
]
}

View File

@ -18,12 +18,19 @@ string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "static" FORCE_STATIC_VCRT)
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
vulkan VIDEO_VULKAN
vulkan VIDEO_VULKAN
x11 X11_SHARED
)
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
if ("x11" IN_LIST FEATURES)
if (VCPKG_TARGET_IS_WINDOWS)
message(FATAL_ERROR "Feature x11 only support UNIX.")
endif()
message(WARNING "You will need to install Xorg dependencies to use feature x11:\nsudo apt install libx11-dev libxft-dev libxext-dev\n")
endif()
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS ${FEATURE_OPTIONS}
-DSDL_STATIC=${SDL_STATIC}
-DSDL_SHARED=${SDL_SHARED}
@ -31,50 +38,50 @@ vcpkg_configure_cmake(
-DLIBC=ON
)
vcpkg_install_cmake()
vcpkg_cmake_install()
if(EXISTS "${CURRENT_PACKAGES_DIR}/cmake")
vcpkg_fixup_cmake_targets(CONFIG_PATH cmake)
vcpkg_cmake_config_fixup(CONFIG_PATH cmake)
elseif(EXISTS "${CURRENT_PACKAGES_DIR}/lib/cmake/SDL2")
vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/SDL2)
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/SDL2)
elseif(EXISTS "${CURRENT_PACKAGES_DIR}/SDL2.framework/Resources")
vcpkg_fixup_cmake_targets(CONFIG_PATH SDL2.framework/Resources)
vcpkg_cmake_config_fixup(CONFIG_PATH SDL2.framework/Resources)
endif()
file(REMOVE_RECURSE
${CURRENT_PACKAGES_DIR}/debug/include
${CURRENT_PACKAGES_DIR}/debug/share
${CURRENT_PACKAGES_DIR}/bin/sdl2-config
${CURRENT_PACKAGES_DIR}/debug/bin/sdl2-config
${CURRENT_PACKAGES_DIR}/SDL2.framework
${CURRENT_PACKAGES_DIR}/debug/SDL2.framework
"${CURRENT_PACKAGES_DIR}/debug/include"
"${CURRENT_PACKAGES_DIR}/debug/share"
"${CURRENT_PACKAGES_DIR}/bin/sdl2-config"
"${CURRENT_PACKAGES_DIR}/debug/bin/sdl2-config"
"${CURRENT_PACKAGES_DIR}/SDL2.framework"
"${CURRENT_PACKAGES_DIR}/debug/SDL2.framework"
)
file(GLOB BINS ${CURRENT_PACKAGES_DIR}/debug/bin/* ${CURRENT_PACKAGES_DIR}/bin/*)
file(GLOB BINS "${CURRENT_PACKAGES_DIR}/debug/bin/*" "${CURRENT_PACKAGES_DIR}/bin/*")
if(NOT BINS)
file(REMOVE_RECURSE
${CURRENT_PACKAGES_DIR}/bin
${CURRENT_PACKAGES_DIR}/debug/bin
"${CURRENT_PACKAGES_DIR}/bin"
"${CURRENT_PACKAGES_DIR}/debug/bin"
)
endif()
if(NOT VCPKG_CMAKE_SYSTEM_NAME)
if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_UWP)
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/lib/manual-link)
file(RENAME ${CURRENT_PACKAGES_DIR}/lib/SDL2main.lib ${CURRENT_PACKAGES_DIR}/lib/manual-link/SDL2main.lib)
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/lib/manual-link")
file(RENAME "${CURRENT_PACKAGES_DIR}/lib/SDL2main.lib" "${CURRENT_PACKAGES_DIR}/lib/manual-link/SDL2main.lib")
endif()
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/debug/lib/manual-link)
file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/SDL2maind.lib ${CURRENT_PACKAGES_DIR}/debug/lib/manual-link/SDL2maind.lib)
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/debug/lib/manual-link")
file(RENAME "${CURRENT_PACKAGES_DIR}/debug/lib/SDL2maind.lib" "${CURRENT_PACKAGES_DIR}/debug/lib/manual-link/SDL2maind.lib")
endif()
file(GLOB SHARE_FILES ${CURRENT_PACKAGES_DIR}/share/sdl2/*.cmake)
file(GLOB SHARE_FILES "${CURRENT_PACKAGES_DIR}/share/sdl2/*.cmake")
foreach(SHARE_FILE ${SHARE_FILES})
vcpkg_replace_string("${SHARE_FILE}" "lib/SDL2main" "lib/manual-link/SDL2main")
endforeach()
endif()
configure_file(${SOURCE_PATH}/LICENSE.txt ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright COPYONLY)
configure_file("${SOURCE_PATH}/LICENSE.txt" "${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright" COPYONLY)
vcpkg_copy_pdbs()
set(DYLIB_COMPATIBILITY_VERSION_REGEX "set\\(DYLIB_COMPATIBILITY_VERSION (.+)\\)")
@ -89,4 +96,4 @@ if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/sdl2.pc" "-lSDL2 " "-lSDL2d ")
endif()
vcpkg_fixup_pkgconfig()
vcpkg_fixup_pkgconfig()

View File

@ -1,12 +1,25 @@
{
"name": "sdl2",
"version": "2.0.16",
"port-version": 1,
"port-version": 2,
"description": "Simple DirectMedia Layer is a cross-platform development library designed to provide low level access to audio, keyboard, mouse, joystick, and graphics hardware via OpenGL and Direct3D.",
"homepage": "https://www.libsdl.org/download-2.0.php",
"dependencies": [
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
],
"features": {
"vulkan": {
"description": "Vulkan functionality for SDL"
},
"x11": {
"description": "Dynamically load X11 support"
}
}
}

View File

@ -2134,7 +2134,7 @@
},
"ffmpeg": {
"baseline": "4.4",
"port-version": 17
"port-version": 18
},
"ffnvcodec": {
"baseline": "11.1.5.0",
@ -2330,7 +2330,7 @@
},
"gamedev-framework": {
"baseline": "0.20.0",
"port-version": 0
"port-version": 1
},
"gamenetworkingsockets": {
"baseline": "1.3.0",
@ -5210,7 +5210,7 @@
},
"pixel": {
"baseline": "0.3",
"port-version": 2
"port-version": 3
},
"pixman": {
"baseline": "0.40.0",
@ -6118,7 +6118,7 @@
},
"sdl2": {
"baseline": "2.0.16",
"port-version": 1
"port-version": 2
},
"sdl2-gfx": {
"baseline": "1.0.4",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "fa1d927c640e5fc9abb088c7409e90057cd0b371",
"version": "4.4",
"port-version": 18
},
{
"git-tree": "795e31317ef58fbe13247af9e8bade71f3edde5e",
"version": "4.4",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "a9771cd4f7093f5d34a78d3e2417707185444910",
"version-semver": "0.20.0",
"port-version": 1
},
{
"git-tree": "195d4f41db9d03aa44fa6cc0d984668115a17718",
"version-semver": "0.20.0",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "57198090e451e125ad231a0a1068643cbd06cb61",
"version-string": "0.3",
"port-version": 3
},
{
"git-tree": "bd45dec4585e8be40088a7017dcce546a009748f",
"version-string": "0.3",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "120b4a3f60f1b2bfc0f20a7c20b5494fff8ea519",
"version": "2.0.16",
"port-version": 2
},
{
"git-tree": "f39203f93b1c068fca2dd7b7501891d8aca3b65d",
"version": "2.0.16",