early-access version 2853
This commit is contained in:
18
externals/vcpkg/ports/libflac/fix-compile-options.patch
vendored
Executable file
18
externals/vcpkg/ports/libflac/fix-compile-options.patch
vendored
Executable file
@@ -0,0 +1,18 @@
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index c83dd83..2d1a7e6 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -82,9 +82,11 @@ if(HAVE_WERROR_FLAG)
|
||||
option(ENABLE_WERROR "Enable -Werror in all Makefiles" OFF)
|
||||
endif()
|
||||
|
||||
+if(MSVC AND NOT WITH_ASM)
|
||||
+ add_compile_options(/wd4267 /wd4996)
|
||||
+endif()
|
||||
+
|
||||
add_compile_options(
|
||||
- $<$<BOOL:${MSVC}>:/wd4267>
|
||||
- $<$<BOOL:${MSVC}>:/wd4996>
|
||||
$<$<BOOL:${ENABLE_WERROR}>:-Werror>
|
||||
$<$<AND:$<COMPILE_LANGUAGE:CXX>,$<BOOL:${HAVE_WEFFCXX_FLAG}>>:-Weffc++>
|
||||
$<$<AND:$<COMPILE_LANGUAGE:C>,$<BOOL:${HAVE_DECL_AFTER_STMT_FLAG}>>:-Wdeclaration-after-statement>)
|
||||
86
externals/vcpkg/ports/libflac/portfile.cmake
vendored
Executable file
86
externals/vcpkg/ports/libflac/portfile.cmake
vendored
Executable file
@@ -0,0 +1,86 @@
|
||||
vcpkg_from_github(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO xiph/flac
|
||||
REF 1151c93e992bb8c7c6394e04aa880d711c531c7f #1.3.4
|
||||
SHA512 ebf8de3dbd8fc2153af2f4a05ecc04817570233c30e0ec1fbdbc99f810860801b951248ca6404152cba4038f5839985f4076bcee477c00fd23bd583a45b89b17
|
||||
HEAD_REF master
|
||||
PATCHES
|
||||
uwp-library-console.patch
|
||||
uwp-createfile2.patch
|
||||
fix-compile-options.patch
|
||||
)
|
||||
|
||||
if(VCPKG_TARGET_IS_MINGW)
|
||||
set(WITH_STACK_PROTECTOR OFF)
|
||||
string(APPEND VCPKG_C_FLAGS " -D_FORTIFY_SOURCE=0")
|
||||
string(APPEND VCPKG_CXX_FLAGS " -D_FORTIFY_SOURCE=0")
|
||||
else()
|
||||
set(WITH_STACK_PROTECTOR ON)
|
||||
endif()
|
||||
|
||||
if("asm" IN_LIST FEATURES)
|
||||
if(NOT VCPKG_TARGET_ARCHITECTURE STREQUAL x86)
|
||||
message(FATAL_ERROR "Feature asm only supports x86 architecture.")
|
||||
endif()
|
||||
|
||||
VCPKG_FIND_ACQUIRE_PROGRAM(NASM)
|
||||
GET_FILENAME_COMPONENT(NASM_PATH ${NASM} DIRECTORY)
|
||||
vcpkg_add_to_path("${NASM_PATH}")
|
||||
endif()
|
||||
|
||||
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
|
||||
FEATURES
|
||||
asm WITH_ASM
|
||||
)
|
||||
|
||||
vcpkg_cmake_configure(
|
||||
SOURCE_PATH "${SOURCE_PATH}"
|
||||
OPTIONS ${FEATURE_OPTIONS}
|
||||
-DBUILD_PROGRAMS=OFF
|
||||
-DBUILD_EXAMPLES=OFF
|
||||
-DBUILD_DOCS=OFF
|
||||
-DBUILD_TESTING=OFF
|
||||
-DWITH_STACK_PROTECTOR=${WITH_STACK_PROTECTOR})
|
||||
|
||||
vcpkg_cmake_install()
|
||||
|
||||
vcpkg_cmake_config_fixup(PACKAGE_NAME FLAC CONFIG_PATH share/FLAC/cmake)
|
||||
|
||||
vcpkg_copy_pdbs()
|
||||
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
|
||||
|
||||
if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
|
||||
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/FLAC/export.h"
|
||||
"#if defined(FLAC__NO_DLL)"
|
||||
"#if 0"
|
||||
)
|
||||
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/FLAC++/export.h"
|
||||
"#if defined(FLAC__NO_DLL)"
|
||||
"#if 0"
|
||||
)
|
||||
else()
|
||||
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/FLAC/export.h"
|
||||
"#if defined(FLAC__NO_DLL)"
|
||||
"#if 1"
|
||||
)
|
||||
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/FLAC++/export.h"
|
||||
"#if defined(FLAC__NO_DLL)"
|
||||
"#if 1"
|
||||
)
|
||||
endif()
|
||||
|
||||
if(VCPKG_TARGET_IS_WINDOWS)
|
||||
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/lib/pkgconfig/flac.pc" " -lm" "")
|
||||
|
||||
if(EXISTS "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/flac.pc")
|
||||
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/flac.pc" " -lm" "")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
vcpkg_fixup_pkgconfig()
|
||||
|
||||
# This license (BSD) is relevant only for library - if someone would want to install
|
||||
# FLAC cmd line tools as well additional license (GPL) should be included
|
||||
file(INSTALL "${SOURCE_PATH}/COPYING.Xiph" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
|
||||
40
externals/vcpkg/ports/libflac/uwp-createfile2.patch
vendored
Executable file
40
externals/vcpkg/ports/libflac/uwp-createfile2.patch
vendored
Executable file
@@ -0,0 +1,40 @@
|
||||
diff --git a/src/share/win_utf8_io/win_utf8_io.c b/src/share/win_utf8_io/win_utf8_io.c
|
||||
index 8b20bbb7..058295fa 100644
|
||||
--- a/src/share/win_utf8_io/win_utf8_io.c
|
||||
+++ b/src/share/win_utf8_io/win_utf8_io.c
|
||||
@@ -156,6 +156,27 @@ int get_utf8_argv(int *argc, char ***argv)
|
||||
/* similar to CreateFileW but accepts UTF-8 encoded lpFileName */
|
||||
HANDLE WINAPI CreateFile_utf8(const char *lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile)
|
||||
{
|
||||
+#if defined (WINAPI_FAMILY_PARTITION) && !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM)
|
||||
+ HANDLE handle = INVALID_HANDLE_VALUE;
|
||||
+
|
||||
+ if (!flac_internal_get_utf8_filenames())
|
||||
+ return handle;
|
||||
+
|
||||
+ wchar_t *wname;
|
||||
+
|
||||
+ if ((wname = wchar_from_utf8(lpFileName)) != NULL)
|
||||
+ {
|
||||
+ CREATEFILE2_EXTENDED_PARAMETERS cfParams = {0};
|
||||
+ cfParams.dwSize = sizeof(CREATEFILE2_EXTENDED_PARAMETERS);
|
||||
+ cfParams.dwFileAttributes = dwFlagsAndAttributes & FILE_ATTRIBUTE_NORMAL;
|
||||
+ cfParams.lpSecurityAttributes = lpSecurityAttributes;
|
||||
+ cfParams.hTemplateFile = hTemplateFile;
|
||||
+ handle = CreateFile2(wname, dwDesiredAccess, dwShareMode, dwCreationDisposition, &cfParams);
|
||||
+ free(wname);
|
||||
+ }
|
||||
+
|
||||
+ return handle;
|
||||
+#else
|
||||
if (!flac_internal_get_utf8_filenames()) {
|
||||
return CreateFileA(lpFileName, dwDesiredAccess, dwShareMode, lpSecurityAttributes, dwCreationDisposition, dwFlagsAndAttributes, hTemplateFile);
|
||||
} else {
|
||||
@@ -169,6 +190,7 @@ HANDLE WINAPI CreateFile_utf8(const char *lpFileName, DWORD dwDesiredAccess, DWO
|
||||
|
||||
return handle;
|
||||
}
|
||||
+#endif
|
||||
}
|
||||
|
||||
/* return number of characters in the UTF-8 string */
|
||||
53
externals/vcpkg/ports/libflac/uwp-library-console.patch
vendored
Executable file
53
externals/vcpkg/ports/libflac/uwp-library-console.patch
vendored
Executable file
@@ -0,0 +1,53 @@
|
||||
diff --git a/src/share/win_utf8_io/win_utf8_io.c b/src/share/win_utf8_io/win_utf8_io.c
|
||||
index bbb6a74a..8b20bbb7 100644
|
||||
--- a/src/share/win_utf8_io/win_utf8_io.c
|
||||
+++ b/src/share/win_utf8_io/win_utf8_io.c
|
||||
@@ -110,7 +110,11 @@ int get_utf8_argv(int *argc, char ***argv)
|
||||
char **utf8argv;
|
||||
int ret, i;
|
||||
|
||||
+#if defined (WINAPI_FAMILY_PARTITION) && !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM)
|
||||
+ if ((handle = LoadPackagedLibrary("msvcrt.dll", 0)) == NULL) return 1;
|
||||
+#else
|
||||
if ((handle = LoadLibraryW(L"msvcrt.dll")) == NULL) return 1;
|
||||
+#endif
|
||||
if ((wgetmainargs = (wgetmainargs_t)GetProcAddress(handle, "__wgetmainargs")) == NULL) {
|
||||
FreeLibrary(handle);
|
||||
return 1;
|
||||
@@ -181,6 +185,9 @@ size_t strlen_utf8(const char *str)
|
||||
/* get the console width in characters */
|
||||
int win_get_console_width(void)
|
||||
{
|
||||
+#if defined (WINAPI_FAMILY_PARTITION) && !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM)
|
||||
+ return 80;
|
||||
+#else
|
||||
int width = 80;
|
||||
CONSOLE_SCREEN_BUFFER_INFO csbi;
|
||||
HANDLE hOut = GetStdHandle(STD_OUTPUT_HANDLE);
|
||||
@@ -188,6 +195,7 @@ int win_get_console_width(void)
|
||||
if (GetConsoleScreenBufferInfo(hOut, &csbi) != 0)
|
||||
width = csbi.dwSize.X;
|
||||
return width;
|
||||
+#endif
|
||||
}
|
||||
|
||||
/* print functions */
|
||||
@@ -197,6 +205,10 @@ static int wprint_console(FILE *stream, const wchar_t *text, size_t len)
|
||||
DWORD out;
|
||||
int ret;
|
||||
|
||||
+#if defined (WINAPI_FAMILY_PARTITION) && !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP | WINAPI_PARTITION_SYSTEM)
|
||||
+ // disabled for UWP as there's no alternative:
|
||||
+ // https://docs.microsoft.com/en-us/uwp/win32-and-com/alternatives-to-windows-apis-uwp
|
||||
+#else
|
||||
do {
|
||||
if (stream == stdout) {
|
||||
HANDLE hOut = GetStdHandle(STD_OUTPUT_HANDLE);
|
||||
@@ -215,6 +227,7 @@ static int wprint_console(FILE *stream, const wchar_t *text, size_t len)
|
||||
return out;
|
||||
}
|
||||
} while(0);
|
||||
+#endif
|
||||
|
||||
ret = fputws(text, stream);
|
||||
if (ret < 0)
|
||||
23
externals/vcpkg/ports/libflac/vcpkg.json
vendored
Executable file
23
externals/vcpkg/ports/libflac/vcpkg.json
vendored
Executable file
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"name": "libflac",
|
||||
"version": "1.3.4",
|
||||
"description": "Library for manipulating FLAC files",
|
||||
"homepage": "https://xiph.org/flac/",
|
||||
"license": "GFDL-1.2-or-later",
|
||||
"dependencies": [
|
||||
"libogg",
|
||||
{
|
||||
"name": "vcpkg-cmake",
|
||||
"host": true
|
||||
},
|
||||
{
|
||||
"name": "vcpkg-cmake-config",
|
||||
"host": true
|
||||
}
|
||||
],
|
||||
"features": {
|
||||
"asm": {
|
||||
"description": "Use any assembly optimization routines"
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user