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

Update dependencies #3900

Merged
merged 10 commits into from
Jun 21, 2024
Merged
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
27 changes: 27 additions & 0 deletions .ci/vcpkg/overlay-ports/libiconv/0002-Config-for-MSVC.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
diff --git "a/lib/loop_wchar.h" "b/lib/loop_wchar.h"
index 6dc011b..158ccdd 100644
--- "a/lib/loop_wchar.h"
+++ "b/lib/loop_wchar.h"
@@ -37,7 +37,7 @@
# include <wchar.h>
# define BUF_SIZE 64 /* assume MB_LEN_MAX <= 64 */
/* Some systems, like BeOS, have multibyte encodings but lack mbstate_t. */
- extern size_t mbrtowc ();
+// extern size_t mbrtowc ();
# ifdef mbstate_t
# define mbrtowc(pwc, s, n, ps) (mbrtowc)(pwc, s, n, 0)
# define mbsinit(ps) 1
diff --git a/srclib/fcntl.c b/srclib/fcntl.c
index f9753c4..02fc8be 100644
--- a/srclib/fcntl.c
+++ b/srclib/fcntl.c
@@ -37,6 +37,9 @@
/* Get declarations of the native Windows API functions. */
# define WIN32_LEAN_AND_MEAN
# include <windows.h>
+#if defined(WINAPI_FAMILY) && (WINAPI_FAMILY == WINAPI_FAMILY_APP)
+#define HANDLE_FLAG_INHERIT 0
+#endif

