2018-10-25 13:57:39 -05:00
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO SDL-Mirror/SDL
|
|
|
|
REF release-1.2.15
|
|
|
|
SHA512 38b94a650ec205377ae1503d0ec8a5254ef6d50ed0acac8d985b57b64bc16ea042cfa41e19e5ef8317980c4afb83186829f5bc3da9433d0a649dfd10554801b5
|
|
|
|
HEAD_REF master
|
2019-09-12 01:42:07 +08:00
|
|
|
PATCHES
|
|
|
|
export-symbols-only-in-shared-build.patch
|
|
|
|
fix-linux-build.patch
|
2022-06-08 23:30:48 +02:00
|
|
|
sdl-config.patch
|
2018-10-25 13:57:39 -05:00
|
|
|
)
|
|
|
|
|
2022-06-08 23:30:48 +02:00
|
|
|
configure_file("${SOURCE_PATH}/include/SDL_config.h.default" "${SOURCE_PATH}/include/SDL_config.h" COPYONLY)
|
2018-10-25 13:57:39 -05:00
|
|
|
|
2022-06-08 23:30:48 +02:00
|
|
|
if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW)
|
2023-05-30 21:52:52 +03:00
|
|
|
configure_file("${CURRENT_PORT_DIR}/SDL1_2017.sln.in" "${SOURCE_PATH}/VisualC/SDL1_2017.sln" COPYONLY)
|
|
|
|
|
2019-09-12 01:42:07 +08:00
|
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
|
2022-01-25 00:08:18 +01:00
|
|
|
set(LIB_TYPE StaticLibrary)
|
2019-09-12 01:42:07 +08:00
|
|
|
else()
|
2020-12-26 23:22:21 -07:00
|
|
|
set(LIB_TYPE DynamicLibrary)
|
2019-09-12 01:42:07 +08:00
|
|
|
endif()
|
2023-05-30 21:52:52 +03:00
|
|
|
|
2022-06-08 23:30:48 +02:00
|
|
|
if(VCPKG_CRT_LINKAGE STREQUAL "dynamic")
|
2020-12-26 23:22:21 -07:00
|
|
|
set(CRT_TYPE_DBG MultiThreadedDebugDLL)
|
|
|
|
set(CRT_TYPE_REL MultiThreadedDLL)
|
|
|
|
else()
|
|
|
|
set(CRT_TYPE_DBG MultiThreadedDebug)
|
|
|
|
set(CRT_TYPE_REL MultiThreaded)
|
|
|
|
endif()
|
2023-05-30 21:52:52 +03:00
|
|
|
|
2022-06-08 23:30:48 +02:00
|
|
|
configure_file("${CURRENT_PORT_DIR}/SDL.vcxproj.in" "${SOURCE_PATH}/VisualC/SDL/SDL.vcxproj" @ONLY)
|
|
|
|
configure_file("${CURRENT_PORT_DIR}/SDLmain.vcxproj.in" "${SOURCE_PATH}/VisualC/SDLmain/SDLmain.vcxproj" @ONLY)
|
2023-05-30 21:52:52 +03:00
|
|
|
|
|
|
|
# This text file gets copied as a library, and included as one in the package
|
2022-06-08 23:30:48 +02:00
|
|
|
file(REMOVE_RECURSE "${SOURCE_PATH}/src/hermes/COPYING.LIB")
|
2023-05-30 21:52:52 +03:00
|
|
|
|
2019-09-12 01:42:07 +08:00
|
|
|
vcpkg_install_msbuild(
|
2022-06-08 23:30:48 +02:00
|
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
2019-09-12 01:42:07 +08:00
|
|
|
PROJECT_SUBPATH VisualC/SDL1_2017.sln
|
|
|
|
INCLUDES_SUBPATH include
|
|
|
|
LICENSE_SUBPATH COPYING
|
|
|
|
ALLOW_ROOT_INCLUDES
|
|
|
|
)
|
2023-05-30 21:52:52 +03:00
|
|
|
|
2019-09-12 01:42:07 +08:00
|
|
|
#Take all the fils into include/SDL to sovle conflict with SDL2 port
|
2022-06-08 23:30:48 +02:00
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/include/doxyfile")
|
|
|
|
file(RENAME "${CURRENT_PACKAGES_DIR}/include" "${CURRENT_PACKAGES_DIR}/include.tmp")
|
|
|
|
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/include")
|
|
|
|
file(RENAME "${CURRENT_PACKAGES_DIR}/include.tmp" "${CURRENT_PACKAGES_DIR}/include/SDL")
|
2023-05-30 21:52:52 +03:00
|
|
|
|
2022-06-08 23:30:48 +02:00
|
|
|
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/lib/manual-link")
|
|
|
|
file(RENAME "${CURRENT_PACKAGES_DIR}/lib/SDLmain.lib" "${CURRENT_PACKAGES_DIR}/lib/manual-link/SDLmain.lib")
|
|
|
|
if(NOT DEFINED VCPKG_BUILD_TYPE)
|
|
|
|
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/debug/lib/manual-link")
|
|
|
|
file(RENAME "${CURRENT_PACKAGES_DIR}/debug/lib/SDLmain.lib" "${CURRENT_PACKAGES_DIR}/debug/lib/manual-link/SDLmaind.lib")
|
2019-09-12 01:42:07 +08:00
|
|
|
endif()
|
2019-08-02 08:54:45 +08:00
|
|
|
else()
|
2022-06-08 23:30:48 +02:00
|
|
|
if(VCPKG_TARGET_IS_LINUX)
|
|
|
|
message("libgles2-mesa-dev must be installed before sdl1 can build. Install it with \"apt install libgles2-mesa-dev\".")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
find_program(WHICH_COMMAND NAMES which)
|
|
|
|
if(NOT WHICH_COMMAND)
|
|
|
|
set(polyfill_scripts "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-bin")
|
|
|
|
file(REMOVE_RECURSE "${polyfill_scripts}")
|
|
|
|
file(MAKE_DIRECTORY "${polyfill_scripts}")
|
|
|
|
vcpkg_host_path_list(APPEND ENV{PATH} "${polyfill_scripts}")
|
|
|
|
# sdl's autoreconf.sh needs `which`, but our msys root doesn't have it.
|
|
|
|
file(WRITE "${polyfill_scripts}/which" "#!/bin/sh\nif test -f \"/usr/bin/\$1\"; then echo \"/usr/bin/\$1\"; else false; fi\n")
|
|
|
|
file(CHMOD "${polyfill_scripts}/which" PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE)
|
|
|
|
endif()
|
2019-04-02 19:48:36 +02:00
|
|
|
|
2020-01-10 06:39:10 +08:00
|
|
|
vcpkg_configure_make(
|
2022-06-08 23:30:48 +02:00
|
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
2019-09-12 01:42:07 +08:00
|
|
|
)
|
2023-05-30 21:52:52 +03:00
|
|
|
|
2020-01-10 06:39:10 +08:00
|
|
|
vcpkg_install_make()
|
2022-06-08 23:30:48 +02:00
|
|
|
vcpkg_fixup_pkgconfig()
|
2023-05-30 21:52:52 +03:00
|
|
|
|
2022-06-08 23:30:48 +02:00
|
|
|
file(REMOVE_RECURSE
|
|
|
|
"${CURRENT_PACKAGES_DIR}/debug/share"
|
|
|
|
"${CURRENT_PACKAGES_DIR}/share/${PORT}/man3"
|
|
|
|
)
|
2022-01-25 00:08:18 +01:00
|
|
|
|
2022-06-08 23:30:48 +02:00
|
|
|
file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
|
|
|
|
endif()
|