[libflac] Update libflac to 1.3.3 (#8988)

* [libflac] Update libflac to 1.3.3

* Update portfile.cmake
This commit is contained in:
Michał Janiszewski 2019-11-22 02:03:32 +01:00 committed by Robert Schumacher
parent 8c17d3c790
commit bfaf18478f
4 changed files with 62 additions and 68 deletions

View File

@ -1,5 +1,5 @@
Source: libflac
Version: 1.3.2-6
Homepage: https://xiph.org/flac/
Description: Library for manipulating FLAC files
Build-Depends: libogg
Source: libflac
Version: 1.3.3
Homepage: https://xiph.org/flac/
Description: Library for manipulating FLAC files
Build-Depends: libogg

View File

@ -1,47 +1,39 @@
include(vcpkg_common_functions)
vcpkg_download_distfile(FLAC_MAX_MIN_PATCH
URLS "https://github.com/xiph/flac/commit/64f47c2d71ffba5aa8cd1d2a447339fd95f362f9.patch"
FILENAME "flac-max-min.patch"
SHA512 7ce9ccf9f081b478664cccd677c10269567672a8aa3a60839ef203b3d0a626d2b2c2f34d4c7fc897c31a436d7c22fb740bca5449a465dab39d60655417fe7772)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO xiph/flac
REF 1.3.2
SHA512 d0e177cadee371940516864bf72e1eb3d101a5f2779c854ecb8a3361a654a9b9e7efd303c83e2f308bacc7e54298d37705f677e2b955d4a9fe3470c364fa45f3
HEAD_REF master
PATCHES
"${FLAC_MAX_MIN_PATCH}"
"${CMAKE_CURRENT_LIST_DIR}/uwp-library-console.patch"
"${CMAKE_CURRENT_LIST_DIR}/uwp-createfile2.patch"
)
if(VCPKG_TARGET_ARCHITECTURE STREQUAL x86)
vcpkg_find_acquire_program(NASM)
get_filename_component(NASM_EXE_PATH ${NASM} DIRECTORY)
set(ENV{PATH} "$ENV{PATH};${NASM_EXE_PATH}")
endif()
file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS
-DLIBFLAC_ARCHITECTURE=${VCPKG_TARGET_ARCHITECTURE}
OPTIONS_DEBUG
-DLIBFLAC_SKIP_HEADERS=ON)
vcpkg_install_cmake()
vcpkg_copy_pdbs()
if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
file(APPEND ${CURRENT_PACKAGES_DIR}/include/FLAC/export.h "#undef FLAC_API\n#define FLAC_API\n")
file(APPEND ${CURRENT_PACKAGES_DIR}/include/FLAC++/export.h "#undef FLACPP_API\n#define FLACPP_API\n")
endif()
# 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(COPY ${SOURCE_PATH}/COPYING.Xiph DESTINATION ${CURRENT_PACKAGES_DIR}/share/libflac)
file(RENAME ${CURRENT_PACKAGES_DIR}/share/libflac/COPYING.Xiph ${CURRENT_PACKAGES_DIR}/share/libflac/copyright)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO xiph/flac
REF 1.3.3
SHA512 4644dc8fd45e775d0e6210de2b082996692675307a7b7d359827730cc4cede9c2e1df46f4386023d83da9bafa6b3218d24012bf532f459087e311f14863747ec
HEAD_REF master
PATCHES
"${CMAKE_CURRENT_LIST_DIR}/uwp-library-console.patch"
"${CMAKE_CURRENT_LIST_DIR}/uwp-createfile2.patch"
)
if(VCPKG_TARGET_ARCHITECTURE STREQUAL x86)
vcpkg_find_acquire_program(NASM)
get_filename_component(NASM_EXE_PATH ${NASM} DIRECTORY)
set(ENV{PATH} "$ENV{PATH};${NASM_EXE_PATH}")
endif()
file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS
-DLIBFLAC_ARCHITECTURE=${VCPKG_TARGET_ARCHITECTURE}
OPTIONS_DEBUG
-DLIBFLAC_SKIP_HEADERS=ON)
vcpkg_install_cmake()
vcpkg_copy_pdbs()
if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
file(APPEND ${CURRENT_PACKAGES_DIR}/include/FLAC/export.h "#undef FLAC_API\n#define FLAC_API\n")
file(APPEND ${CURRENT_PACKAGES_DIR}/include/FLAC++/export.h "#undef FLACPP_API\n#define FLACPP_API\n")
endif()
# 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(COPY ${SOURCE_PATH}/COPYING.Xiph DESTINATION ${CURRENT_PACKAGES_DIR}/share/libflac)
file(RENAME ${CURRENT_PACKAGES_DIR}/share/libflac/COPYING.Xiph ${CURRENT_PACKAGES_DIR}/share/libflac/copyright)

