aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/sdl2-net
diff options
context:
space:
mode:
authorEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
committerEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
commit54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch)
treed915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/sdl2-net
move to own git serverHEADmaster
Diffstat (limited to 'vcpkg/ports/sdl2-net')
-rw-r--r--vcpkg/ports/sdl2-net/fix-uwp.patch13
-rw-r--r--vcpkg/ports/sdl2-net/portfile.cmake34
-rw-r--r--vcpkg/ports/sdl2-net/usage4
-rw-r--r--vcpkg/ports/sdl2-net/vcpkg.json22
4 files changed, 73 insertions, 0 deletions
diff --git a/vcpkg/ports/sdl2-net/fix-uwp.patch b/vcpkg/ports/sdl2-net/fix-uwp.patch
new file mode 100644
index 0000000..79f4c07
--- /dev/null
+++ b/vcpkg/ports/sdl2-net/fix-uwp.patch
@@ -0,0 +1,13 @@
+diff --git a/SDLnetUDP.c b/SDLnetUDP.c
+index ee4e46b..dc9b4b0 100644
+--- a/SDLnetUDP.c
++++ b/SDLnetUDP.c
+@@ -22,7 +22,7 @@
+ #include "SDLnetsys.h"
+ #include "SDL_net.h"
+
+-#if defined(__WIN32__) || defined(__OS2__)
++#if defined(_WIN32) || defined(__OS2__)
+ #define srandom srand
+ #define random rand
+ #endif
diff --git a/vcpkg/ports/sdl2-net/portfile.cmake b/vcpkg/ports/sdl2-net/portfile.cmake
new file mode 100644
index 0000000..eac8545
--- /dev/null
+++ b/vcpkg/ports/sdl2-net/portfile.cmake
@@ -0,0 +1,34 @@
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO libsdl-org/SDL_net
+ REF 669e75b84632e2c6cc5c65974ec9e28052cb7a4e # release-2.2.0
+ SHA512 180c757d704c72dc7fcc392c13942214c87b90de22e32045ec9eb6cde5da2b762516e14120d8bee52f7f4a59ad8e30d4f71e313918432ae07ef71df8e9380e4b
+ HEAD_REF main
+ PATCHES
+ fix-uwp.patch
+)
+
+vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}"
+ OPTIONS
+ -DSDL2NET_SAMPLES=OFF
+)
+
+vcpkg_cmake_install()
+
+if(EXISTS "${CURRENT_PACKAGES_DIR}/cmake")
+ vcpkg_cmake_config_fixup(PACKAGE_NAME SDL2_net CONFIG_PATH cmake)
+else()
+ vcpkg_cmake_config_fixup(PACKAGE_NAME SDL2_net CONFIG_PATH lib/cmake/SDL2_net)
+endif()
+
+vcpkg_copy_pdbs()
+
+file(REMOVE_RECURSE
+ "${CURRENT_PACKAGES_DIR}/debug/share"
+ "${CURRENT_PACKAGES_DIR}/debug/include"
+ "${CURRENT_PACKAGES_DIR}/lib/pkgconfig"
+)
+
+file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
+vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE.txt")
diff --git a/vcpkg/ports/sdl2-net/usage b/vcpkg/ports/sdl2-net/usage
new file mode 100644
index 0000000..f08bbc7
--- /dev/null
+++ b/vcpkg/ports/sdl2-net/usage
@@ -0,0 +1,4 @@
+sdl2-net provides CMake targets:
+
+ find_package(SDL2_net CONFIG REQUIRED)
+ target_link_libraries(main PRIVATE $<IF:$<TARGET_EXISTS:SDL2_net::SDL2_net>,SDL2_net::SDL2_net,SDL2_net::SDL2_net-static>)
diff --git a/vcpkg/ports/sdl2-net/vcpkg.json b/vcpkg/ports/sdl2-net/vcpkg.json
new file mode 100644
index 0000000..72a7076
--- /dev/null
+++ b/vcpkg/ports/sdl2-net/vcpkg.json
@@ -0,0 +1,22 @@
+{
+ "name": "sdl2-net",
+ "version": "2.2.0",
+ "port-version": 3,
+ "description": "Networking library for SDL",
+ "homepage": "https://github.com/libsdl-org/SDL_net",
+ "license": "Zlib",
+ "dependencies": [
+ {
+ "name": "sdl2",
+ "default-features": false
+ },
+ {
+ "name": "vcpkg-cmake",
+ "host": true
+ },
+ {
+ "name": "vcpkg-cmake-config",
+ "host": true
+ }
+ ]
+}