/* Get _get_osfhandle. */
# if GNULIB_MSVC_NOTHROW
12 changes: 12 additions & 0 deletions .ci/vcpkg/overlay-ports/libiconv/0003-Add-export.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff -uNr libiconv-1.16/libcharset/include/libcharset.h.in libiconv-1.16-work/libcharset/include/libcharset.h.in
--- libiconv-1.16/libcharset/include/libcharset.h.in 2018-09-17 19:07:42.000000000 +0300
+++ libiconv-1.16-work/libcharset/include/libcharset.h.in 2019-12-04 17:15:50.000000000 +0300
@@ -33,7 +33,7 @@
by the corresponding pathname with the current prefix instead. Both
prefixes should be directory names without trailing slash (i.e. use ""
instead of "/"). */
-extern void libcharset_set_relocation_prefix (const char *orig_prefix,
+extern void LIBCHARSET_DLL_EXPORTED libcharset_set_relocation_prefix (const char *orig_prefix,
const char *curr_prefix);


13 changes: 13 additions & 0 deletions .ci/vcpkg/overlay-ports/libiconv/0004-ModuleFileName.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/lib/relocatable.c b/lib/relocatable.c
index 89b6c27..1561894 100644
--- a/lib/relocatable.c
+++ b/lib/relocatable.c
@@ -329,7 +329,7 @@ DllMain (HINSTANCE module_handle, DWORD event, LPVOID reserved)
/* The DLL is being loaded into an application's address range. */
static char location[MAX_PATH];

- if (!GetModuleFileName (module_handle, location, sizeof (location)))
+ if (!GetModuleFileNameA (module_handle, location, sizeof (location)))
/* Shouldn't happen. */
return FALSE;

64 changes: 64 additions & 0 deletions .ci/vcpkg/overlay-ports/libiconv/clang-fortify.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
diff --git a/srclib/cdefs.h b/srclib/cdefs.h
index 7b8ed5b..63574f9 100644
--- a/srclib/cdefs.h
+++ b/srclib/cdefs.h
@@ -140,6 +140,7 @@
#endif


+#ifndef __GNULIB_CDEFS
/* Fortify support. */
#define __bos(ptr) __builtin_object_size (ptr, __USE_FORTIFY_LEVEL > 1)
#define __bos0(ptr) __builtin_object_size (ptr, 0)
@@ -201,6 +202,8 @@
? __ ## f ## _chk_warn (__VA_ARGS__, (__osz) / (__s)) \
: __ ## f ## _chk (__VA_ARGS__, (__osz) / (__s)))) \

+#endif
+
#if __GNUC_PREREQ (4,3)
# define __warnattr(msg) __attribute__((__warning__ (msg)))
# define __errordecl(name, msg) \
diff --git a/srclib/libc-config.h b/srclib/libc-config.h
index a56665b..876e1a1 100644
--- a/srclib/libc-config.h
+++ b/srclib/libc-config.h
@@ -137,8 +137,10 @@
# undef __attribute_returns_twice__
# undef __attribute_used__
# undef __attribute_warn_unused_result__
+# ifndef __GNULIB_CDEFS
# undef __bos
# undef __bos0
+# endif
# undef __errordecl
# undef __extension__
# undef __extern_always_inline
@@ -147,21 +149,27 @@
# undef __fortified_attr_access
# undef __fortify_function
# undef __glibc_c99_flexarr_available
+# ifndef __GNULIB_CDEFS
# undef __glibc_fortify
# undef __glibc_fortify_n
+# endif
# undef __glibc_has_attribute
# undef __glibc_has_builtin
# undef __glibc_has_extension
# undef __glibc_likely
# undef __glibc_macro_warning
# undef __glibc_macro_warning1
+# ifndef __GNULIB_CDEFS
# undef __glibc_objsize
# undef __glibc_objsize0
# undef __glibc_safe_len_cond
# undef __glibc_safe_or_unknown_len
+# endif
# undef __glibc_unlikely
+# ifndef __GNULIB_CDEFS
# undef __glibc_unsafe_len
# undef __glibc_unsigned_or_positive
+# endif
# undef __inline
# undef __ptr_t
# undef __restrict
59 changes: 59 additions & 0 deletions .ci/vcpkg/overlay-ports/libiconv/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
if(NOT VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_ANDROID AND NOT VCPKG_TARGET_IS_IOS AND NOT VCPKG_TARGET_IS_OSX)
set(VCPKG_POLICY_EMPTY_PACKAGE enabled)
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/share/iconv")
file(COPY "${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/iconv")
return()
endif()

vcpkg_download_distfile(ARCHIVE
URLS "https://ftp.gnu.org/gnu/libiconv/libiconv-${VERSION}.tar.gz"
"https://www.mirrorservice.org/sites/ftp.gnu.org/gnu/libiconv/libiconv-${VERSION}.tar.gz"
FILENAME "libiconv-${VERSION}.tar.gz"
SHA512 18a09de2d026da4f2d8b858517b0f26d853b21179cf4fa9a41070b2d140030ad9525637dc4f34fc7f27abca8acdc84c6751dfb1d426e78bf92af4040603ced86
)
vcpkg_extract_source_archive(SOURCE_PATH
ARCHIVE "${ARCHIVE}"
SOURCE_BASE "v${VERSION}"
PATCHES
0002-Config-for-MSVC.patch
0003-Add-export.patch
0004-ModuleFileName.patch
clang-fortify.patch # ported from https://git.savannah.gnu.org/cgit/gnulib.git/commit/?id=522aea1093a598246346b3e1c426505c344fe19a
)

vcpkg_list(SET OPTIONS)
if (NOT VCPKG_TARGET_IS_ANDROID)
vcpkg_list(APPEND OPTIONS --enable-relocatable)
endif()

vcpkg_configure_make(
SOURCE_PATH "${SOURCE_PATH}"
DETERMINE_BUILD_TRIPLET
USE_WRAPPERS
OPTIONS
--enable-extra-encodings
--without-libiconv-prefix
--without-libintl-prefix
${OPTIONS}
)
vcpkg_install_make()

vcpkg_copy_pdbs()
vcpkg_copy_tool_dependencies("${CURRENT_PACKAGES_DIR}/tools/${PORT}/bin")
vcpkg_copy_tool_dependencies("${CURRENT_PACKAGES_DIR}/tools/${PORT}/debug/bin")

file(COPY "${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/iconv")

set(VCPKG_POLICY_ALLOW_RESTRICTED_HEADERS enabled)
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/share/${PORT}") # share contains unneeded doc files

# Please keep, the default usage is broken
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")

# Handle copyright
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING.LIB" "${SOURCE_PATH}/COPYING" COMMENT "
The libiconv and libcharset libraries and their header files are under LGPL,
see COPYING.LIB below.

The iconv program and the documentation are under GPL, see COPYING below.")
4 changes: 4 additions & 0 deletions .ci/vcpkg/overlay-ports/libiconv/usage
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
The package libiconv provides CMake targets:

find_package(Iconv)
target_link_libraries(main PRIVATE Iconv::Iconv)
21 changes: 21 additions & 0 deletions .ci/vcpkg/overlay-ports/libiconv/vcpkg-cmake-wrapper.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
include(SelectLibraryConfigurations)

_find_package(${ARGS})
if(Iconv_FOUND AND NOT Iconv_IS_BUILT_IN)
find_path(CHARSET_INCLUDE_DIR NAMES "libcharset.h" HINTS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include")
find_library(CHARSET_LIBRARY_DEBUG NAMES charsetd libcharsetd charset libcharset NAMES_PER_DIR PATH_SUFFIXES lib HINTS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug")
find_library(CHARSET_LIBRARY_RELEASE NAMES charset libcharset NAMES_PER_DIR PATH_SUFFIXES lib HINTS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}")
select_library_configurations(CHARSET)
if(NOT TARGET Iconv::Charset)
add_library(Iconv::Charset INTERFACE IMPORTED)
set_target_properties(Iconv::Charset PROPERTIES
INTERFACE_LINK_LIBRARIES "\$<\$<NOT:\$<CONFIG:DEBUG>>:${CHARSET_LIBRARY_RELEASE}>;\$<\$<CONFIG:DEBUG>:${CHARSET_LIBRARY_DEBUG}>"
INTERFACE_INCLUDE_DIRECTORIES "${CHARSET_INCLUDE_DIRS}")
endif()
if(CHARSET_LIBRARIES)
list(APPEND Iconv_LIBRARIES ${CHARSET_LIBRARIES})
if(TARGET Iconv::Iconv)
set_property(TARGET Iconv::Iconv APPEND PROPERTY INTERFACE_LINK_LIBRARIES Iconv::Charset)
endif()
endif()
endif()
8 changes: 8 additions & 0 deletions .ci/vcpkg/overlay-ports/libiconv/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "libiconv",
"version": "1.17",
"port-version": 4,
"description": "GNU Unicode text conversion",
"homepage": "https://www.gnu.org/software/libiconv/",
"license": null
}
78 changes: 0 additions & 78 deletions .ci/vcpkg/overlay-ports/libsodium/portfile.cmake

This file was deleted.

32 changes: 0 additions & 32 deletions .ci/vcpkg/overlay-ports/libsodium/sodiumConfig.cmake.in

This file was deleted.

14 changes: 0 additions & 14 deletions .ci/vcpkg/overlay-ports/libsodium/vcpkg.json

This file was deleted.

2 changes: 1 addition & 1 deletion .ci/vcpkg/overlay-ports/sdl2/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO libsdl-org/SDL
REF "release-${VERSION}"
SHA512 3a7c6c0515205338a023ada230128e658f4ecff3ccd371d33cd9bb82eb4992db972241faf44f325f7d536c7dedb0a02ee1574b7a84ba3c9856cae9e6d25bdbdc
SHA512 fa762df4eb5e57bee272b27dbbeca342e2db60cd2fee74e89e1a2d1f71a07681eeb5dfa68888f6cceb73b551e2b4b8ebcc55c87ed1236dffd59d21207979caf7
HEAD_REF main
PATCHES
deps.patch
Expand Down
2 changes: 1 addition & 1 deletion .ci/vcpkg/overlay-ports/sdl2/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sdl2",
"version": "2.30.3",
"version": "2.30.4",
"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",
"license": "Zlib",
Expand Down
Loading
Loading