View File

@ -1,15 +1,15 @@
diff --git a/src/libFLAC/windows_unicode_filenames.c b/src/libFLAC/windows_unicode_filenames.c
index 2404e31..d320bf5 100644
--- a/src/libFLAC/windows_unicode_filenames.c
+++ b/src/libFLAC/windows_unicode_filenames.c
@@ -185,6 +185,27 @@ int flac_internal_rename_utf8(const char *oldname, const char *newname)
HANDLE WINAPI flac_internal_CreateFile_utf8(const char *lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile)
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 (!utf8_filenames)
+ if (!flac_internal_get_utf8_filenames())
+ return handle;
+
+ wchar_t *wname;
@ -27,12 +27,14 @@ index 2404e31..d320bf5 100644
+
+ return handle;
+#else
if (!utf8_filenames) {
if (!flac_internal_get_utf8_filenames()) {
return CreateFileA(lpFileName, dwDesiredAccess, dwShareMode, lpSecurityAttributes, dwCreationDisposition, dwFlagsAndAttributes, hTemplateFile);
} else {
@@ -198,4 +219,5 @@ HANDLE WINAPI flac_internal_CreateFile_utf8(const char *lpFileName, DWORD dwDesi
@@ -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 */

View File

@ -1,5 +1,5 @@
diff --git a/src/share/win_utf8_io/win_utf8_io.c b/src/share/win_utf8_io/win_utf8_io.c
index c61d27f..0870054 100644
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)
@ -9,12 +9,12 @@ index c61d27f..0870054 100644
+#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 = LoadLibrary("msvcrt.dll")) == NULL) return 1;
if ((handle = LoadLibraryW(L"msvcrt.dll")) == NULL) return 1;
+#endif
if ((wgetmainargs = (wgetmainargs_t)GetProcAddress(handle, "__wgetmainargs")) == NULL) {
FreeLibrary(handle);
return 1;
@@ -163,6 +167,9 @@ size_t strlen_utf8(const char *str)
@@ -181,6 +185,9 @@ size_t strlen_utf8(const char *str)
/* get the console width in characters */
int win_get_console_width(void)
{
@ -24,7 +24,7 @@ index c61d27f..0870054 100644
int width = 80;
CONSOLE_SCREEN_BUFFER_INFO csbi;
HANDLE hOut = GetStdHandle(STD_OUTPUT_HANDLE);
@@ -170,6 +177,7 @@ int win_get_console_width(void)
@@ -188,6 +195,7 @@ int win_get_console_width(void)
if (GetConsoleScreenBufferInfo(hOut, &csbi) != 0)
width = csbi.dwSize.X;
return width;
@ -32,7 +32,7 @@ index c61d27f..0870054 100644
}
/* print functions */
@@ -179,6 +187,10 @@ static int wprint_console(FILE *stream, const wchar_t *text, size_t len)
@@ -197,6 +205,10 @@ static int wprint_console(FILE *stream, const wchar_t *text, size_t len)
DWORD out;
int ret;
@ -43,7 +43,7 @@ index c61d27f..0870054 100644
do {
if (stream == stdout) {
HANDLE hOut = GetStdHandle(STD_OUTPUT_HANDLE);
@@ -197,6 +209,7 @@ static int wprint_console(FILE *stream, const wchar_t *text, size_t len)
@@ -215,6 +227,7 @@ static int wprint_console(FILE *stream, const wchar_t *text, size_t len)
return out;
}
} while(0);