From 058a572080a6476b74702fad937493eec6737c0b Mon Sep 17 00:00:00 2001 From: Alwin Esch Date: Mon, 20 Jan 2020 11:09:01 +0000 Subject: [PATCH 01/23] not allow zvbi on Windows and add missing depend --- depends/common/zvbi/deps.txt | 1 + depends/common/zvbi/platforms.txt | 1 + 2 files changed, 2 insertions(+) create mode 100644 depends/common/zvbi/platforms.txt diff --git a/depends/common/zvbi/deps.txt b/depends/common/zvbi/deps.txt index 30c33ac6..071aca25 100644 --- a/depends/common/zvbi/deps.txt +++ b/depends/common/zvbi/deps.txt @@ -1 +1,2 @@ libpng +zlib diff --git a/depends/common/zvbi/platforms.txt b/depends/common/zvbi/platforms.txt new file mode 100644 index 00000000..4869fda9 --- /dev/null +++ b/depends/common/zvbi/platforms.txt @@ -0,0 +1 @@ +!windows !windowsstore \ No newline at end of file From d3c3e93f88756263538bf57c1d740cc466150946 Mon Sep 17 00:00:00 2001 From: Alwin Esch Date: Mon, 20 Jan 2020 11:15:56 +0000 Subject: [PATCH 02/23] prevent Windows on gmp, gnutls and nettle depends --- depends/common/gmp/platforms.txt | 1 + depends/common/gnutls/platforms.txt | 1 + depends/common/nettle/platforms.txt | 1 + 3 files changed, 3 insertions(+) create mode 100644 depends/common/gmp/platforms.txt create mode 100644 depends/common/gnutls/platforms.txt create mode 100644 depends/common/nettle/platforms.txt diff --git a/depends/common/gmp/platforms.txt b/depends/common/gmp/platforms.txt new file mode 100644 index 00000000..4869fda9 --- /dev/null +++ b/depends/common/gmp/platforms.txt @@ -0,0 +1 @@ +!windows !windowsstore \ No newline at end of file diff --git a/depends/common/gnutls/platforms.txt b/depends/common/gnutls/platforms.txt new file mode 100644 index 00000000..4869fda9 --- /dev/null +++ b/depends/common/gnutls/platforms.txt @@ -0,0 +1 @@ +!windows !windowsstore \ No newline at end of file diff --git a/depends/common/nettle/platforms.txt b/depends/common/nettle/platforms.txt new file mode 100644 index 00000000..4869fda9 --- /dev/null +++ b/depends/common/nettle/platforms.txt @@ -0,0 +1 @@ +!windows !windowsstore \ No newline at end of file From d4b93aa6981fb44869481df6cfc8a5cc39fe5afb Mon Sep 17 00:00:00 2001 From: Alwin Esch Date: Mon, 20 Jan 2020 11:19:36 +0000 Subject: [PATCH 03/23] add zlib as depend to libpng --- depends/common/libpng/deps.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 depends/common/libpng/deps.txt diff --git a/depends/common/libpng/deps.txt b/depends/common/libpng/deps.txt new file mode 100644 index 00000000..f22003e8 --- /dev/null +++ b/depends/common/libpng/deps.txt @@ -0,0 +1 @@ +zlib From 8a00c0bc8f6d9446ddd566beca86657865861d08 Mon Sep 17 00:00:00 2001 From: Alwin Esch Date: Sun, 26 Jan 2020 13:54:54 +0100 Subject: [PATCH 04/23] add iconv to windows depends --- depends/windows/iconv/01-Win-UWP-fix.patch | 65 +++++++++++++++++++ depends/windows/iconv/flags.txt | 1 + depends/windows/iconv/iconv.sha256 | 1 + depends/windows/iconv/iconv.txt | 1 + .../windowsstore/iconv/01-Win-UWP-fix.patch | 65 +++++++++++++++++++ depends/windowsstore/iconv/flags.txt | 1 + depends/windowsstore/iconv/iconv.sha256 | 1 + depends/windowsstore/iconv/iconv.txt | 1 + 8 files changed, 136 insertions(+) create mode 100644 depends/windows/iconv/01-Win-UWP-fix.patch create mode 100644 depends/windows/iconv/flags.txt create mode 100644 depends/windows/iconv/iconv.sha256 create mode 100644 depends/windows/iconv/iconv.txt create mode 100644 depends/windowsstore/iconv/01-Win-UWP-fix.patch create mode 100644 depends/windowsstore/iconv/flags.txt create mode 100644 depends/windowsstore/iconv/iconv.sha256 create mode 100644 depends/windowsstore/iconv/iconv.txt diff --git a/depends/windows/iconv/01-Win-UWP-fix.patch b/depends/windows/iconv/01-Win-UWP-fix.patch new file mode 100644 index 00000000..9840f3d4 --- /dev/null +++ b/depends/windows/iconv/01-Win-UWP-fix.patch @@ -0,0 +1,65 @@ +--- a/win_iconv.c ++++ b/win_iconv.c +@@ -45,6 +45,12 @@ + #define FLAG_TRANSLIT 2 /* //TRANSLIT */ + #define FLAG_IGNORE 4 /* //IGNORE */ + ++/* Default family is DESKTOP_APP which is DESKTOP | APP ++ * We want to know when we're only building for apps */ ++#if defined(WINAPI_FAMILY) && (WINAPI_FAMILY == WINAPI_FAMILY_APP) ++#define G_WINAPI_ONLY_APP ++#endif ++ + typedef unsigned char uchar; + typedef unsigned short ushort; + typedef unsigned int uint; +@@ -714,7 +720,13 @@ load_mlang(void) + HMODULE h; + if (ConvertINetString != NULL) + return TRUE; ++ /* When building for UWP, load app asset DLLs instead of filesystem DLLs. ++ * Needs MSVC, Windows 8 and newer, and is only usable from apps. */ ++#if _WIN32_WINNT >= 0x0602 && defined(G_WINAPI_ONLY_APP) ++ h = LoadPackagedLibrary(TEXT("mlang.dll"), 0); ++#else + h = LoadLibrary(TEXT("mlang.dll")); ++#endif + if (!h) + return FALSE; + ConvertINetString = (CONVERTINETSTRING)GetProcAddressA(h, "ConvertINetString"); +@@ -1171,7 +1183,26 @@ libiconv_iconv_open(rec_iconv_t *cd, const char *tocode, const char *fromcode) + dllname = xstrndup(p, e - p); + if (dllname == NULL) + return FALSE; ++ /* When building for UWP, load app asset DLLs instead of filesystem DLLs. ++ * Needs MSVC, Windows 8 and newer, and is only usable from apps. */ ++#if _WIN32_WINNT >= 0x0602 && defined(G_WINAPI_ONLY_APP) ++ int result = MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, dllname, strlen(dllname), NULL, 0); ++ if (result == 0) ++ return FALSE; ++ ++ wchar_t* newStr = (wchar_t*)malloc(result*sizeof(wchar_t)); ++ result = MultiByteToWideChar( CP_UTF8, MB_ERR_INVALID_CHARS, dllname, strlen(dllname), newStr, result ); ++ if (result == 0) ++ { ++ free( newStr ); ++ return FALSE; ++ } ++ ++ hlibiconv = LoadPackagedLibrary( newStr, 0 ); ++ free( newStr ); ++#else + hlibiconv = LoadLibraryA(dllname); ++#endif + free(dllname); + if (hlibiconv != NULL) + { +@@ -1574,7 +1605,7 @@ static int + utf32_mbtowc(csconv_t *cv, const uchar *buf, int bufsize, ushort *wbuf, int *wbufsize) + { + int codepage = cv->codepage; +- uint wc = 0xD800; ++ uint wc = 0xD800; + + /* swap endian: 12000 <-> 12001 */ + if (cv->mode & UNICODE_MODE_SWAPPED) diff --git a/depends/windows/iconv/flags.txt b/depends/windows/iconv/flags.txt new file mode 100644 index 00000000..9872bb7b --- /dev/null +++ b/depends/windows/iconv/flags.txt @@ -0,0 +1 @@ +-DBUILD_SHARED=0 -DBUILD_STATIC=1 \ No newline at end of file diff --git a/depends/windows/iconv/iconv.sha256 b/depends/windows/iconv/iconv.sha256 new file mode 100644 index 00000000..1bb466d1 --- /dev/null +++ b/depends/windows/iconv/iconv.sha256 @@ -0,0 +1 @@ +23adea990a8303c6e69e32a64a30171efcb1b73824a1c2da1bbf576b0ae7c520 diff --git a/depends/windows/iconv/iconv.txt b/depends/windows/iconv/iconv.txt new file mode 100644 index 00000000..0fa20191 --- /dev/null +++ b/depends/windows/iconv/iconv.txt @@ -0,0 +1 @@ +iconv https://github.com/win-iconv/win-iconv/archive/v0.0.8.tar.gz diff --git a/depends/windowsstore/iconv/01-Win-UWP-fix.patch b/depends/windowsstore/iconv/01-Win-UWP-fix.patch new file mode 100644 index 00000000..9840f3d4 --- /dev/null +++ b/depends/windowsstore/iconv/01-Win-UWP-fix.patch @@ -0,0 +1,65 @@ +--- a/win_iconv.c ++++ b/win_iconv.c +@@ -45,6 +45,12 @@ + #define FLAG_TRANSLIT 2 /* //TRANSLIT */ + #define FLAG_IGNORE 4 /* //IGNORE */ + ++/* Default family is DESKTOP_APP which is DESKTOP | APP ++ * We want to know when we're only building for apps */ ++#if defined(WINAPI_FAMILY) && (WINAPI_FAMILY == WINAPI_FAMILY_APP) ++#define G_WINAPI_ONLY_APP ++#endif ++ + typedef unsigned char uchar; + typedef unsigned short ushort; + typedef unsigned int uint; +@@ -714,7 +720,13 @@ load_mlang(void) + HMODULE h; + if (ConvertINetString != NULL) + return TRUE; ++ /* When building for UWP, load app asset DLLs instead of filesystem DLLs. ++ * Needs MSVC, Windows 8 and newer, and is only usable from apps. */ ++#if _WIN32_WINNT >= 0x0602 && defined(G_WINAPI_ONLY_APP) ++ h = LoadPackagedLibrary(TEXT("mlang.dll"), 0); ++#else + h = LoadLibrary(TEXT("mlang.dll")); ++#endif + if (!h) + return FALSE; + ConvertINetString = (CONVERTINETSTRING)GetProcAddressA(h, "ConvertINetString"); +@@ -1171,7 +1183,26 @@ libiconv_iconv_open(rec_iconv_t *cd, const char *tocode, const char *fromcode) + dllname = xstrndup(p, e - p); + if (dllname == NULL) + return FALSE; ++ /* When building for UWP, load app asset DLLs instead of filesystem DLLs. ++ * Needs MSVC, Windows 8 and newer, and is only usable from apps. */ ++#if _WIN32_WINNT >= 0x0602 && defined(G_WINAPI_ONLY_APP) ++ int result = MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, dllname, strlen(dllname), NULL, 0); ++ if (result == 0) ++ return FALSE; ++ ++ wchar_t* newStr = (wchar_t*)malloc(result*sizeof(wchar_t)); ++ result = MultiByteToWideChar( CP_UTF8, MB_ERR_INVALID_CHARS, dllname, strlen(dllname), newStr, result ); ++ if (result == 0) ++ { ++ free( newStr ); ++ return FALSE; ++ } ++ ++ hlibiconv = LoadPackagedLibrary( newStr, 0 ); ++ free( newStr ); ++#else + hlibiconv = LoadLibraryA(dllname); ++#endif + free(dllname); + if (hlibiconv != NULL) + { +@@ -1574,7 +1605,7 @@ static int + utf32_mbtowc(csconv_t *cv, const uchar *buf, int bufsize, ushort *wbuf, int *wbufsize) + { + int codepage = cv->codepage; +- uint wc = 0xD800; ++ uint wc = 0xD800; + + /* swap endian: 12000 <-> 12001 */ + if (cv->mode & UNICODE_MODE_SWAPPED) diff --git a/depends/windowsstore/iconv/flags.txt b/depends/windowsstore/iconv/flags.txt new file mode 100644 index 00000000..9872bb7b --- /dev/null +++ b/depends/windowsstore/iconv/flags.txt @@ -0,0 +1 @@ +-DBUILD_SHARED=0 -DBUILD_STATIC=1 \ No newline at end of file diff --git a/depends/windowsstore/iconv/iconv.sha256 b/depends/windowsstore/iconv/iconv.sha256 new file mode 100644 index 00000000..1bb466d1 --- /dev/null +++ b/depends/windowsstore/iconv/iconv.sha256 @@ -0,0 +1 @@ +23adea990a8303c6e69e32a64a30171efcb1b73824a1c2da1bbf576b0ae7c520 diff --git a/depends/windowsstore/iconv/iconv.txt b/depends/windowsstore/iconv/iconv.txt new file mode 100644 index 00000000..0fa20191 --- /dev/null +++ b/depends/windowsstore/iconv/iconv.txt @@ -0,0 +1 @@ +iconv https://github.com/win-iconv/win-iconv/archive/v0.0.8.tar.gz From b3fccbadf7f3ca1c3c4874549c1710c95caa36a5 Mon Sep 17 00:00:00 2001 From: Alwin Esch Date: Sun, 26 Jan 2020 13:56:20 +0100 Subject: [PATCH 05/23] add/update libxml2 on windows depends --- depends/windows/libxml2/01-win32_io.patch | 20 + depends/windows/libxml2/02-fix-uwp-api.patch | 156 ++++++ depends/windows/libxml2/CMakeLists.txt | 454 ++++++++++++++++++ depends/windows/libxml2/deps.txt | 2 + depends/windows/libxml2/libxml2.sha256 | 1 + depends/windows/libxml2/libxml2.txt | 1 + .../windowsstore/libxml2/01-win32_io.patch | 4 +- .../windowsstore/libxml2/02-fix-uwp-api.patch | 20 +- depends/windowsstore/libxml2/CMakeLists.txt | 37 +- depends/windowsstore/libxml2/deps.txt | 1 + 10 files changed, 670 insertions(+), 26 deletions(-) create mode 100644 depends/windows/libxml2/01-win32_io.patch create mode 100644 depends/windows/libxml2/02-fix-uwp-api.patch create mode 100644 depends/windows/libxml2/CMakeLists.txt create mode 100644 depends/windows/libxml2/deps.txt create mode 100644 depends/windows/libxml2/libxml2.sha256 create mode 100644 depends/windows/libxml2/libxml2.txt diff --git a/depends/windows/libxml2/01-win32_io.patch b/depends/windows/libxml2/01-win32_io.patch new file mode 100644 index 00000000..d5ccf810 --- /dev/null +++ b/depends/windows/libxml2/01-win32_io.patch @@ -0,0 +1,20 @@ +--- /xmlIO.c 2015-11-03 07:36:33.000000000 -0500 ++++ /xmlIO_new.c 2016-03-20 21:32:59.960019300 -0400 +@@ -2319,7 +2319,7 @@ + return; + + #if defined(_WIN32) || defined (__DJGPP__) && !defined (__CYGWIN__) +- xmlInitPlatformSpecificIo(); ++// xmlInitPlatformSpecificIo(); + #endif + + xmlRegisterInputCallbacks(xmlFileMatch, xmlFileOpen, +@@ -2357,7 +2357,7 @@ + return; + + #if defined(_WIN32) || defined (__DJGPP__) && !defined (__CYGWIN__) +- xmlInitPlatformSpecificIo(); ++// xmlInitPlatformSpecificIo(); + #endif + + xmlRegisterOutputCallbacks(xmlFileMatch, xmlFileOpenW, diff --git a/depends/windows/libxml2/02-fix-uwp-api.patch b/depends/windows/libxml2/02-fix-uwp-api.patch new file mode 100644 index 00000000..61e57310 --- /dev/null +++ b/depends/windows/libxml2/02-fix-uwp-api.patch @@ -0,0 +1,156 @@ +diff --git a/catalog.c b/catalog.c +index 6dfdfbb..a5655f0 100644 +--- a/catalog.c ++++ b/catalog.c +@@ -77,6 +77,9 @@ + #endif + + #if defined(_WIN32) && defined(_MSC_VER) ++#if defined(WINAPI_FAMILY) && WINAPI_FAMILY != WINAPI_FAMILY_DESKTOP_APP ++# define getenv(x) NULL ++#endif + #undef XML_XML_DEFAULT_CATALOG + static char XML_XML_DEFAULT_CATALOG[256] = "file:///etc/xml/catalog"; + #if defined(_WIN32_WCE) +@@ -3122,6 +3125,7 @@ xmlInitializeCatalog(void) { + if (catalogs == NULL) + #if defined(_WIN32) && defined(_MSC_VER) + { ++#if (WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP) + void* hmodule; + hmodule = GetModuleHandleA("libxml2.dll"); + if (hmodule == NULL) +@@ -3144,6 +3148,7 @@ xmlInitializeCatalog(void) { + } + } + } ++#endif + catalogs = XML_XML_DEFAULT_CATALOG; + } + #else +diff --git a/include/libxml/xmlversion.h b/include/libxml/xmlversion.h +index dd7d71c..e232c0a 100644 +--- a/include/libxml/xmlversion.h ++++ b/include/libxml/xmlversion.h +@@ -174,7 +174,7 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version); + * + * Whether the FTP support is configured in + */ +-#if 1 ++#if !defined(WINAPI_FAMILY) || (WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP) + #define LIBXML_FTP_ENABLED + #endif + +@@ -183,7 +183,7 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version); + * + * Whether the HTTP support is configured in + */ +-#if 1 ++#if !defined(WINAPI_FAMILY) || (WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP) + #define LIBXML_HTTP_ENABLED + #endif + +diff --git a/nanoftp.c b/nanoftp.c +index 2135ab9..2b2225d 100644 +--- a/nanoftp.c ++++ b/nanoftp.c +@@ -108,6 +108,10 @@ + #endif + #endif + ++#if defined(WINAPI_FAMILY) && (WINAPI_FAMILY == WINAPI_FAMILY_APP) ++# define getenv(x) NULL ++#endif ++ + #ifndef XML_SOCKLEN_T + #define XML_SOCKLEN_T unsigned int + #endif +diff --git a/nanohttp.c b/nanohttp.c +index e109ad7..2782b3d 100644 +--- a/nanohttp.c ++++ b/nanohttp.c +@@ -113,6 +113,10 @@ + #define XML_SOCKLEN_T unsigned int + #endif + ++#if defined(WINAPI_FAMILY) && (WINAPI_FAMILY == WINAPI_FAMILY_APP) ++# define getenv(x) NULL ++#endif ++ + #ifdef STANDALONE + #define DEBUG_HTTP + #define xmlStrncasecmp(a, b, n) strncasecmp((char *)a, (char *)b, n) +diff --git a/xmlIO.c b/xmlIO.c +index 1a79c09..9d8bd15 100644 +--- a/xmlIO.c ++++ b/xmlIO.c +@@ -99,6 +99,10 @@ + #include "buf.h" + #include "enc.h" + ++#if defined(WINAPI_FAMILY) && (WINAPI_FAMILY == WINAPI_FAMILY_APP) ++#include ++#endif ++ + /* #define VERBOSE_FAILURE */ + /* #define DEBUG_EXTERNAL_ENTITIES */ + /* #define DEBUG_INPUT */ +@@ -733,7 +737,11 @@ xmlInitPlatformSpecificIo(void) + + osvi.dwOSVersionInfoSize = sizeof(osvi); + ++#if (WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP) + if(GetVersionEx(&osvi) && (osvi.dwPlatformId == VER_PLATFORM_WIN32_NT)) { ++#else ++ if (1) { ++#endif + xmlWrapStat = xmlWrapStatUtf8; + xmlWrapOpen = xmlWrapOpenUtf8; + #ifdef HAVE_ZLIB_H +@@ -3841,7 +3849,7 @@ xmlParserGetDirectory(const char *filename) { + else *cur = 0; + ret = xmlMemStrdup(dir); + } else { +- if (getcwd(dir, 1024) != NULL) { ++ if (_getcwd(dir, 1024) != NULL) { + dir[1023] = 0; + ret = xmlMemStrdup(dir); + } +diff --git a/xmlmemory.c b/xmlmemory.c +index f08c8c3..8b9c35e 100644 +--- a/xmlmemory.c ++++ b/xmlmemory.c +@@ -56,6 +56,10 @@ static xmlMutexPtr xmlMemMutex = NULL; + + void xmlMallocBreakpoint(void); + ++#if defined(WINAPI_FAMILY) && WINAPI_FAMILY == WINAPI_FAMILY_APP ++# define getenv(x) NULL ++#endif ++ + /************************************************************************ + * * + * Macros, variables and associated types * +diff --git a/xmlmodule.c b/xmlmodule.c +index 50ed666..be21bcc 100644 +--- a/xmlmodule.c ++++ b/xmlmodule.c +@@ -308,7 +308,14 @@ xmlModulePlatformSymbol(void *handle, const char *name, void **symbol) + static void * + xmlModulePlatformOpen(const char *name) + { +- return LoadLibraryA(name); ++#if !defined(WINAPI_FAMILY) || (WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP) ++ return LoadLibraryA(name); ++#else ++ wchar_t* nameW = (wchar_t*)malloc(strlen(name)+1); ++ mbstowcs(nameW, name, strlen(name)); ++ return LoadPackagedLibrary(nameW, 0); ++ free(nameW); ++#endif + } + + /* +-- +2.13.2.windows.1 + diff --git a/depends/windows/libxml2/CMakeLists.txt b/depends/windows/libxml2/CMakeLists.txt new file mode 100644 index 00000000..7a161ec9 --- /dev/null +++ b/depends/windows/libxml2/CMakeLists.txt @@ -0,0 +1,454 @@ +cmake_minimum_required(VERSION 3.5) +project(xml2) + +enable_language(C) + +find_package(ZLIB REQUIRED) +list(APPEND CMAKE_REQUIRED_INCLUDES ${ZLIB_INCLUDE_DIRS}) + +if(NOT WIN32) + include(CheckIncludeFile) + include(CheckFunctionExists) + include(CheckStructHasMember) + include(CheckSymbolExists) + + file(READ config.h.in FILE_CONTENT) + string(REPLACE "#undef" "#cmakedefine" MODIFIED_FILE_CONTENT "${FILE_CONTENT}") + file(WRITE config.h.cmake "${MODIFIED_FILE_CONTENT}") + + #/* Type cast for the gethostbyname() argument */ + #undef GETHOSTBYNAME_ARG_CAST + + #/* Define to 1 if you have the header file. */ + check_include_file(ansidecl.h HAVE_ANSIDECL_H) + + #/* Define to 1 if you have the header file. */ + check_include_file(arpa/inet.h HAVE_ARPA_INET_H) + + #/* Define to 1 if you have the header file. */ + check_include_file(arpa/nameser.h HAVE_ARPA_NAMESER_H) + + #/* Whether struct sockaddr::__ss_family exists */ + check_struct_has_member("struct sockaddr" __ss_family sys/socket.h HAVE_BROKEN_SS_FAMILY) + + #/* Define to 1 if you have the `class' function. */ + check_function_exists(class HAVE_CLASS) + + #/* Define to 1 if you have the header file. */ + check_include_file(ctype.h HAVE_CTYPE_H) + + #/* Define to 1 if you have the header file. */ + check_include_file(dirent.h HAVE_DIRENT_H) + + #/* Define to 1 if you have the header file. */ + check_include_file(dlfcn.h HAVE_DLFCN_H) + + #/* Have dlopen based dso */ + #undef HAVE_DLOPEN + + #/* Define to 1 if you have the header file. */ + check_include_file(dl.h HAVE_DL_H) + + #/* Define to 1 if you have the header file. */ + check_include_file(errno.h HAVE_ERRNO_H) + + #/* Define to 1 if you have the header file. */ + check_include_file(fcntl.h HAVE_FCNTL_H) + + #/* Define to 1 if you have the `finite' function. */ + check_function_exists(finite HAVE_FINITE) + + #/* Define to 1 if you have the header file. */ + check_include_file(float.h HAVE_FLOAT_H) + + #/* Define to 1 if you have the `fpclass' function. */ + check_function_exists(fpclass HAVE_FPCLASS) + + #/* Define to 1 if you have the `fprintf' function. */ + check_function_exists(fprintf HAVE_FPRINTF) + + #/* Define to 1 if you have the `fp_class' function. */ + check_function_exists(fp_class HAVE_FP_CLASS) + + #/* Define to 1 if you have the header file. */ + check_include_file(fp_class.h HAVE_FP_CLASS_H) + + #/* Define to 1 if you have the `ftime' function. */ + check_function_exists(ftime HAVE_FTIME) + + #/* Define if getaddrinfo is there */ + check_function_exists(getaddrinfo HAVE_GETADDRINFO) + + #/* Define to 1 if you have the `gettimeofday' function. */ + check_function_exists(gettimeofday HAVE_GETTIMEOFDAY) + + #/* Define to 1 if you have the header file. */ + check_include_file(ieeefp.h HAVE_IEEEFP_H) + + #/* Define to 1 if you have the header file. */ + check_include_file(inttypes.h HAVE_INTTYPES_H) + + #/* Define to 1 if you have the `isascii' function. */ + check_function_exists(isascii HAVE_ISASCII) + + #/* Define if isinf is there */ + check_function_exists(isinf HAVE_ISINF) + + #/* Define if isnan is there */ + check_function_exists(isnan HAVE_ISNAN) + + #/* Define to 1 if you have the `isnand' function. */ + check_function_exists(isnand HAVE_ISNAND) + + #/* Define if history library is there (-lhistory) */ + #undef HAVE_LIBHISTORY + + #/* Have compression library */ + #undef HAVE_LIBLZMA + + #/* Define if pthread library is there (-lpthread) */ + #undef HAVE_LIBPTHREAD + + #/* Define if readline library is there (-lreadline) */ + #undef HAVE_LIBREADLINE + + #/* Have compression library */ + #undef HAVE_LIBZ + + #/* Define to 1 if you have the header file. */ + check_include_file(limits.h HAVE_LIMITS_H) + + #/* Define to 1 if you have the `localtime' function. */ + check_function_exists(localtime HAVE_LOCALTIME) + + #/* Define to 1 if you have the header file. */ + check_include_file(lzma.h HAVE_LZMA_H) + + #/* Define to 1 if you have the header file. */ + check_include_file(malloc.h HAVE_MALLOC_H) + + #/* Define to 1 if you have the header file. */ + check_include_file(math.h HAVE_MATH_H) + + #/* Define to 1 if you have the header file. */ + check_include_file(memory.h HAVE_MEMORY_H) + + #/* Define to 1 if you have the `mmap' function. */ + check_function_exists(mmap HAVE_MMAP) + + #/* Define to 1 if you have the `munmap' function. */ + check_function_exists(munmap HAVE_MUNMAP) + + #/* mmap() is no good without munmap() */ + #if defined(HAVE_MMAP) && !defined(HAVE_MUNMAP) + # undef /**/ HAVE_MMAP + #endif + + #/* Define to 1 if you have the header file. */ + check_include_file(nan.h HAVE_NAN_H) + + #/* Define to 1 if you have the header file, and it defines `DIR'. */ + check_include_file(ndir.h HAVE_NDIR_H) + + #/* Define to 1 if you have the header file. */ + check_include_file(netdb.h HAVE_NETDB_H) + + #/* Define to 1 if you have the header file. */ + check_include_file(netinet/in.h HAVE_NETINET_IN_H) + + #/* Define to 1 if you have the header file. */ + check_include_file(poll.h HAVE_POLL_H) + + #/* Define to 1 if you have the `printf' function. */ + check_function_exists(printf HAVE_PRINTF) + + #/* Define if is there */ + #undef HAVE_PTHREAD_H + + #/* Define to 1 if you have the `putenv' function. */ + check_function_exists(putenv HAVE_PUTENV) + + #/* Define to 1 if you have the `rand' function. */ + check_function_exists(rand HAVE_RAND) + + #/* Define to 1 if you have the `rand_r' function. */ + check_function_exists(rand_r HAVE_RAND_R) + + #/* Define to 1 if you have the header file. */ + check_include_file(resolv.h HAVE_RESOLV_H) + + #/* Have shl_load based dso */ + #undef HAVE_SHLLOAD + + #/* Define to 1 if you have the `signal' function. */ + check_function_exists(signal HAVE_SIGNAL) + + #/* Define to 1 if you have the header file. */ + check_include_file(signal.h HAVE_SIGNAL_H) + + #/* Define to 1 if you have the `snprintf' function. */ + #check_function_exists(snprintf HAVE_SNPRINTF) + check_symbol_exists(snprintf stdio.h HAVE_SNPRINTF) + + #/* Define to 1 if you have the `sprintf' function. */ + check_function_exists(sprintf HAVE_SPRINTF) + + #/* Define to 1 if you have the `srand' function. */ + check_function_exists(srand HAVE_SRAND) + + #/* Define to 1 if you have the `sscanf' function. */ + check_function_exists(sscanf HAVE_SSCANF) + + #/* Define to 1 if you have the `stat' function. */ + check_function_exists(stat HAVE_STAT) + + #/* Define to 1 if you have the header file. */ + check_include_file(stdarg.h HAVE_STDARG_H) + + #/* Define to 1 if you have the header file. */ + check_include_file(stdint.h HAVE_STDINT_H) + + #/* Define to 1 if you have the header file. */ + check_include_file(stdlib.h HAVE_STDLIB_H) + + #/* Define to 1 if you have the `strdup' function. */ + check_function_exists(strdup HAVE_STRDUP) + + #/* Define to 1 if you have the `strerror' function. */ + check_function_exists(strerror HAVE_STRERROR) + + #/* Define to 1 if you have the `strftime' function. */ + check_function_exists(strftime HAVE_STRFTIME) + + #/* Define to 1 if you have the header file. */ + check_include_file(strings.h HAVE_STRINGS_H) + + #/* Define to 1 if you have the header file. */ + check_include_file(string.h HAVE_STRING_H) + + #/* Define to 1 if you have the `strndup' function. */ + check_function_exists(strndup HAVE_STRNDUP) + + #/* Define to 1 if you have the header file, and it defines `DIR'. + # */ + check_include_file(sys/dir.h HAVE_SYS_DIR_H) + + #/* Define to 1 if you have the header file. */ + check_include_file(sys/mman.h HAVE_SYS_MMAN_H) + + #/* Define to 1 if you have the header file, and it defines `DIR'. + # */ + check_include_file(sys/ndir.h HAVE_SYS_NDIR_H) + + #/* Define to 1 if you have the header file. */ + check_include_file(sys/select.h HAVE_SYS_SELECT_H) + + #/* Define to 1 if you have the header file. */ + check_include_file(sys/socket.h HAVE_SYS_SOCKET_H) + + #/* Define to 1 if you have the header file. */ + check_include_file(sys/stat.h HAVE_SYS_STAT_H) + + #/* Define to 1 if you have the header file. */ + check_include_file(sys/timeb.h HAVE_SYS_TIMEB_H) + + #/* Define to 1 if you have the header file. */ + check_include_file(sys/time.h HAVE_SYS_TIME_H) + + #/* Define to 1 if you have the header file. */ + check_include_file(sys/types.h HAVE_SYS_TYPES_H) + + #/* Define to 1 if you have the `time' function. */ + check_function_exists(time HAVE_TIME) + + #/* Define to 1 if you have the header file. */ + check_include_file(time.h HAVE_TIME_H) + + #/* Define to 1 if you have the header file. */ + check_include_file(unistd.h HAVE_UNISTD_H) + + #/* Whether va_copy() is available */ + check_symbol_exists(va_copy stdarg.h HAVE_VA_COPY) + + #/* Define to 1 if you have the `vfprintf' function. */ + check_function_exists(vfprintf HAVE_VFPRINTF) + + #/* Define to 1 if you have the `vsnprintf' function. */ + check_function_exists(vsnprintf HAVE_VSNPRINTF) + + #/* Define to 1 if you have the `vsprintf' function. */ + check_function_exists(vsprintf HAVE_VSPRINTF) + + #/* Define to 1 if you have the header file. */ + check_include_file(zlib.h HAVE_ZLIB_H) + + #/* Define to 1 if you have the `_stat' function. */ + check_function_exists(_stat HAVE__STAT) + + #/* Whether __va_copy() is available */ + check_symbol_exists(__va_copy stdarg.h HAVE___VA_COPY) + + #/* Define as const if the declaration of iconv() needs const. */ + #undef ICONV_CONST + set(ICONV_CONST const) + + #/* Define to the sub-directory where libtool stores uninstalled libraries. */ + #undef LT_OBJDIR + + #/* Name of package */ + #undef PACKAGE + + #/* Define to the address where bug reports for this package should be sent. */ + #undef PACKAGE_BUGREPORT + + #/* Define to the full name of this package. */ + #undef PACKAGE_NAME + + #/* Define to the full name and version of this package. */ + #undef PACKAGE_STRING + + #/* Define to the one symbol short name of this package. */ + #undef PACKAGE_TARNAME + + #/* Define to the home page for this package. */ + #undef PACKAGE_URL + + #/* Define to the version of this package. */ + #undef PACKAGE_VERSION + + #/* Type cast for the send() function 2nd arg */ + #undef SEND_ARG2_CAST + + #/* Define to 1 if you have the ANSI C header files. */ + #undef STDC_HEADERS + + #/* Support for IPv6 */ + #undef SUPPORT_IP6 + + #/* Define if va_list is an array type */ + check_c_source_compiles("#include \n int main() {va_list list1, list2; list1 = list2;}" NOT_VA_LIST_IS_ARRAY) + if(NOT NOT_VA_LIST_IS_ARRAY) + set(VA_LIST_IS_ARRAY 1) + endif() + + #/* Version number of package */ + #undef VERSION + + #/* Determine what socket length (socklen_t) data type is */ + #undef XML_SOCKLEN_T + + #/* Define for Solaris 2.5.1 so the uint32_t typedef from , + # , or is not used. If the typedef were allowed, the + #define below would cause a syntax error. */ + #undef _UINT32_T + + #/* Using the Win32 Socket implementation */ + #undef _WINSOCKAPI_ + + #/* ss_family is not defined here, use __ss_family instead */ + #undef ss_family + + #/* Define to the type of an unsigned integer type of width exactly 32 bits if + # such a type exists and the standard includes do not define it. */ + #undef uint32_t +endif() + +set(LIBXML_MAJOR_VERSION 2) +set(LIBXML_MINOR_VERSION 9) +set(LIBXML_MICRO_VERSION 3) +set(LIBXML_MICRO_VERSION_SUFFIX) +set(LIBXML_VERSION ${LIBXML_MAJOR_VERSION}.${LIBXML_MINOR_VERSION}.${LIBXML_MICRO_VERSION}${LIBXML_MICRO_VERSION_SUFFIX}) +math(EXPR LIBXML_VERSION_INFO "${LIBXML_MAJOR_VERSION} + ${LIBXML_MINOR_VERSION}") +set(LIBXML_VERSION_INFO ${LIBXML_VERSION_INFO}:${LIBXML_MICRO_VERSION}:${LIBXML_MINOR_VERSION}) +math(EXPR LIBXML_VERSION_NUMBER "${LIBXML_MAJOR_VERSION} * 10000 + ${LIBXML_MINOR_VERSION} * 100 + ${LIBXML_MICRO_VERSION}") +set(VERSION ${LIBXML_VERSION}) +set(LIBXML_VERSION_EXTRA) + +set(WITH_TRIO 0) +set(WITH_THREADS 0) +set(WITH_THREAD_ALLOC 0) +set(WITH_TREE 1) +set(WITH_OUTPUT 1) +set(WITH_PUSH 1) +set(WITH_READER 1) +set(WITH_PATTERN 0) +set(WITH_WRITER 0) +set(WITH_SAX1 0) +set(WITH_FTP 0) +set(WITH_HTTP 0) +set(WITH_VALID 0) +set(WITH_HTML 1) +set(WITH_LEGACY 0) +set(WITH_C14N 0) +set(WITH_CATALOG 0) +set(WITH_DOCB 0) +set(WITH_XPATH 0) +set(WITH_XPTR 0) +set(WITH_XINCLUDE 0) +set(WITH_ICONV 1) +set(WITH_ICU 0) +set(WITH_ISO8859X 1) +set(WITH_DEBUG 0) +set(WITH_MEM_DEBUG 0) +set(WITH_RUN_DEBUG 0) +set(WITH_REGEXPS 0) +set(WITH_SCHEMAS 0) +set(WITH_SCHEMATRON 0) +set(WITH_MODULES 0) +set(MODULE_EXTENSION 0) +set(WITH_ZLIB 1) +set(WITH_LZMA 0) + +if(NOT WIN32) + configure_file(config.h.cmake ${PROJECT_SOURCE_DIR}/config.h) +else() + file(COPY include/win32config.h DESTINATION ${PROJECT_SOURCE_DIR}) + file(COPY win32/VC10/config.h DESTINATION ${PROJECT_SOURCE_DIR}) +endif() + +set(prefix ${CMAKE_INSTALL_PREFIX}) +set(exec_prefix "$") +set(exec_prefix "${exec_prefix}{") +set(exec_prefix "${exec_prefix}prefix") +set(exec_prefix "${exec_prefix}}") + +set(libdir "$") +set(libdir "${libdir}{") +set(libdir "${libdir}exec_prefix") +set(libdir "${libdir}}/lib") + +set(includedir "$") +set(includedir "${includedir}{") +set(includedir "${includedir}prefix") +set(includedir "${includedir}}/include") + +set(XML_INCLUDEDIR "-I$") +set(XML_INCLUDEDIR "${XML_INCLUDEDIR}{") +set(XML_INCLUDEDIR "${XML_INCLUDEDIR}includedir") +set(XML_INCLUDEDIR "${XML_INCLUDEDIR}}/libxml2") + +set(Z_LIBS "-lz") +set(ICONV_LIBS "-liconv") + +configure_file(include/libxml/xmlversion.h.in ${PROJECT_SOURCE_DIR}/include/libxml/xmlversion.h) +configure_file(libxml-2.0.pc.in ${PROJECT_SOURCE_DIR}/libxml-2.0.pc) + +include_directories(${ZLIB_INCLUDE_DIRS} include) +file(GLOB SOURCES *.c) + +file(GLOB SOURCES_EXCLUDE test*.c runsuite.c runtest.c runxmlconf.c trio*.c xmlcatalog.c) +list(REMOVE_ITEM SOURCES ${SOURCES_EXCLUDE}) + +add_library(xml2 STATIC ${SOURCES}) +target_link_libraries(xml2 ${ZLIB_LIBRARIES}) + +if(NOT WIN32) + set_target_properties(xml2 PROPERTIES COMPILE_FLAGS "-fPIC") +else() + add_definitions(-DHAVE_ZLIB_H -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE) + set_target_properties(xml2 PROPERTIES COMPILE_FLAGS "/W1") +endif() + +install(TARGETS xml2 DESTINATION ${CMAKE_INSTALL_PREFIX}/lib) +install(DIRECTORY include/libxml DESTINATION ${CMAKE_INSTALL_PREFIX}/include/libxml2/) +install(FILES libxml-2.0.pc DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/pkgconfig) diff --git a/depends/windows/libxml2/deps.txt b/depends/windows/libxml2/deps.txt new file mode 100644 index 00000000..cdb85419 --- /dev/null +++ b/depends/windows/libxml2/deps.txt @@ -0,0 +1,2 @@ +iconv +zlib diff --git a/depends/windows/libxml2/libxml2.sha256 b/depends/windows/libxml2/libxml2.sha256 new file mode 100644 index 00000000..f2e6c184 --- /dev/null +++ b/depends/windows/libxml2/libxml2.sha256 @@ -0,0 +1 @@ +ffb911191e509b966deb55de705387f14156e1a56b21824357cdf0053233633c diff --git a/depends/windows/libxml2/libxml2.txt b/depends/windows/libxml2/libxml2.txt new file mode 100644 index 00000000..addb633b --- /dev/null +++ b/depends/windows/libxml2/libxml2.txt @@ -0,0 +1 @@ +libxml2 http://xmlsoft.org/sources/libxml2-2.9.4.tar.gz diff --git a/depends/windowsstore/libxml2/01-win32_io.patch b/depends/windowsstore/libxml2/01-win32_io.patch index d5ccf810..d85faf70 100644 --- a/depends/windowsstore/libxml2/01-win32_io.patch +++ b/depends/windowsstore/libxml2/01-win32_io.patch @@ -1,5 +1,5 @@ ---- /xmlIO.c 2015-11-03 07:36:33.000000000 -0500 -+++ /xmlIO_new.c 2016-03-20 21:32:59.960019300 -0400 +--- /xmlIO.c ++++ /xmlIO_new.c @@ -2319,7 +2319,7 @@ return; diff --git a/depends/windowsstore/libxml2/02-fix-uwp-api.patch b/depends/windowsstore/libxml2/02-fix-uwp-api.patch index 88496191..0b7406b9 100644 --- a/depends/windowsstore/libxml2/02-fix-uwp-api.patch +++ b/depends/windowsstore/libxml2/02-fix-uwp-api.patch @@ -1,5 +1,3 @@ -diff --git a/catalog.c b/catalog.c -index 6dfdfbb..a5655f0 100644 --- a/catalog.c +++ b/catalog.c @@ -77,6 +77,9 @@ @@ -28,8 +26,6 @@ index 6dfdfbb..a5655f0 100644 catalogs = XML_XML_DEFAULT_CATALOG; } #else -diff --git a/include/libxml/xmlversion.h b/include/libxml/xmlversion.h -index dd7d71c..e232c0a 100644 --- a/include/libxml/xmlversion.h +++ b/include/libxml/xmlversion.h @@ -174,7 +174,7 @@ XMLPUBFUN void XMLCALL xmlCheckVersion(int version); @@ -37,7 +33,7 @@ index dd7d71c..e232c0a 100644 * Whether the FTP support is configured in */ -#if 1 -+#if 0 ++#if !defined(WINAPI_FAMILY) || (WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP) #define LIBXML_FTP_ENABLED #endif @@ -46,12 +42,10 @@ index dd7d71c..e232c0a 100644 * Whether the HTTP support is configured in */ -#if 1 -+#if 0 ++#if !defined(WINAPI_FAMILY) || (WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP) #define LIBXML_HTTP_ENABLED #endif -diff --git a/nanoftp.c b/nanoftp.c -index 2135ab9..2b2225d 100644 --- a/nanoftp.c +++ b/nanoftp.c @@ -108,6 +108,10 @@ @@ -65,8 +59,6 @@ index 2135ab9..2b2225d 100644 #ifndef XML_SOCKLEN_T #define XML_SOCKLEN_T unsigned int #endif -diff --git a/nanohttp.c b/nanohttp.c -index e109ad7..2782b3d 100644 --- a/nanohttp.c +++ b/nanohttp.c @@ -113,6 +113,10 @@ @@ -80,8 +72,6 @@ index e109ad7..2782b3d 100644 #ifdef STANDALONE #define DEBUG_HTTP #define xmlStrncasecmp(a, b, n) strncasecmp((char *)a, (char *)b, n) -diff --git a/xmlIO.c b/xmlIO.c -index 1a79c09..9d8bd15 100644 --- a/xmlIO.c +++ b/xmlIO.c @@ -99,6 +99,10 @@ @@ -116,8 +106,6 @@ index 1a79c09..9d8bd15 100644 dir[1023] = 0; ret = xmlMemStrdup(dir); } -diff --git a/xmlmemory.c b/xmlmemory.c -index f08c8c3..8b9c35e 100644 --- a/xmlmemory.c +++ b/xmlmemory.c @@ -56,6 +56,10 @@ static xmlMutexPtr xmlMemMutex = NULL; @@ -131,8 +119,6 @@ index f08c8c3..8b9c35e 100644 /************************************************************************ * * * Macros, variables and associated types * -diff --git a/xmlmodule.c b/xmlmodule.c -index 50ed666..be21bcc 100644 --- a/xmlmodule.c +++ b/xmlmodule.c @@ -308,7 +308,14 @@ xmlModulePlatformSymbol(void *handle, const char *name, void **symbol) @@ -151,6 +137,4 @@ index 50ed666..be21bcc 100644 } /* --- -2.13.2.windows.1 diff --git a/depends/windowsstore/libxml2/CMakeLists.txt b/depends/windowsstore/libxml2/CMakeLists.txt index 8aa0a9d7..7a161ec9 100644 --- a/depends/windowsstore/libxml2/CMakeLists.txt +++ b/depends/windowsstore/libxml2/CMakeLists.txt @@ -1,7 +1,6 @@ +cmake_minimum_required(VERSION 3.5) project(xml2) -cmake_minimum_required(VERSION 2.6) - enable_language(C) find_package(ZLIB REQUIRED) @@ -386,7 +385,7 @@ set(WITH_DOCB 0) set(WITH_XPATH 0) set(WITH_XPTR 0) set(WITH_XINCLUDE 0) -set(WITH_ICONV 0) +set(WITH_ICONV 1) set(WITH_ICU 0) set(WITH_ISO8859X 1) set(WITH_DEBUG 0) @@ -404,10 +403,35 @@ if(NOT WIN32) configure_file(config.h.cmake ${PROJECT_SOURCE_DIR}/config.h) else() file(COPY include/win32config.h DESTINATION ${PROJECT_SOURCE_DIR}) - file(RENAME win32/VC10/config.h config.h) + file(COPY win32/VC10/config.h DESTINATION ${PROJECT_SOURCE_DIR}) endif() +set(prefix ${CMAKE_INSTALL_PREFIX}) +set(exec_prefix "$") +set(exec_prefix "${exec_prefix}{") +set(exec_prefix "${exec_prefix}prefix") +set(exec_prefix "${exec_prefix}}") + +set(libdir "$") +set(libdir "${libdir}{") +set(libdir "${libdir}exec_prefix") +set(libdir "${libdir}}/lib") + +set(includedir "$") +set(includedir "${includedir}{") +set(includedir "${includedir}prefix") +set(includedir "${includedir}}/include") + +set(XML_INCLUDEDIR "-I$") +set(XML_INCLUDEDIR "${XML_INCLUDEDIR}{") +set(XML_INCLUDEDIR "${XML_INCLUDEDIR}includedir") +set(XML_INCLUDEDIR "${XML_INCLUDEDIR}}/libxml2") + +set(Z_LIBS "-lz") +set(ICONV_LIBS "-liconv") + configure_file(include/libxml/xmlversion.h.in ${PROJECT_SOURCE_DIR}/include/libxml/xmlversion.h) +configure_file(libxml-2.0.pc.in ${PROJECT_SOURCE_DIR}/libxml-2.0.pc) include_directories(${ZLIB_INCLUDE_DIRS} include) file(GLOB SOURCES *.c) @@ -421,9 +445,10 @@ target_link_libraries(xml2 ${ZLIB_LIBRARIES}) if(NOT WIN32) set_target_properties(xml2 PROPERTIES COMPILE_FLAGS "-fPIC") else() - add_definitions(-DHAVE_ZLIB_H -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_STDC_NO_DEPRECATE -D_WINSOCK_DEPRECATED_NO_WARNINGS) + add_definitions(-DHAVE_ZLIB_H -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE) set_target_properties(xml2 PROPERTIES COMPILE_FLAGS "/W1") endif() install(TARGETS xml2 DESTINATION ${CMAKE_INSTALL_PREFIX}/lib) -install(DIRECTORY include/libxml DESTINATION ${CMAKE_INSTALL_PREFIX}/include) +install(DIRECTORY include/libxml DESTINATION ${CMAKE_INSTALL_PREFIX}/include/libxml2/) +install(FILES libxml-2.0.pc DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/pkgconfig) diff --git a/depends/windowsstore/libxml2/deps.txt b/depends/windowsstore/libxml2/deps.txt index f22003e8..cdb85419 100644 --- a/depends/windowsstore/libxml2/deps.txt +++ b/depends/windowsstore/libxml2/deps.txt @@ -1 +1,2 @@ +iconv zlib From cf39d388e6ed9386cf0e1ad8a6e47224b6eff4de Mon Sep 17 00:00:00 2001 From: Alwin Esch Date: Sun, 26 Jan 2020 13:58:58 +0100 Subject: [PATCH 06/23] remove zvbi from Windows depends --- depends/windows/zvbi/zvbi-win32.patch | 167 ------------------ .../windowsstore/zvbi/zvbi-pthread-w32.patch | 11 -- 2 files changed, 178 deletions(-) delete mode 100644 depends/windows/zvbi/zvbi-win32.patch delete mode 100644 depends/windowsstore/zvbi/zvbi-pthread-w32.patch diff --git a/depends/windows/zvbi/zvbi-win32.patch b/depends/windows/zvbi/zvbi-win32.patch deleted file mode 100644 index 76e3ef60..00000000 --- a/depends/windows/zvbi/zvbi-win32.patch +++ /dev/null @@ -1,167 +0,0 @@ -diff -ruN zvbi/src/conv.c zvbi.new/src/conv.c ---- zvbi/src/conv.c 2008-02-26 15:39:23.000000000 +0100 -+++ zvbi.new/src/conv.c 2008-09-11 21:05:18.000000000 +0200 -@@ -26,7 +26,9 @@ - #endif - - #include -+#ifndef _WIN32 - #include -+#endif - - #include "misc.h" - #include "conv.h" -@@ -1234,9 +1236,12 @@ - const char *dst_format; - - dst_format = bind_textdomain_codeset (vbi_intl_domainname, NULL); -- -+#ifdef _WIN32 -+#warning this is wrong -+#else - if (NULL == dst_format) - dst_format = nl_langinfo (CODESET); -+#endif - - return dst_format; /* may be NULL */ - } -diff -ruN zvbi/src/export.c zvbi.new/src/export.c ---- zvbi/src/export.c 2008-02-19 01:35:15.000000000 +0100 -+++ zvbi.new/src/export.c 2008-09-11 20:38:55.000000000 +0200 -@@ -40,6 +40,26 @@ - #include "conv.h" - #include "vbi.h" /* asprintf */ - -+#ifndef EOVERFLOW -+ #define EOVERFLOW 75 -+#endif -+ -+#ifndef S_IRGRP -+#define S_IRGRP 0 -+#endif -+ -+#ifndef S_IWGRP -+#define S_IWGRP 0 -+#endif -+ -+#ifndef S_IROTH -+#define S_IROTH 0 -+#endif -+ -+#ifndef S_IWOTH -+#define S_IWOTH 0 -+#endif -+ - extern const char _zvbi_intl_domainname[]; - - /** -diff -ruN zvbi/src/packet.c zvbi.new/src/packet.c ---- zvbi/src/packet.c 2008-02-20 18:04:33.000000000 +0100 -+++ zvbi.new/src/packet.c 2008-09-11 21:00:35.000000000 +0200 -@@ -32,7 +32,9 @@ - #include - #include - #include -+#ifndef _WIN32 - #include -+#endif - - #include "misc.h" - #include "hamm.h" -diff -ruN zvbi/src/proxy-msg.c zvbi.new/src/proxy-msg.c ---- zvbi/src/proxy-msg.c 2008-02-19 01:35:21.000000000 +0100 -+++ zvbi.new/src/proxy-msg.c 2008-09-11 21:00:07.000000000 +0200 -@@ -129,7 +129,9 @@ - #include - #include - #include -+#ifndef _WIN32 - #include -+#endif - #include - #include - #include -diff -ruN zvbi/src/proxy-msg.h zvbi.new/src/proxy-msg.h ---- zvbi/src/proxy-msg.h 2008-02-19 01:35:21.000000000 +0100 -+++ zvbi.new/src/proxy-msg.h 2008-09-11 20:59:40.000000000 +0200 -@@ -68,7 +68,9 @@ - #ifndef PROXY_MSG_H - #define PROXY_MSG_H - -+#ifndef _WIN32 - #include -+#endif - - /* Public */ - -diff -ruN zvbi/src/vbi.c zvbi.new/src/vbi.c ---- zvbi/src/vbi.c 2008-03-05 14:33:04.000000000 +0100 -+++ zvbi.new/src/vbi.c 2008-09-11 20:57:55.000000000 +0200 -@@ -39,7 +39,9 @@ - #include - #include - #include -+#ifndef _WIN32 - #include -+#endif - #include - #include - ---- zvbi/src/io.c 2008-02-19 01:35:20.000000000 +0100 -+++ zvbi2/src/io.c 2008-09-11 21:18:59.000000000 +0200 -@@ -28,8 +28,10 @@ - - #include /* open() */ - #include /* close(), mmap(), munmap(), gettimeofday() */ -+#ifndef _WIN32 - #include /* ioctl() */ - #include /* mmap(), munmap() */ -+#endif - #include /* struct timeval */ - #include - #include -@@ -514,7 +516,7 @@ - } - } - -- -+#ifndef _WIN32 - /** - * @internal - * -@@ -554,7 +556,7 @@ - return ret; - } - } -- -+#endif - /* Helper functions to log the communication between the library and drivers. - FIXME remove fp arg, call user log function instead (0.3). */ - -@@ -668,7 +670,9 @@ - "EXCL", O_EXCL, - "TRUNC", O_TRUNC, - "APPEND", O_APPEND, -+#ifndef _WIN32 - "NONBLOCK", O_NONBLOCK, -+#endif - 0); - fprintf (fp, ", 0%o)", mode); - -@@ -773,6 +777,7 @@ - return err; - } - -+#ifndef _WIN32 - /** - * @internal - * Drop-in for mmap(). Logs the request on fp if not NULL. -@@ -822,7 +827,7 @@ - - return r; - } -- -+#endif - /** - * @internal - * Drop-in for munmap(). Logs the request on fp if not NULL. diff --git a/depends/windowsstore/zvbi/zvbi-pthread-w32.patch b/depends/windowsstore/zvbi/zvbi-pthread-w32.patch deleted file mode 100644 index 3e34fe2d..00000000 --- a/depends/windowsstore/zvbi/zvbi-pthread-w32.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- zvbi/configure.in 2018-05-16 14:04:41.881375400 +0200 -+++ zvbi/configure.in.pthread-w32 2018-05-16 14:03:52.661096100 +0200 -@@ -167,7 +167,7 @@ dnl - dnl Check how to link pthreads functions. - dnl (-lpthread on Linux, -pthread on FreeBSD). - dnl --AC_CHECK_LIB(pthread, pthread_create,,[ -+AC_SEARCH_LIBS(pthread_create,[pthreadGC2 pthread],,[ - AC_TRY_LINK(, pthread_create();,,[ - LDFLAGS="$LDFLAGS -pthread" - AC_TRY_LINK(, pthread_create();,,[ From c12a06b4b526769b57799aaed4e8a19bab37c9f9 Mon Sep 17 00:00:00 2001 From: Alwin Esch Date: Sun, 26 Jan 2020 14:00:02 +0100 Subject: [PATCH 07/23] add xz-utils (to use CMake build) to windows depends --- .../xz-utils/01-add-xz-config.cmake.patch | 4 + depends/windows/xz-utils/CMakeLists.txt | 218 ++++++++++++++++++ depends/windows/xz-utils/xz-utils.sha256 | 1 + depends/windows/xz-utils/xz-utils.txt | 1 + .../xz-utils/01-add-xz-config.cmake.patch | 4 + depends/windowsstore/xz-utils/CMakeLists.txt | 218 ++++++++++++++++++ depends/windowsstore/xz-utils/xz-utils.sha256 | 1 + depends/windowsstore/xz-utils/xz-utils.txt | 1 + 8 files changed, 448 insertions(+) create mode 100644 depends/windows/xz-utils/01-add-xz-config.cmake.patch create mode 100644 depends/windows/xz-utils/CMakeLists.txt create mode 100644 depends/windows/xz-utils/xz-utils.sha256 create mode 100644 depends/windows/xz-utils/xz-utils.txt create mode 100644 depends/windowsstore/xz-utils/01-add-xz-config.cmake.patch create mode 100644 depends/windowsstore/xz-utils/CMakeLists.txt create mode 100644 depends/windowsstore/xz-utils/xz-utils.sha256 create mode 100644 depends/windowsstore/xz-utils/xz-utils.txt diff --git a/depends/windows/xz-utils/01-add-xz-config.cmake.patch b/depends/windows/xz-utils/01-add-xz-config.cmake.patch new file mode 100644 index 00000000..b53b3acc --- /dev/null +++ b/depends/windows/xz-utils/01-add-xz-config.cmake.patch @@ -0,0 +1,4 @@ +--- /dev/null ++++ b/cmake/xz-config.cmake +@@ -0,0 +1 @@ ++include(${CMAKE_CURRENT_LIST_DIR}/xz.cmake) diff --git a/depends/windows/xz-utils/CMakeLists.txt b/depends/windows/xz-utils/CMakeLists.txt new file mode 100644 index 00000000..0e46397f --- /dev/null +++ b/depends/windows/xz-utils/CMakeLists.txt @@ -0,0 +1,218 @@ +cmake_minimum_required(VERSION 3.2) + +project(xz VERSION 5.3.0 LANGUAGES C) + +if(MSVC) + set(CMAKE_DEBUG_POSTFIX "d") +endif() + +add_library(lzma + src/common/tuklib_cpucores.c + src/common/tuklib_physmem.c + src/liblzma/check/check.c + src/liblzma/check/crc32_fast.c + src/liblzma/check/crc32_table.c + src/liblzma/check/crc64_fast.c + src/liblzma/check/crc64_table.c + src/liblzma/check/sha256.c + src/liblzma/common/alone_decoder.c + src/liblzma/common/alone_encoder.c + src/liblzma/common/auto_decoder.c + src/liblzma/common/block_buffer_decoder.c + src/liblzma/common/block_buffer_encoder.c + src/liblzma/common/block_decoder.c + src/liblzma/common/block_encoder.c + src/liblzma/common/block_header_decoder.c + src/liblzma/common/block_header_encoder.c + src/liblzma/common/block_util.c + src/liblzma/common/common.c + src/liblzma/common/easy_buffer_encoder.c + src/liblzma/common/easy_decoder_memusage.c + src/liblzma/common/easy_encoder.c + src/liblzma/common/easy_encoder_memusage.c + src/liblzma/common/easy_preset.c + src/liblzma/common/filter_buffer_decoder.c + src/liblzma/common/filter_buffer_encoder.c + src/liblzma/common/filter_common.c + src/liblzma/common/filter_decoder.c + src/liblzma/common/filter_encoder.c + src/liblzma/common/filter_flags_decoder.c + src/liblzma/common/filter_flags_encoder.c + src/liblzma/common/hardware_cputhreads.c + src/liblzma/common/hardware_physmem.c + src/liblzma/common/index.c + src/liblzma/common/index_decoder.c + src/liblzma/common/index_encoder.c + src/liblzma/common/index_hash.c + src/liblzma/common/outqueue.c + src/liblzma/common/stream_buffer_decoder.c + src/liblzma/common/stream_buffer_encoder.c + src/liblzma/common/stream_decoder.c + src/liblzma/common/stream_encoder.c + src/liblzma/common/stream_encoder_mt.c + src/liblzma/common/stream_flags_common.c + src/liblzma/common/stream_flags_decoder.c + src/liblzma/common/stream_flags_encoder.c + src/liblzma/common/vli_decoder.c + src/liblzma/common/vli_encoder.c + src/liblzma/common/vli_size.c + src/liblzma/delta/delta_common.c + src/liblzma/delta/delta_decoder.c + src/liblzma/delta/delta_encoder.c + src/liblzma/lzma/fastpos_table.c + src/liblzma/lzma/lzma2_decoder.c + src/liblzma/lzma/lzma2_encoder.c + src/liblzma/lzma/lzma_decoder.c + src/liblzma/lzma/lzma_encoder.c + src/liblzma/lzma/lzma_encoder_optimum_fast.c + src/liblzma/lzma/lzma_encoder_optimum_normal.c + src/liblzma/lzma/lzma_encoder_presets.c + src/liblzma/lz/lz_decoder.c + src/liblzma/lz/lz_encoder.c + src/liblzma/lz/lz_encoder_mf.c + src/liblzma/rangecoder/price_table.c + src/liblzma/simple/arm.c + src/liblzma/simple/armthumb.c + src/liblzma/simple/ia64.c + src/liblzma/simple/powerpc.c + src/liblzma/simple/simple_coder.c + src/liblzma/simple/simple_decoder.c + src/liblzma/simple/simple_encoder.c + src/liblzma/simple/sparc.c + src/liblzma/simple/x86.c + src/common/mythread.h + src/common/sysdefs.h + src/common/tuklib_common.h + src/common/tuklib_config.h + src/common/tuklib_cpucores.h + src/common/tuklib_integer.h + src/common/tuklib_physmem.h + src/liblzma/api/lzma.h + src/liblzma/api/lzma/base.h + src/liblzma/api/lzma/bcj.h + src/liblzma/api/lzma/block.h + src/liblzma/api/lzma/check.h + src/liblzma/api/lzma/container.h + src/liblzma/api/lzma/delta.h + src/liblzma/api/lzma/filter.h + src/liblzma/api/lzma/hardware.h + src/liblzma/api/lzma/index.h + src/liblzma/api/lzma/index_hash.h + src/liblzma/api/lzma/lzma12.h + src/liblzma/api/lzma/stream_flags.h + src/liblzma/api/lzma/version.h + src/liblzma/api/lzma/vli.h + src/liblzma/check/check.h + src/liblzma/check/crc32_table_be.h + src/liblzma/check/crc32_table_le.h + src/liblzma/check/crc64_table_be.h + src/liblzma/check/crc64_table_le.h + src/liblzma/check/crc_macros.h + src/liblzma/common/alone_decoder.h + src/liblzma/common/block_buffer_encoder.h + src/liblzma/common/block_decoder.h + src/liblzma/common/block_encoder.h + src/liblzma/common/common.h + src/liblzma/common/easy_preset.h + src/liblzma/common/filter_common.h + src/liblzma/common/filter_decoder.h + src/liblzma/common/filter_encoder.h + src/liblzma/common/index.h + src/liblzma/common/index_encoder.h + src/liblzma/common/memcmplen.h + src/liblzma/common/outqueue.h + src/liblzma/common/stream_decoder.h + src/liblzma/common/stream_flags_common.h + src/liblzma/delta/delta_common.h + src/liblzma/delta/delta_decoder.h + src/liblzma/delta/delta_encoder.h + src/liblzma/delta/delta_private.h + src/liblzma/lzma/fastpos.h + src/liblzma/lzma/lzma2_decoder.h + src/liblzma/lzma/lzma2_encoder.h + src/liblzma/lzma/lzma_common.h + src/liblzma/lzma/lzma_decoder.h + src/liblzma/lzma/lzma_encoder.h + src/liblzma/lzma/lzma_encoder_private.h + src/liblzma/lz/lz_decoder.h + src/liblzma/lz/lz_encoder.h + src/liblzma/lz/lz_encoder_hash.h + src/liblzma/lz/lz_encoder_hash_table.h + src/liblzma/rangecoder/price.h + src/liblzma/rangecoder/range_common.h + src/liblzma/rangecoder/range_decoder.h + src/liblzma/rangecoder/range_encoder.h + src/liblzma/simple/simple_coder.h + src/liblzma/simple/simple_decoder.h + src/liblzma/simple/simple_encoder.h + src/liblzma/simple/simple_private.h + windows/vs2017/config.h +) + +target_include_directories(lzma + PRIVATE + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + INTERFACE + $ + PUBLIC + $ +) + +target_compile_definitions(lzma + PRIVATE + _CRT_SECURE_NO_WARNINGS + _CRT_STDC_NO_DEPRECATE + HAVE_CONFIG_H +) + +include(CMakePackageConfigHelpers) +write_basic_package_version_file( + ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config-version.cmake + VERSION ${PROJECT_VERSION} + COMPATIBILITY AnyNewerVersion +) + +install(TARGETS lzma EXPORT lzma + RUNTIME DESTINATION bin + ARCHIVE DESTINATION lib + LIBRARY DESTINATION lib +) + +install(DIRECTORY + ${CMAKE_CURRENT_SOURCE_DIR}/src/liblzma/api/ + DESTINATION include +) + +install(EXPORT lzma + FILE + ${PROJECT_NAME}.cmake + NAMESPACE + ${PROJECT_NAME}:: + DESTINATION + lib/cmake/${PROJECT_NAME} +) + +install(FILES + cmake/${PROJECT_NAME}-config.cmake + ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config-version.cmake + DESTINATION + lib/cmake/${PROJECT_NAME} +) + +export(TARGETS lzma + FILE + ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config.cmake + NAMESPACE ${PROJECT_NAME}:: +) diff --git a/depends/windows/xz-utils/xz-utils.sha256 b/depends/windows/xz-utils/xz-utils.sha256 new file mode 100644 index 00000000..ddd8e80e --- /dev/null +++ b/depends/windows/xz-utils/xz-utils.sha256 @@ -0,0 +1 @@ +9717ae363760dedf573dad241420c5fea86256b65bc21d2cf71b2b12f0544f4b diff --git a/depends/windows/xz-utils/xz-utils.txt b/depends/windows/xz-utils/xz-utils.txt new file mode 100644 index 00000000..27f957f9 --- /dev/null +++ b/depends/windows/xz-utils/xz-utils.txt @@ -0,0 +1 @@ +xz-utils https://tukaani.org/xz/xz-5.2.4.tar.xz diff --git a/depends/windowsstore/xz-utils/01-add-xz-config.cmake.patch b/depends/windowsstore/xz-utils/01-add-xz-config.cmake.patch new file mode 100644 index 00000000..b53b3acc --- /dev/null +++ b/depends/windowsstore/xz-utils/01-add-xz-config.cmake.patch @@ -0,0 +1,4 @@ +--- /dev/null ++++ b/cmake/xz-config.cmake +@@ -0,0 +1 @@ ++include(${CMAKE_CURRENT_LIST_DIR}/xz.cmake) diff --git a/depends/windowsstore/xz-utils/CMakeLists.txt b/depends/windowsstore/xz-utils/CMakeLists.txt new file mode 100644 index 00000000..0e46397f --- /dev/null +++ b/depends/windowsstore/xz-utils/CMakeLists.txt @@ -0,0 +1,218 @@ +cmake_minimum_required(VERSION 3.2) + +project(xz VERSION 5.3.0 LANGUAGES C) + +if(MSVC) + set(CMAKE_DEBUG_POSTFIX "d") +endif() + +add_library(lzma + src/common/tuklib_cpucores.c + src/common/tuklib_physmem.c + src/liblzma/check/check.c + src/liblzma/check/crc32_fast.c + src/liblzma/check/crc32_table.c + src/liblzma/check/crc64_fast.c + src/liblzma/check/crc64_table.c + src/liblzma/check/sha256.c + src/liblzma/common/alone_decoder.c + src/liblzma/common/alone_encoder.c + src/liblzma/common/auto_decoder.c + src/liblzma/common/block_buffer_decoder.c + src/liblzma/common/block_buffer_encoder.c + src/liblzma/common/block_decoder.c + src/liblzma/common/block_encoder.c + src/liblzma/common/block_header_decoder.c + src/liblzma/common/block_header_encoder.c + src/liblzma/common/block_util.c + src/liblzma/common/common.c + src/liblzma/common/easy_buffer_encoder.c + src/liblzma/common/easy_decoder_memusage.c + src/liblzma/common/easy_encoder.c + src/liblzma/common/easy_encoder_memusage.c + src/liblzma/common/easy_preset.c + src/liblzma/common/filter_buffer_decoder.c + src/liblzma/common/filter_buffer_encoder.c + src/liblzma/common/filter_common.c + src/liblzma/common/filter_decoder.c + src/liblzma/common/filter_encoder.c + src/liblzma/common/filter_flags_decoder.c + src/liblzma/common/filter_flags_encoder.c + src/liblzma/common/hardware_cputhreads.c + src/liblzma/common/hardware_physmem.c + src/liblzma/common/index.c + src/liblzma/common/index_decoder.c + src/liblzma/common/index_encoder.c + src/liblzma/common/index_hash.c + src/liblzma/common/outqueue.c + src/liblzma/common/stream_buffer_decoder.c + src/liblzma/common/stream_buffer_encoder.c + src/liblzma/common/stream_decoder.c + src/liblzma/common/stream_encoder.c + src/liblzma/common/stream_encoder_mt.c + src/liblzma/common/stream_flags_common.c + src/liblzma/common/stream_flags_decoder.c + src/liblzma/common/stream_flags_encoder.c + src/liblzma/common/vli_decoder.c + src/liblzma/common/vli_encoder.c + src/liblzma/common/vli_size.c + src/liblzma/delta/delta_common.c + src/liblzma/delta/delta_decoder.c + src/liblzma/delta/delta_encoder.c + src/liblzma/lzma/fastpos_table.c + src/liblzma/lzma/lzma2_decoder.c + src/liblzma/lzma/lzma2_encoder.c + src/liblzma/lzma/lzma_decoder.c + src/liblzma/lzma/lzma_encoder.c + src/liblzma/lzma/lzma_encoder_optimum_fast.c + src/liblzma/lzma/lzma_encoder_optimum_normal.c + src/liblzma/lzma/lzma_encoder_presets.c + src/liblzma/lz/lz_decoder.c + src/liblzma/lz/lz_encoder.c + src/liblzma/lz/lz_encoder_mf.c + src/liblzma/rangecoder/price_table.c + src/liblzma/simple/arm.c + src/liblzma/simple/armthumb.c + src/liblzma/simple/ia64.c + src/liblzma/simple/powerpc.c + src/liblzma/simple/simple_coder.c + src/liblzma/simple/simple_decoder.c + src/liblzma/simple/simple_encoder.c + src/liblzma/simple/sparc.c + src/liblzma/simple/x86.c + src/common/mythread.h + src/common/sysdefs.h + src/common/tuklib_common.h + src/common/tuklib_config.h + src/common/tuklib_cpucores.h + src/common/tuklib_integer.h + src/common/tuklib_physmem.h + src/liblzma/api/lzma.h + src/liblzma/api/lzma/base.h + src/liblzma/api/lzma/bcj.h + src/liblzma/api/lzma/block.h + src/liblzma/api/lzma/check.h + src/liblzma/api/lzma/container.h + src/liblzma/api/lzma/delta.h + src/liblzma/api/lzma/filter.h + src/liblzma/api/lzma/hardware.h + src/liblzma/api/lzma/index.h + src/liblzma/api/lzma/index_hash.h + src/liblzma/api/lzma/lzma12.h + src/liblzma/api/lzma/stream_flags.h + src/liblzma/api/lzma/version.h + src/liblzma/api/lzma/vli.h + src/liblzma/check/check.h + src/liblzma/check/crc32_table_be.h + src/liblzma/check/crc32_table_le.h + src/liblzma/check/crc64_table_be.h + src/liblzma/check/crc64_table_le.h + src/liblzma/check/crc_macros.h + src/liblzma/common/alone_decoder.h + src/liblzma/common/block_buffer_encoder.h + src/liblzma/common/block_decoder.h + src/liblzma/common/block_encoder.h + src/liblzma/common/common.h + src/liblzma/common/easy_preset.h + src/liblzma/common/filter_common.h + src/liblzma/common/filter_decoder.h + src/liblzma/common/filter_encoder.h + src/liblzma/common/index.h + src/liblzma/common/index_encoder.h + src/liblzma/common/memcmplen.h + src/liblzma/common/outqueue.h + src/liblzma/common/stream_decoder.h + src/liblzma/common/stream_flags_common.h + src/liblzma/delta/delta_common.h + src/liblzma/delta/delta_decoder.h + src/liblzma/delta/delta_encoder.h + src/liblzma/delta/delta_private.h + src/liblzma/lzma/fastpos.h + src/liblzma/lzma/lzma2_decoder.h + src/liblzma/lzma/lzma2_encoder.h + src/liblzma/lzma/lzma_common.h + src/liblzma/lzma/lzma_decoder.h + src/liblzma/lzma/lzma_encoder.h + src/liblzma/lzma/lzma_encoder_private.h + src/liblzma/lz/lz_decoder.h + src/liblzma/lz/lz_encoder.h + src/liblzma/lz/lz_encoder_hash.h + src/liblzma/lz/lz_encoder_hash_table.h + src/liblzma/rangecoder/price.h + src/liblzma/rangecoder/range_common.h + src/liblzma/rangecoder/range_decoder.h + src/liblzma/rangecoder/range_encoder.h + src/liblzma/simple/simple_coder.h + src/liblzma/simple/simple_decoder.h + src/liblzma/simple/simple_encoder.h + src/liblzma/simple/simple_private.h + windows/vs2017/config.h +) + +target_include_directories(lzma + PRIVATE + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + $ + INTERFACE + $ + PUBLIC + $ +) + +target_compile_definitions(lzma + PRIVATE + _CRT_SECURE_NO_WARNINGS + _CRT_STDC_NO_DEPRECATE + HAVE_CONFIG_H +) + +include(CMakePackageConfigHelpers) +write_basic_package_version_file( + ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config-version.cmake + VERSION ${PROJECT_VERSION} + COMPATIBILITY AnyNewerVersion +) + +install(TARGETS lzma EXPORT lzma + RUNTIME DESTINATION bin + ARCHIVE DESTINATION lib + LIBRARY DESTINATION lib +) + +install(DIRECTORY + ${CMAKE_CURRENT_SOURCE_DIR}/src/liblzma/api/ + DESTINATION include +) + +install(EXPORT lzma + FILE + ${PROJECT_NAME}.cmake + NAMESPACE + ${PROJECT_NAME}:: + DESTINATION + lib/cmake/${PROJECT_NAME} +) + +install(FILES + cmake/${PROJECT_NAME}-config.cmake + ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config-version.cmake + DESTINATION + lib/cmake/${PROJECT_NAME} +) + +export(TARGETS lzma + FILE + ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config.cmake + NAMESPACE ${PROJECT_NAME}:: +) diff --git a/depends/windowsstore/xz-utils/xz-utils.sha256 b/depends/windowsstore/xz-utils/xz-utils.sha256 new file mode 100644 index 00000000..ddd8e80e --- /dev/null +++ b/depends/windowsstore/xz-utils/xz-utils.sha256 @@ -0,0 +1 @@ +9717ae363760dedf573dad241420c5fea86256b65bc21d2cf71b2b12f0544f4b diff --git a/depends/windowsstore/xz-utils/xz-utils.txt b/depends/windowsstore/xz-utils/xz-utils.txt new file mode 100644 index 00000000..27f957f9 --- /dev/null +++ b/depends/windowsstore/xz-utils/xz-utils.txt @@ -0,0 +1 @@ +xz-utils https://tukaani.org/xz/xz-5.2.4.tar.xz From ed1fff169fe6422e3f77525a6a799677bc95c2e3 Mon Sep 17 00:00:00 2001 From: Alwin Esch Date: Wed, 22 Jan 2020 09:44:25 +0000 Subject: [PATCH 08/23] force zlib to install pkgconfig in lib --- .../common/zlib/03-install-pkgconfig-in-lib.patch | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 depends/common/zlib/03-install-pkgconfig-in-lib.patch diff --git a/depends/common/zlib/03-install-pkgconfig-in-lib.patch b/depends/common/zlib/03-install-pkgconfig-in-lib.patch new file mode 100644 index 00000000..9c9be0f2 --- /dev/null +++ b/depends/common/zlib/03-install-pkgconfig-in-lib.patch @@ -0,0 +1,12 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -12,7 +12,7 @@ set(INSTALL_BIN_DIR "${CMAKE_INSTALL_PREFIX}/bin" CACHE PATH "Installation direc + set(INSTALL_LIB_DIR "${CMAKE_INSTALL_PREFIX}/lib" CACHE PATH "Installation directory for libraries") + set(INSTALL_INC_DIR "${CMAKE_INSTALL_PREFIX}/include" CACHE PATH "Installation directory for headers") + set(INSTALL_MAN_DIR "${CMAKE_INSTALL_PREFIX}/share/man" CACHE PATH "Installation directory for manual pages") +-set(INSTALL_PKGCONFIG_DIR "${CMAKE_INSTALL_PREFIX}/share/pkgconfig" CACHE PATH "Installation directory for pkgconfig (.pc) files") ++set(INSTALL_PKGCONFIG_DIR "${CMAKE_INSTALL_PREFIX}/lib/pkgconfig" CACHE PATH "Installation directory for pkgconfig (.pc) files") + + include(CheckTypeSize) + include(CheckFunctionExists) + From 81214c9948e1cb85026078c2ac164158cfbf7c26 Mon Sep 17 00:00:00 2001 From: Alwin Esch Date: Sun, 26 Jan 2020 14:02:04 +0100 Subject: [PATCH 09/23] add gas-preprocessor to help ffmpeg with iOS and Windows ARM build --- .../gas-preprocessor/01-fix-vs-use.patch | 21 +++++++++++++++++++ .../common/gas-preprocessor/CMakeLists.txt | 4 ++++ .../gas-preprocessor/gas-preprocessor.sha256 | 1 + .../gas-preprocessor/gas-preprocessor.txt | 1 + 4 files changed, 27 insertions(+) create mode 100644 depends/common/gas-preprocessor/01-fix-vs-use.patch create mode 100644 depends/common/gas-preprocessor/CMakeLists.txt create mode 100644 depends/common/gas-preprocessor/gas-preprocessor.sha256 create mode 100644 depends/common/gas-preprocessor/gas-preprocessor.txt diff --git a/depends/common/gas-preprocessor/01-fix-vs-use.patch b/depends/common/gas-preprocessor/01-fix-vs-use.patch new file mode 100644 index 00000000..e1488166 --- /dev/null +++ b/depends/common/gas-preprocessor/01-fix-vs-use.patch @@ -0,0 +1,21 @@ +Fix by use on Visual Studio values "-w..." or "-FS" +--- a/gas-preprocessor.pl ++++ b/gas-preprocessor.pl +@@ -163,6 +163,8 @@ if ($as_type ne "armasm") { + @preprocess_c_cmd = grep ! /^-EHsc$/, @preprocess_c_cmd; + @preprocess_c_cmd = grep ! /^-O/, @preprocess_c_cmd; + @preprocess_c_cmd = grep ! /^-oldit/, @preprocess_c_cmd; ++ @preprocess_c_cmd = grep ! /^-FS/, @preprocess_c_cmd; ++ @preprocess_c_cmd = grep ! /^-w/, @preprocess_c_cmd; + + @gcc_cmd = grep ! /^-G/, @gcc_cmd; + @gcc_cmd = grep ! /^-W/, @gcc_cmd; +@@ -170,6 +172,8 @@ if ($as_type ne "armasm") { + @gcc_cmd = grep ! /^-fp/, @gcc_cmd; + @gcc_cmd = grep ! /^-EHsc$/, @gcc_cmd; + @gcc_cmd = grep ! /^-O/, @gcc_cmd; ++ @gcc_cmd = grep ! /^-FS/, @gcc_cmd; ++ @gcc_cmd = grep ! /^-w/, @gcc_cmd; + + my @outfiles = grep /\.(o|obj)$/, @gcc_cmd; + $tempfile = $outfiles[0].".asm"; diff --git a/depends/common/gas-preprocessor/CMakeLists.txt b/depends/common/gas-preprocessor/CMakeLists.txt new file mode 100644 index 00000000..3dfb9926 --- /dev/null +++ b/depends/common/gas-preprocessor/CMakeLists.txt @@ -0,0 +1,4 @@ +cmake_minimum_required(VERSION 3.5) +project(gas-preprocessor) + +install(PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/gas-preprocessor.pl DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) diff --git a/depends/common/gas-preprocessor/gas-preprocessor.sha256 b/depends/common/gas-preprocessor/gas-preprocessor.sha256 new file mode 100644 index 00000000..66a5c783 --- /dev/null +++ b/depends/common/gas-preprocessor/gas-preprocessor.sha256 @@ -0,0 +1 @@ +a08d5bd3d4f1c4959853515c669e9143d9c581c21c73f87f6bafff10bfb0d426 diff --git a/depends/common/gas-preprocessor/gas-preprocessor.txt b/depends/common/gas-preprocessor/gas-preprocessor.txt new file mode 100644 index 00000000..5a91d1cb --- /dev/null +++ b/depends/common/gas-preprocessor/gas-preprocessor.txt @@ -0,0 +1 @@ +gas-preprocessor https://github.com/libav/gas-preprocessor/archive/d09971fad329d32df19f5bbafe88cf2f0ed04ed7.tar.gz From ef7dc48e6b1629d01b26d8c5fb7069ff0687939e Mon Sep 17 00:00:00 2001 From: Alwin Esch Date: Sun, 26 Jan 2020 14:03:17 +0100 Subject: [PATCH 10/23] add mingw (needed fo ffmpeg build) to windows depends --- .../mingw/01-MinGWConfig.cmake.in.patch | 119 ++++++++++++++++++ depends/windows/mingw/02-caller.sh.patch | 119 ++++++++++++++++++ depends/windows/mingw/CMakeLists.txt | 47 +++++++ depends/windows/mingw/mingw.sha256 | 1 + depends/windows/mingw/mingw.txt | 1 + .../mingw/01-MinGWConfig.cmake.in.patch | 119 ++++++++++++++++++ depends/windowsstore/mingw/02-caller.sh.patch | 119 ++++++++++++++++++ depends/windowsstore/mingw/CMakeLists.txt | 47 +++++++ depends/windowsstore/mingw/mingw.sha256 | 1 + depends/windowsstore/mingw/mingw.txt | 1 + 10 files changed, 574 insertions(+) create mode 100644 depends/windows/mingw/01-MinGWConfig.cmake.in.patch create mode 100644 depends/windows/mingw/02-caller.sh.patch create mode 100644 depends/windows/mingw/CMakeLists.txt create mode 100644 depends/windows/mingw/mingw.sha256 create mode 100644 depends/windows/mingw/mingw.txt create mode 100644 depends/windowsstore/mingw/01-MinGWConfig.cmake.in.patch create mode 100644 depends/windowsstore/mingw/02-caller.sh.patch create mode 100644 depends/windowsstore/mingw/CMakeLists.txt create mode 100644 depends/windowsstore/mingw/mingw.sha256 create mode 100644 depends/windowsstore/mingw/mingw.txt diff --git a/depends/windows/mingw/01-MinGWConfig.cmake.in.patch b/depends/windows/mingw/01-MinGWConfig.cmake.in.patch new file mode 100644 index 00000000..541e2d45 --- /dev/null +++ b/depends/windows/mingw/01-MinGWConfig.cmake.in.patch @@ -0,0 +1,119 @@ +--- /dev/null ++++ b/MinGWConfig.cmake.in +@@ -0,0 +1,116 @@ ++# The from build defined Path where bash.exe is found ++set(MINGW_BASH_DIR @CMAKE_CURRENT_SOURCE_DIR@/usr/bin) ++ ++# @brief Translate on ${WINDOWS_PATH_ENTRY} defined content to Mingw path style ++macro(MinGW_convertPathToPosix) ++ set(POSIX_PATH "") ++ if(WINDOWS_PATH) ++ foreach(WINDOWS_PATH_ENTRY IN ITEMS ${WINDOWS_PATH}) ++ string(REGEX MATCH "^(.*:)" DRIVE_NAME ${WINDOWS_PATH_ENTRY}) ++ string(TOLOWER ${DRIVE_NAME} DRIVE_NAME) ++ string(REPLACE "\\" "/" WINDOWS_PATH_ENTRY ${WINDOWS_PATH_ENTRY}) ++ string(REGEX REPLACE "^(.*:)" "" PATH_NAME ${WINDOWS_PATH_ENTRY}) ++ set(VALUES "${DRIVE_NAME}${PATH_NAME}") ++ string(REGEX REPLACE "^([a-zA-Z]):\/" "/\\1/" VALUES ${VALUES}) ++ if(NOT POSIX_PATH) ++ set(POSIX_PATH "${VALUES}") ++ else() ++ set(POSIX_PATH "${POSIX_PATH}:${VALUES}") ++ endif() ++ endforeach() ++ endif() ++endmacro() ++ ++# @brief Change on given FLAGS the slash (/) to a minus (-), ++# Mingw interprets this as a path and everything goes wrong then. ++function(MinGW_ChangeSlashToMinus FLAGS) ++ if(FLAGS) ++ string(REPLACE " " ";" FLAGS ${FLAGS}) ++ set(VALUES "") ++ foreach(flag IN LISTS FLAGS) ++ string(REGEX REPLACE "^[\/]([a-zA-Z])" "-\\1" flag ${flag}) ++ set(VALUES "${VALUES} ${flag}") ++ endforeach() ++ set(FLAGS ${VALUES} PARENT_SCOPE) ++ endif() ++endfunction() ++ ++if($ENV{PROCESSOR_ARCHITECTURE} MATCHES "AMD64" OR ++ $ENV{PROCESSOR_ARCHITECTURE} MATCHES "IA64") ++ set(MINGW_CPU_ARCH "x86_64") ++else() ++ set(MINGW_CPU_ARCH "i686") ++endif() ++ ++include(CheckSymbolExists) ++check_symbol_exists(_X86_ "Windows.h" _X86_) ++check_symbol_exists(_AMD64_ "Windows.h" _AMD64_) ++check_symbol_exists(_ARM_ "Windows.h" _ARM_) ++check_symbol_exists(_ARM64_ "Windows.h" _ARM64_) ++ ++if(_X86_) ++ set(MINGW_TARGET_ARCH "x86") ++elseif(_AMD64_) ++ set(MINGW_TARGET_ARCH "x86_64") ++elseif(_ARM_) ++ set(MINGW_TARGET_ARCH "arm") ++elseif(_ARM64_) ++ set(MINGW_TARGET_ARCH "arm64") ++else() ++ message(FATAL_ERROR "Unsupported architecture") ++endif() ++ ++# Source folder to mingw allowed folder ++set(WINDOWS_PATH ${CMAKE_SOURCE_DIR}) ++MinGW_convertPathToPosix() ++set(MINGW_SOURCE_DIR ${POSIX_PATH}) ++ ++# Install folder to mingw allowed folder ++set(WINDOWS_PATH ${CMAKE_INSTALL_PREFIX}) ++MinGW_convertPathToPosix() ++set(MINGW_INSTALL_PREFIX ${POSIX_PATH}) ++ ++# Binary build folder to mingw allowed folder ++set(WINDOWS_PATH ${CMAKE_BINARY_DIR}) ++MinGW_convertPathToPosix() ++set(MINGW_BUILD_DIRECTORY ${POSIX_PATH}) ++ ++# Environment binary folder to mingw allowed folder ++set(WINDOWS_PATH $ENV{PATH}) ++MinGW_convertPathToPosix() ++set(MINGW_ENV_PATH ${POSIX_PATH}) ++ ++# Environment include folder to mingw allowed folder ++set(WINDOWS_PATH $ENV{INCLUDE}) ++MinGW_convertPathToPosix() ++set(MINGW_INCLUDE ${POSIX_PATH}) ++ ++# Environment lib folder to mingw allowed folder ++set(WINDOWS_PATH $ENV{LIB}) ++MinGW_convertPathToPosix() ++set(MINGW_LIB ${POSIX_PATH}) ++ ++# Enviroonment lib path folder to mingw allowed folder ++set(WINDOWS_PATH $ENV{LIBPATH}) ++MinGW_convertPathToPosix() ++set(MINGW_LIBPATH ${POSIX_PATH}) ++ ++# @brief Main define to use on depends by builds to have it running within Mingw ++set(MINGW_CALL cmake -E chdir ${CMAKE_SOURCE_DIR} ++ ${MINGW_BASH_DIR}/bash.exe --login ${MINGW_INSTALL_PREFIX}/caller.sh ++ --source [DQ]${MINGW_SOURCE_DIR}[DQ] -- ) ++ ++# Write path configuration file to addon build (used to add by Mingw paths) ++set(MINGW_CONTROL "\ ++MINGW_ENV_PATH=\"${MINGW_ENV_PATH}\" ++MINGW_INCLUDE=\"${MINGW_INCLUDE}\" ++MINGW_LIB=\"${MINGW_LIB}\" ++MINGW_LIBPATH=\"${MINGW_LIBPATH}\" ++MINGW_BASH_DIR=\"${MINGW_BASH_DIR}\" ++MINGW_SOURCE_DIR=\"${MINGW_SOURCE_DIR}\" ++MINGW_BUILD_DIRECTORY=\"${MINGW_BUILD_DIRECTORY}\" ++MINGW_CPU_ARCH=\"${MINGW_CPU_ARCH}\" ++MINGW_TARGET_ARCH=\"${MINGW_TARGET_ARCH}\" ++MINGW_INSTALL_PREFIX=\"${MINGW_INSTALL_PREFIX}\" ++") ++file(WRITE ${CMAKE_SOURCE_DIR}/mingw.conf ${MINGW_CONTROL}) diff --git a/depends/windows/mingw/02-caller.sh.patch b/depends/windows/mingw/02-caller.sh.patch new file mode 100644 index 00000000..ded26c47 --- /dev/null +++ b/depends/windows/mingw/02-caller.sh.patch @@ -0,0 +1,119 @@ +--- /dev/null ++++ b/caller.sh +@@ -0,0 +1,116@@ ++#!/usr/bin/env bash ++ ++# usage function ++function usage() ++{ ++ cat << HEREDOC ++ ++ Usage: $progname --source PATH [--config FILE] -- Follow process code ++ ++ optional arguments: ++ -h, --help show this help message and exit ++ -c, --config FILE path where the configs for this build (if empty ++ source dir is used) ++ -s, --source PATH path where the source is places ++ ++HEREDOC ++} ++ ++# initialize variables ++DOUBLE_QUOTES_PSEUDO="\[DQ\]" ++DOUBLE_QUOTES="\"" ++ ++progname=$(basename $0) ++source_path= ++config_path= ++ ++# Change pseudo double quote to right one (cmake ExternalProject fix where not ++# give them correct) ++set -- `echo $@ | sed -e "s/$DOUBLE_QUOTES_PSEUDO/$DOUBLE_QUOTES/g"` ++ ++# use getopt and store the output into $OPTS ++# note the use of -o for the short options, --long for the long name options ++# and a : for any option that takes a parameter ++OPTS=$(getopt -o "hs:c:v" --long "help,source:,config:,verbose,dry-run" -n "$progname" -- "$@") ++if [ $? != 0 ] ; then echo "Error in command line arguments." >&2 ; usage; exit 1 ; fi ++eval set -- "$OPTS" ++ ++while true; do ++ # uncomment the next line to see how shift is working ++ # echo "\$1:\"$1\" \$2:\"$2\"" ++ case "$1" in ++ -h | --help ) usage; exit; ;; ++ -c | --config ) config_path=$(echo $2 | tr -d '"'); shift 2 ;; ++ -s | --source ) source_path=$(echo $2 | tr -d '"'); shift 2 ;; ++ --dry-run ) dryrun=1; shift ;; ++ -v | --verbose ) verbose=$((verbose + 1)); shift ;; ++ -- ) shift; break ;; ++ * ) break ;; ++ esac ++done ++ ++if [ -z $source_path ]; then ++ echo "ERROR: Source path is needed to set" ++ exit 1 ++fi ++if [ ! -d $source_path ]; then ++ echo "ERROR: Given source path '$source_path' not exist" ++ exit 1 ++fi ++ ++if [ -z $config_path ]; then ++ config_path="$source_path/mingw.conf" ++fi ++if [ ! -f $config_path ]; then ++ echo "ERROR: Given config file '$config_path' not exist" ++ exit 1 ++fi ++ ++. "$config_path" ++ ++ # print out all the parameters we read in ++ cat <<-EOM ++ Mingw build: ++ ----------------------------------------------------------------------------- ++ Source path = "$source_path" ++ Config file = "$config_path" ++ MinGW OS = $MINGW_CPU_ARCH ++ Target OS = $MINGW_TARGET_ARCH ++ Command = "$@" ++EOM ++ ++CALLCMD=$@ ++ ++set -a ++ ++CC="${CC:-$MINGW_CPU_ARCH-w64-mingw32-gcc}" ++CXX="${CXX:-$MINGW_CPU_ARCH-w64-mingw32-g++}" ++LD="${LD:-$MINGW_CPU_ARCH-w64-mingw32-ld}" ++AR="${AR:-$MINGW_CPU_ARCH-w64-mingw32-ar}" ++CCAS="${CCAS:-$MINGW_CPU_ARCH-w64-mingw32-gcc -c}" ++RANLIB="${RANLIB:-$MINGW_CPU_ARCH-w64-mingw32-ranlib}" ++STRIP="${STRIP:-$MINGW_CPU_ARCH-w64-mingw32-strip}" ++CPPFLAGS="${CPPFLAGS:--I$MINGW_INSTALL_PREFIX/include $CPPFLAGS}" ++CFLAGS="${CFLAGS:--I$MINGW_INSTALL_PREFIX/include -g -O2 $CFLAGS}" ++CXXFLAGS="${CXXFLAGS:--I$MINGW_INSTALL_PREFIX/include -g -O2 $CXXFLAGS}" ++LDFLAGS="${LDFLAGS:--L$MINGW_INSTALL_PREFIX/lib $LDFLAGS}" ++ ++# Set the paths ++PATH=$PATH:$MINGW_ENV_PATH ++if [[ $MINGW_CPU_ARCH == "x86_64" ]]; then ++ PATH=/mingw64/bin:$PATH ++else ++ PATH=/mingw32/bin:$PATH ++fi ++PATH=/opt/$MINGW_CPU_ARCH-w64-mingw32/bin:$PATH ++PATH=/opt/bin:$PATH ++PATH=$__VSCMD_PREINIT_PATH:$PATH ++PATH=$MINGW_INSTALL_PREFIX/bin:$PATH ++# INCLUDE=$MINGW_INCLUDE ++# LIB=$MINGW_LIB ++# LIBPATH=$MINGW_LIBPATH ++PKG_CONFIG_PATH=$MINGW_INSTALL_PREFIX/lib/pkgconfig:$PKG_CONFIG_PATH ++ ++# Call given commands ++cd $source_path ++eval $CALLCMD diff --git a/depends/windows/mingw/CMakeLists.txt b/depends/windows/mingw/CMakeLists.txt new file mode 100644 index 00000000..6b53796b --- /dev/null +++ b/depends/windows/mingw/CMakeLists.txt @@ -0,0 +1,47 @@ +cmake_minimum_required(VERSION 3.5) +project(mingw) + +# Currently unused (our mirrors bring some download problems for Msys2) +if(0) + foreach(repo msys mingw32 mingw64) + if(${repo} STREQUAL msys) + file(WRITE ${CMAKE_CURRENT_SOURCE_DIR}/etc/pacman.d/mirrorlist.${repo} "Server = http://mirrors.kodi.tv/build-deps/win32/msys2/repos/${repo}2/$arch\n") + else() + file(WRITE ${CMAKE_CURRENT_SOURCE_DIR}/etc/pacman.d/mirrorlist.${repo} "Server = http://mirrors.kodi.tv/build-deps/win32/msys2/repos/${repo}\n") + endif() + endforeach() +endif() + +if($ENV{PROCESSOR_ARCHITECTURE} MATCHES "AMD64" OR + $ENV{PROCESSOR_ARCHITECTURE} MATCHES "IA64") + set(HOST mingw-w64-x86_64) + set(MINGW_PATH "mingw64") +else() + set(HOST mingw-w64-i686) + set(MINGW_PATH "mingw32") +endif() + +execute_process(COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/usr/bin/bash.exe --login -c + "pacman-key --init" ERROR_QUIET) +execute_process(COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/usr/bin/bash.exe --login -c + "pacman --noconfirm -S mingw-w64-cross-binutils \ + ${HOST}-gcc ${HOST}-lua \ + ${HOST}-headers \ + make \ + autoconf \ + automake \ + libtool \ + pkg-config \ + nasm \ + yasm \ + patch") + +file(GLOB_RECURSE shared_libs ${CMAKE_CURRENT_SOURCE_DIR}/${MINGW_PATH}/*.dll.a) +if(shared_libs) + file(REMOVE ${shared_libs}) +endif() + +configure_file(MinGWConfig.cmake.in MinGWConfig.cmake @ONLY) + +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/MinGWConfig.cmake DESTINATION ${CMAKE_INSTALL_PREFIX}) +install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/caller.sh DESTINATION ${CMAKE_INSTALL_PREFIX}) diff --git a/depends/windows/mingw/mingw.sha256 b/depends/windows/mingw/mingw.sha256 new file mode 100644 index 00000000..fe7f0962 --- /dev/null +++ b/depends/windows/mingw/mingw.sha256 @@ -0,0 +1 @@ +bb1f1a0b35b3d96bf9c15092da8ce969a84a134f7b08811292fbc9d84d48c65d diff --git a/depends/windows/mingw/mingw.txt b/depends/windows/mingw/mingw.txt new file mode 100644 index 00000000..3fddb030 --- /dev/null +++ b/depends/windows/mingw/mingw.txt @@ -0,0 +1 @@ +mingw http://mirrors.kodi.tv/build-deps/win32/msys2/msys2-base-x86_64-20161025.tar.xz diff --git a/depends/windowsstore/mingw/01-MinGWConfig.cmake.in.patch b/depends/windowsstore/mingw/01-MinGWConfig.cmake.in.patch new file mode 100644 index 00000000..541e2d45 --- /dev/null +++ b/depends/windowsstore/mingw/01-MinGWConfig.cmake.in.patch @@ -0,0 +1,119 @@ +--- /dev/null ++++ b/MinGWConfig.cmake.in +@@ -0,0 +1,116 @@ ++# The from build defined Path where bash.exe is found ++set(MINGW_BASH_DIR @CMAKE_CURRENT_SOURCE_DIR@/usr/bin) ++ ++# @brief Translate on ${WINDOWS_PATH_ENTRY} defined content to Mingw path style ++macro(MinGW_convertPathToPosix) ++ set(POSIX_PATH "") ++ if(WINDOWS_PATH) ++ foreach(WINDOWS_PATH_ENTRY IN ITEMS ${WINDOWS_PATH}) ++ string(REGEX MATCH "^(.*:)" DRIVE_NAME ${WINDOWS_PATH_ENTRY}) ++ string(TOLOWER ${DRIVE_NAME} DRIVE_NAME) ++ string(REPLACE "\\" "/" WINDOWS_PATH_ENTRY ${WINDOWS_PATH_ENTRY}) ++ string(REGEX REPLACE "^(.*:)" "" PATH_NAME ${WINDOWS_PATH_ENTRY}) ++ set(VALUES "${DRIVE_NAME}${PATH_NAME}") ++ string(REGEX REPLACE "^([a-zA-Z]):\/" "/\\1/" VALUES ${VALUES}) ++ if(NOT POSIX_PATH) ++ set(POSIX_PATH "${VALUES}") ++ else() ++ set(POSIX_PATH "${POSIX_PATH}:${VALUES}") ++ endif() ++ endforeach() ++ endif() ++endmacro() ++ ++# @brief Change on given FLAGS the slash (/) to a minus (-), ++# Mingw interprets this as a path and everything goes wrong then. ++function(MinGW_ChangeSlashToMinus FLAGS) ++ if(FLAGS) ++ string(REPLACE " " ";" FLAGS ${FLAGS}) ++ set(VALUES "") ++ foreach(flag IN LISTS FLAGS) ++ string(REGEX REPLACE "^[\/]([a-zA-Z])" "-\\1" flag ${flag}) ++ set(VALUES "${VALUES} ${flag}") ++ endforeach() ++ set(FLAGS ${VALUES} PARENT_SCOPE) ++ endif() ++endfunction() ++ ++if($ENV{PROCESSOR_ARCHITECTURE} MATCHES "AMD64" OR ++ $ENV{PROCESSOR_ARCHITECTURE} MATCHES "IA64") ++ set(MINGW_CPU_ARCH "x86_64") ++else() ++ set(MINGW_CPU_ARCH "i686") ++endif() ++ ++include(CheckSymbolExists) ++check_symbol_exists(_X86_ "Windows.h" _X86_) ++check_symbol_exists(_AMD64_ "Windows.h" _AMD64_) ++check_symbol_exists(_ARM_ "Windows.h" _ARM_) ++check_symbol_exists(_ARM64_ "Windows.h" _ARM64_) ++ ++if(_X86_) ++ set(MINGW_TARGET_ARCH "x86") ++elseif(_AMD64_) ++ set(MINGW_TARGET_ARCH "x86_64") ++elseif(_ARM_) ++ set(MINGW_TARGET_ARCH "arm") ++elseif(_ARM64_) ++ set(MINGW_TARGET_ARCH "arm64") ++else() ++ message(FATAL_ERROR "Unsupported architecture") ++endif() ++ ++# Source folder to mingw allowed folder ++set(WINDOWS_PATH ${CMAKE_SOURCE_DIR}) ++MinGW_convertPathToPosix() ++set(MINGW_SOURCE_DIR ${POSIX_PATH}) ++ ++# Install folder to mingw allowed folder ++set(WINDOWS_PATH ${CMAKE_INSTALL_PREFIX}) ++MinGW_convertPathToPosix() ++set(MINGW_INSTALL_PREFIX ${POSIX_PATH}) ++ ++# Binary build folder to mingw allowed folder ++set(WINDOWS_PATH ${CMAKE_BINARY_DIR}) ++MinGW_convertPathToPosix() ++set(MINGW_BUILD_DIRECTORY ${POSIX_PATH}) ++ ++# Environment binary folder to mingw allowed folder ++set(WINDOWS_PATH $ENV{PATH}) ++MinGW_convertPathToPosix() ++set(MINGW_ENV_PATH ${POSIX_PATH}) ++ ++# Environment include folder to mingw allowed folder ++set(WINDOWS_PATH $ENV{INCLUDE}) ++MinGW_convertPathToPosix() ++set(MINGW_INCLUDE ${POSIX_PATH}) ++ ++# Environment lib folder to mingw allowed folder ++set(WINDOWS_PATH $ENV{LIB}) ++MinGW_convertPathToPosix() ++set(MINGW_LIB ${POSIX_PATH}) ++ ++# Enviroonment lib path folder to mingw allowed folder ++set(WINDOWS_PATH $ENV{LIBPATH}) ++MinGW_convertPathToPosix() ++set(MINGW_LIBPATH ${POSIX_PATH}) ++ ++# @brief Main define to use on depends by builds to have it running within Mingw ++set(MINGW_CALL cmake -E chdir ${CMAKE_SOURCE_DIR} ++ ${MINGW_BASH_DIR}/bash.exe --login ${MINGW_INSTALL_PREFIX}/caller.sh ++ --source [DQ]${MINGW_SOURCE_DIR}[DQ] -- ) ++ ++# Write path configuration file to addon build (used to add by Mingw paths) ++set(MINGW_CONTROL "\ ++MINGW_ENV_PATH=\"${MINGW_ENV_PATH}\" ++MINGW_INCLUDE=\"${MINGW_INCLUDE}\" ++MINGW_LIB=\"${MINGW_LIB}\" ++MINGW_LIBPATH=\"${MINGW_LIBPATH}\" ++MINGW_BASH_DIR=\"${MINGW_BASH_DIR}\" ++MINGW_SOURCE_DIR=\"${MINGW_SOURCE_DIR}\" ++MINGW_BUILD_DIRECTORY=\"${MINGW_BUILD_DIRECTORY}\" ++MINGW_CPU_ARCH=\"${MINGW_CPU_ARCH}\" ++MINGW_TARGET_ARCH=\"${MINGW_TARGET_ARCH}\" ++MINGW_INSTALL_PREFIX=\"${MINGW_INSTALL_PREFIX}\" ++") ++file(WRITE ${CMAKE_SOURCE_DIR}/mingw.conf ${MINGW_CONTROL}) diff --git a/depends/windowsstore/mingw/02-caller.sh.patch b/depends/windowsstore/mingw/02-caller.sh.patch new file mode 100644 index 00000000..ded26c47 --- /dev/null +++ b/depends/windowsstore/mingw/02-caller.sh.patch @@ -0,0 +1,119 @@ +--- /dev/null ++++ b/caller.sh +@@ -0,0 +1,116@@ ++#!/usr/bin/env bash ++ ++# usage function ++function usage() ++{ ++ cat << HEREDOC ++ ++ Usage: $progname --source PATH [--config FILE] -- Follow process code ++ ++ optional arguments: ++ -h, --help show this help message and exit ++ -c, --config FILE path where the configs for this build (if empty ++ source dir is used) ++ -s, --source PATH path where the source is places ++ ++HEREDOC ++} ++ ++# initialize variables ++DOUBLE_QUOTES_PSEUDO="\[DQ\]" ++DOUBLE_QUOTES="\"" ++ ++progname=$(basename $0) ++source_path= ++config_path= ++ ++# Change pseudo double quote to right one (cmake ExternalProject fix where not ++# give them correct) ++set -- `echo $@ | sed -e "s/$DOUBLE_QUOTES_PSEUDO/$DOUBLE_QUOTES/g"` ++ ++# use getopt and store the output into $OPTS ++# note the use of -o for the short options, --long for the long name options ++# and a : for any option that takes a parameter ++OPTS=$(getopt -o "hs:c:v" --long "help,source:,config:,verbose,dry-run" -n "$progname" -- "$@") ++if [ $? != 0 ] ; then echo "Error in command line arguments." >&2 ; usage; exit 1 ; fi ++eval set -- "$OPTS" ++ ++while true; do ++ # uncomment the next line to see how shift is working ++ # echo "\$1:\"$1\" \$2:\"$2\"" ++ case "$1" in ++ -h | --help ) usage; exit; ;; ++ -c | --config ) config_path=$(echo $2 | tr -d '"'); shift 2 ;; ++ -s | --source ) source_path=$(echo $2 | tr -d '"'); shift 2 ;; ++ --dry-run ) dryrun=1; shift ;; ++ -v | --verbose ) verbose=$((verbose + 1)); shift ;; ++ -- ) shift; break ;; ++ * ) break ;; ++ esac ++done ++ ++if [ -z $source_path ]; then ++ echo "ERROR: Source path is needed to set" ++ exit 1 ++fi ++if [ ! -d $source_path ]; then ++ echo "ERROR: Given source path '$source_path' not exist" ++ exit 1 ++fi ++ ++if [ -z $config_path ]; then ++ config_path="$source_path/mingw.conf" ++fi ++if [ ! -f $config_path ]; then ++ echo "ERROR: Given config file '$config_path' not exist" ++ exit 1 ++fi ++ ++. "$config_path" ++ ++ # print out all the parameters we read in ++ cat <<-EOM ++ Mingw build: ++ ----------------------------------------------------------------------------- ++ Source path = "$source_path" ++ Config file = "$config_path" ++ MinGW OS = $MINGW_CPU_ARCH ++ Target OS = $MINGW_TARGET_ARCH ++ Command = "$@" ++EOM ++ ++CALLCMD=$@ ++ ++set -a ++ ++CC="${CC:-$MINGW_CPU_ARCH-w64-mingw32-gcc}" ++CXX="${CXX:-$MINGW_CPU_ARCH-w64-mingw32-g++}" ++LD="${LD:-$MINGW_CPU_ARCH-w64-mingw32-ld}" ++AR="${AR:-$MINGW_CPU_ARCH-w64-mingw32-ar}" ++CCAS="${CCAS:-$MINGW_CPU_ARCH-w64-mingw32-gcc -c}" ++RANLIB="${RANLIB:-$MINGW_CPU_ARCH-w64-mingw32-ranlib}" ++STRIP="${STRIP:-$MINGW_CPU_ARCH-w64-mingw32-strip}" ++CPPFLAGS="${CPPFLAGS:--I$MINGW_INSTALL_PREFIX/include $CPPFLAGS}" ++CFLAGS="${CFLAGS:--I$MINGW_INSTALL_PREFIX/include -g -O2 $CFLAGS}" ++CXXFLAGS="${CXXFLAGS:--I$MINGW_INSTALL_PREFIX/include -g -O2 $CXXFLAGS}" ++LDFLAGS="${LDFLAGS:--L$MINGW_INSTALL_PREFIX/lib $LDFLAGS}" ++ ++# Set the paths ++PATH=$PATH:$MINGW_ENV_PATH ++if [[ $MINGW_CPU_ARCH == "x86_64" ]]; then ++ PATH=/mingw64/bin:$PATH ++else ++ PATH=/mingw32/bin:$PATH ++fi ++PATH=/opt/$MINGW_CPU_ARCH-w64-mingw32/bin:$PATH ++PATH=/opt/bin:$PATH ++PATH=$__VSCMD_PREINIT_PATH:$PATH ++PATH=$MINGW_INSTALL_PREFIX/bin:$PATH ++# INCLUDE=$MINGW_INCLUDE ++# LIB=$MINGW_LIB ++# LIBPATH=$MINGW_LIBPATH ++PKG_CONFIG_PATH=$MINGW_INSTALL_PREFIX/lib/pkgconfig:$PKG_CONFIG_PATH ++ ++# Call given commands ++cd $source_path ++eval $CALLCMD diff --git a/depends/windowsstore/mingw/CMakeLists.txt b/depends/windowsstore/mingw/CMakeLists.txt new file mode 100644 index 00000000..6b53796b --- /dev/null +++ b/depends/windowsstore/mingw/CMakeLists.txt @@ -0,0 +1,47 @@ +cmake_minimum_required(VERSION 3.5) +project(mingw) + +# Currently unused (our mirrors bring some download problems for Msys2) +if(0) + foreach(repo msys mingw32 mingw64) + if(${repo} STREQUAL msys) + file(WRITE ${CMAKE_CURRENT_SOURCE_DIR}/etc/pacman.d/mirrorlist.${repo} "Server = http://mirrors.kodi.tv/build-deps/win32/msys2/repos/${repo}2/$arch\n") + else() + file(WRITE ${CMAKE_CURRENT_SOURCE_DIR}/etc/pacman.d/mirrorlist.${repo} "Server = http://mirrors.kodi.tv/build-deps/win32/msys2/repos/${repo}\n") + endif() + endforeach() +endif() + +if($ENV{PROCESSOR_ARCHITECTURE} MATCHES "AMD64" OR + $ENV{PROCESSOR_ARCHITECTURE} MATCHES "IA64") + set(HOST mingw-w64-x86_64) + set(MINGW_PATH "mingw64") +else() + set(HOST mingw-w64-i686) + set(MINGW_PATH "mingw32") +endif() + +execute_process(COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/usr/bin/bash.exe --login -c + "pacman-key --init" ERROR_QUIET) +execute_process(COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/usr/bin/bash.exe --login -c + "pacman --noconfirm -S mingw-w64-cross-binutils \ + ${HOST}-gcc ${HOST}-lua \ + ${HOST}-headers \ + make \ + autoconf \ + automake \ + libtool \ + pkg-config \ + nasm \ + yasm \ + patch") + +file(GLOB_RECURSE shared_libs ${CMAKE_CURRENT_SOURCE_DIR}/${MINGW_PATH}/*.dll.a) +if(shared_libs) + file(REMOVE ${shared_libs}) +endif() + +configure_file(MinGWConfig.cmake.in MinGWConfig.cmake @ONLY) + +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/MinGWConfig.cmake DESTINATION ${CMAKE_INSTALL_PREFIX}) +install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/caller.sh DESTINATION ${CMAKE_INSTALL_PREFIX}) diff --git a/depends/windowsstore/mingw/mingw.sha256 b/depends/windowsstore/mingw/mingw.sha256 new file mode 100644 index 00000000..fe7f0962 --- /dev/null +++ b/depends/windowsstore/mingw/mingw.sha256 @@ -0,0 +1 @@ +bb1f1a0b35b3d96bf9c15092da8ce969a84a134f7b08811292fbc9d84d48c65d diff --git a/depends/windowsstore/mingw/mingw.txt b/depends/windowsstore/mingw/mingw.txt new file mode 100644 index 00000000..3fddb030 --- /dev/null +++ b/depends/windowsstore/mingw/mingw.txt @@ -0,0 +1 @@ +mingw http://mirrors.kodi.tv/build-deps/win32/msys2/msys2-base-x86_64-20161025.tar.xz From eec1230eab5b8e0eb5317c86425bb0b25a38fa3b Mon Sep 17 00:00:00 2001 From: Alwin Esch Date: Sun, 26 Jan 2020 14:04:11 +0100 Subject: [PATCH 11/23] update needed ffmpeg patches --- depends/common/ffmpeg/0001-hack-fix.patch | 25 ---------- ...d-test-with-this-as-static-on-ffmpeg.patch | 25 ---------- .../02-ffmpeg-zlib-config-conflict.patch | 12 +++++ depends/common/ffmpeg/03-ffmpeg-static.patch | 20 ++++++++ ...t-both-pre-1.1.0-and-post-1.1.0-init.patch | 34 ++++++++++++++ ...dont-use-libcrypto-locking-functions.patch | 47 +++++++++++++++++++ .../ffmpeg/07-ffmpeg-detect-openssl.patch | 26 ++++++++++ 7 files changed, 139 insertions(+), 50 deletions(-) delete mode 100644 depends/common/ffmpeg/0001-hack-fix.patch delete mode 100644 depends/common/ffmpeg/01-fix-build-test-with-this-as-static-on-ffmpeg.patch create mode 100644 depends/common/ffmpeg/02-ffmpeg-zlib-config-conflict.patch create mode 100644 depends/common/ffmpeg/03-ffmpeg-static.patch create mode 100644 depends/common/ffmpeg/05-ssl-support-both-pre-1.1.0-and-post-1.1.0-init.patch create mode 100644 depends/common/ffmpeg/06-dont-use-libcrypto-locking-functions.patch create mode 100644 depends/common/ffmpeg/07-ffmpeg-detect-openssl.patch diff --git a/depends/common/ffmpeg/0001-hack-fix.patch b/depends/common/ffmpeg/0001-hack-fix.patch deleted file mode 100644 index 4f443d1a..00000000 --- a/depends/common/ffmpeg/0001-hack-fix.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 7ea3c3037d1c385001eccd850059bfa137288979 Mon Sep 17 00:00:00 2001 -From: Alwin Esch -Date: Wed, 15 Jan 2020 03:46:11 +0100 -Subject: [PATCH] hack fix - ---- - configure | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/configure b/configure -index 34c2adb..957e502 100755 ---- a/configure -+++ b/configure -@@ -1569,7 +1569,7 @@ require_cpp_condition(){ - require_pkg_config(){ - log require_pkg_config "$@" - pkg_version="$2" -- check_pkg_config "$@" || die "ERROR: $pkg_version not found using pkg-config$pkg_config_fail_message" -+ check_pkg_config "$@" || echo "ERROR: $pkg_version not found using pkg-config$pkg_config_fail_message" - } - - test_host_cc(){ --- -2.20.1 - diff --git a/depends/common/ffmpeg/01-fix-build-test-with-this-as-static-on-ffmpeg.patch b/depends/common/ffmpeg/01-fix-build-test-with-this-as-static-on-ffmpeg.patch deleted file mode 100644 index 45da5a93..00000000 --- a/depends/common/ffmpeg/01-fix-build-test-with-this-as-static-on-ffmpeg.patch +++ /dev/null @@ -1,25 +0,0 @@ -From e70f8aad605e17795d9bc351850ca0a37ad0071d Mon Sep 17 00:00:00 2001 -From: Alwin Esch -Date: Wed, 15 Jan 2020 10:04:53 +0100 -Subject: [PATCH] fix build test with this as static on ffmpeg - ---- - configure | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/configure b/configure -index 957e502..f108564 100755 ---- a/configure -+++ b/configure -@@ -7,6 +7,8 @@ - # Copyright (c) 2005-2008 Mans Rullgard - # - -+export PKG_CONFIG_PATH="$PKG_CONFIG_PATH:$(pkg-config --variable pc_path pkg-config)" -+ - # Prevent locale nonsense from breaking basic text processing. - LC_ALL=C - export LC_ALL --- -2.20.1 - diff --git a/depends/common/ffmpeg/02-ffmpeg-zlib-config-conflict.patch b/depends/common/ffmpeg/02-ffmpeg-zlib-config-conflict.patch new file mode 100644 index 00000000..632cc55b --- /dev/null +++ b/depends/common/ffmpeg/02-ffmpeg-zlib-config-conflict.patch @@ -0,0 +1,12 @@ +--- a/configure ++++ b/configure +@@ -7197,6 +7197,9 @@ + $CONFIG_EXTRA \ + $ALL_COMPONENTS \ + ++echo "#if defined(HAVE_UNISTD_H) && HAVE_UNISTD_H == 0" >> $TMPH ++echo "#undef HAVE_UNISTD_H" >> $TMPH ++echo "#endif" >> $TMPH + echo "#endif /* FFMPEG_CONFIG_H */" >> $TMPH + echo "endif # FFMPEG_CONFIG_MAK" >> ffbuild/config.mak + diff --git a/depends/common/ffmpeg/03-ffmpeg-static.patch b/depends/common/ffmpeg/03-ffmpeg-static.patch new file mode 100644 index 00000000..fb78864a --- /dev/null +++ b/depends/common/ffmpeg/03-ffmpeg-static.patch @@ -0,0 +1,20 @@ +--- a/configure ++++ b/configure +@@ -5131,6 +5131,8 @@ + enabled shared && ! enabled small && test_cmd $windres --version && enable gnu_windres + enabled x86_32 && check_ldflags -Wl,--large-address-aware + shlibdir_default="$bindir_default" ++ LIBPREF="" ++ LIBSUF=".lib" + SLIBPREF="" + SLIBSUF=".dll" + SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)' +@@ -5180,6 +5182,8 @@ + fi + enabled x86_32 && check_ldflags -LARGEADDRESSAWARE + shlibdir_default="$bindir_default" ++ LIBPREF="" ++ LIBSUF=".lib" + SLIBPREF="" + SLIBSUF=".dll" + SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)' diff --git a/depends/common/ffmpeg/05-ssl-support-both-pre-1.1.0-and-post-1.1.0-init.patch b/depends/common/ffmpeg/05-ssl-support-both-pre-1.1.0-and-post-1.1.0-init.patch new file mode 100644 index 00000000..41f7f0d5 --- /dev/null +++ b/depends/common/ffmpeg/05-ssl-support-both-pre-1.1.0-and-post-1.1.0-init.patch @@ -0,0 +1,34 @@ +From 4eae85a82f81fa2ff4c317797ca3d82caf35db86 Mon Sep 17 00:00:00 2001 +From: Jun Zhao +Date: Tue, 10 Dec 2019 17:41:56 +0800 +Subject: [PATCH] lavf/tls_openssl: support both pre-1.1.0 and post-1.1.0 init + +supporting both pre-1.1.0 and post-1.1.0 version of the OpenSSL +library as the link: +https://wiki.openssl.org/index.php/Library_Initialization + +Signed-off-by: Jun Zhao +--- + libavformat/tls_openssl.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +diff --git a/libavformat/tls_openssl.c b/libavformat/tls_openssl.c +index 7ae71bdaf36..53f8363a12a 100644 +--- a/libavformat/tls_openssl.c ++++ b/libavformat/tls_openssl.c +@@ -70,8 +70,15 @@ int ff_openssl_init(void) + { + ff_lock_avformat(); + if (!openssl_init) { ++ /* OpenSSL 1.0.2 or below, then you would use SSL_library_init. If you are ++ * using OpenSSL 1.1.0 or above, then the library will initialize ++ * itself automatically. ++ * https://wiki.openssl.org/index.php/Library_Initialization ++ */ ++#if OPENSSL_VERSION_NUMBER < 0x10100000L + SSL_library_init(); + SSL_load_error_strings(); ++#endif + #if HAVE_THREADS + if (!CRYPTO_get_locking_callback()) { + int i; diff --git a/depends/common/ffmpeg/06-dont-use-libcrypto-locking-functions.patch b/depends/common/ffmpeg/06-dont-use-libcrypto-locking-functions.patch new file mode 100644 index 00000000..6c90fc82 --- /dev/null +++ b/depends/common/ffmpeg/06-dont-use-libcrypto-locking-functions.patch @@ -0,0 +1,47 @@ +From abf5e7bc212f4cc1e022907f92506ab33c19de44 Mon Sep 17 00:00:00 2001 +From: James Almer +Date: Wed, 11 Dec 2019 13:11:59 -0300 +Subject: [PATCH] avformat/tls_openssl: don't use libcrypto locking functions + with newer OpenSSL versions + +They have been removed altogether without a compat implementation, and are +either no-ops or return NULL. +This fixes compiler warnings about checks always evaluating to false, and leaks +of allocated mutexes. + +Signed-off-by: James Almer +--- + libavformat/tls_openssl.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/libavformat/tls_openssl.c b/libavformat/tls_openssl.c +index 53f8363a12a..e305b2465a0 100644 +--- a/libavformat/tls_openssl.c ++++ b/libavformat/tls_openssl.c +@@ -48,7 +48,7 @@ typedef struct TLSContext { + #endif + } TLSContext; + +-#if HAVE_THREADS ++#if HAVE_THREADS && OPENSSL_VERSION_NUMBER < 0x10100000L + #include + pthread_mutex_t *openssl_mutexes; + static void openssl_lock(int mode, int type, const char *file, int line) +@@ -79,7 +79,7 @@ int ff_openssl_init(void) + SSL_library_init(); + SSL_load_error_strings(); + #endif +-#if HAVE_THREADS ++#if HAVE_THREADS && OPENSSL_VERSION_NUMBER < 0x10100000L + if (!CRYPTO_get_locking_callback()) { + int i; + openssl_mutexes = av_malloc_array(sizeof(pthread_mutex_t), CRYPTO_num_locks()); +@@ -108,7 +108,7 @@ void ff_openssl_deinit(void) + ff_lock_avformat(); + openssl_init--; + if (!openssl_init) { +-#if HAVE_THREADS ++#if HAVE_THREADS && OPENSSL_VERSION_NUMBER < 0x10100000L + if (CRYPTO_get_locking_callback() == openssl_lock) { + int i; + CRYPTO_set_locking_callback(NULL); diff --git a/depends/common/ffmpeg/07-ffmpeg-detect-openssl.patch b/depends/common/ffmpeg/07-ffmpeg-detect-openssl.patch new file mode 100644 index 00000000..4b81f2ed --- /dev/null +++ b/depends/common/ffmpeg/07-ffmpeg-detect-openssl.patch @@ -0,0 +1,26 @@ +From 18de5c60ae0a987680681d5a0602009b428504fa Mon Sep 17 00:00:00 2001 +From: Gilles Khouzam +Date: Mon, 19 Jun 2017 16:33:38 -0700 +Subject: [PATCH] Add better detection for Openssl on Windows. + +Look for libeay32 and ssleay32 as another detection mechanism +--- + configure | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/configure b/configure +index a1818dc..1cf2a7c 100755 +--- a/configure ++++ b/configure +@@ -6147,6 +6147,8 @@ + check_lib openssl openssl/ssl.h SSL_library_init -lssl -lcrypto || + check_lib openssl openssl/ssl.h SSL_library_init -lssl32 -leay32 || + check_lib openssl openssl/ssl.h SSL_library_init -lssl -lcrypto -lws2_32 -lgdi32 || ++ check_lib openssl openssl/ssl.h OPENSSL_init_ssl -llibssl -llibcrypto -lz -lws2_32 -lgdi32 -ladvapi32 -luser32 || ++ check_lib openssl openssl/ssl.h SSL_library_init -llibeay32 -lssleay32 || + die "ERROR: openssl not found"; } + enabled rkmpp && { require_pkg_config rkmpp rockchip_mpp rockchip/rk_mpi.h mpp_create && + require_pkg_config rockchip_mpp "rockchip_mpp >= 1.3.7" rockchip/rk_mpi.h mpp_create && +-- +2.10.1.windows.1 + From 0d2884f07ccfb5a5c23f65f68ad2f7c361f62c73 Mon Sep 17 00:00:00 2001 From: Alwin Esch Date: Thu, 23 Jan 2020 14:34:12 +0000 Subject: [PATCH 12/23] allow ffmpeg build on windows --- depends/common/ffmpeg/CMakeLists.txt | 187 +++++++++++++++----- depends/common/ffmpeg/deps.txt | 4 +- depends/common/ffmpeg/windows-deps.txt | 7 + depends/common/ffmpeg/windowsstore-deps.txt | 7 + 4 files changed, 164 insertions(+), 41 deletions(-) create mode 100644 depends/common/ffmpeg/windows-deps.txt create mode 100644 depends/common/ffmpeg/windowsstore-deps.txt diff --git a/depends/common/ffmpeg/CMakeLists.txt b/depends/common/ffmpeg/CMakeLists.txt index 4c5330a1..f2b17ce7 100644 --- a/depends/common/ffmpeg/CMakeLists.txt +++ b/depends/common/ffmpeg/CMakeLists.txt @@ -38,10 +38,6 @@ if(ENABLE_NEON) list(APPEND ffmpeg_conf --enable-neon) endif() -if(CMAKE_BUILD_TYPE STREQUAL Release) - list(APPEND ffmpeg_conf --disable-debug) -endif() - if(CORE_SYSTEM_NAME STREQUAL linux OR CORE_SYSTEM_NAME STREQUAL freebsd) if(CORE_PLATFORM_NAME STREQUAL rbpi) list(APPEND ffmpeg_conf --cpu=${CPU} --disable-vaapi --disable-vdpau) @@ -89,43 +85,154 @@ endif() message(STATUS "FFMPEG_CONF: ${ffmpeg_conf}") +# Init base values given on build to ffmpeg +set(STANDARD_CONF "") +set(EXTRA_CONF "") +set(EXTRA_CFLAGS "") +set(EXTRA_LDFLAGS "") + +# Read version fo ffmpeg to define on extra version +file(STRINGS "${CMAKE_SOURCE_DIR}/RELEASE" FFMPEG_VER) + +# Set the basic ffmpeg configure options (same on all OS) +list(APPEND STANDARD_CONF --extra-version=kodi-${FFMPEG_VER} + --disable-devices + --disable-doc + --disable-ffplay + --disable-ffmpeg + --disable-ffprobe + --enable-gpl + --enable-runtime-cpudetect + --enable-postproc + --enable-muxer=spdif + --enable-muxer=adts + --enable-muxer=asf + --enable-muxer=ipod + --enable-encoder=ac3 + --enable-encoder=aac + --enable-encoder=wmav2 + --enable-protocol=http + --enable-encoder=png + --enable-encoder=mjpeg + --enable-demuxer=dash + --enable-libxml2 + --enable-zlib + --enable-static) + +# Determinate debug or release and set ffmpeg for +if(CMAKE_BUILD_TYPE STREQUAL Release) + list(APPEND EXTRA_CONF --disable-debug) +else() + list(APPEND EXTRA_CONF --enable-debug) +endif() + +# Run the builds include(ExternalProject) -externalproject_add(ffmpeg - SOURCE_DIR ${CMAKE_SOURCE_DIR} - CONFIGURE_COMMAND PKG_CONFIG_PATH=${CMAKE_INSTALL_PREFIX}/lib/pkgconfig ${CMAKE_SOURCE_DIR}/configure - --prefix=${CMAKE_INSTALL_PREFIX} - --extra-version="kodi-${FFMPEG_VER}" - --disable-devices - --disable-doc - --disable-ffplay - --disable-ffmpeg - --disable-ffprobe - --enable-gpl - --enable-runtime-cpudetect - --enable-postproc - --enable-pthreads - --enable-muxer=spdif - --enable-muxer=adts - --enable-muxer=asf - --enable-muxer=ipod - --enable-encoder=ac3 - --enable-encoder=aac - --enable-encoder=wmav2 - --enable-protocol=http - --enable-encoder=png - --enable-encoder=mjpeg - --enable-gnutls - --enable-demuxer=dash - --enable-libxml2 - --enable-libzvbi - ${ffmpeg_conf}) - -if(CORE_SYSTEM_NAME STREQUAL darwin_embedded) - externalproject_add_step(ffmpeg - RunSedCommand - COMMAND echo "Setting HAVE_CLOCK_GETTIME to 0 for darwin_embedded using sed" - COMMAND sed -i -- "s/HAVE_CLOCK_GETTIME 1/HAVE_CLOCK_GETTIME 0/g" ${CMAKE_CURRENT_BINARY_DIR}/ffmpeg-prefix/src/ffmpeg-build/config.h - DEPENDEES configure) +if(NOT WIN32) + externalproject_add(ffmpeg + SOURCE_DIR ${CMAKE_SOURCE_DIR} + CONFIGURE_COMMAND PKG_CONFIG_PATH=${CMAKE_INSTALL_PREFIX}/lib/pkgconfig ${CMAKE_SOURCE_DIR}/configure + --prefix=${CMAKE_INSTALL_PREFIX} + --enable-pthreads + --enable-gnutls + --enable-libzvbi + ${STANDARD_CONF} + ${EXTRA_CONF} + ${ffmpeg_conf}) + + if(CORE_SYSTEM_NAME STREQUAL darwin_embedded) + externalproject_add_step(ffmpeg + RunSedCommand + COMMAND echo "Setting HAVE_CLOCK_GETTIME to 0 for darwin_embedded using sed" + COMMAND sed -i -- "s/HAVE_CLOCK_GETTIME 1/HAVE_CLOCK_GETTIME 0/g" ${CMAKE_CURRENT_BINARY_DIR}/ffmpeg-prefix/src/ffmpeg-build/config.h + DEPENDEES configure) + endif() +else() + find_package(MinGW REQUIRED) + + if(CMAKE_C_FLAGS) + list(APPEND EXTRA_CFLAGS ${CMAKE_C_FLAGS}) + endif() + + if(CMAKE_CXX_FLAGS) + list(APPEND EXTRA_CXXFLAGS ${CMAKE_CXX_FLAGS}) + endif() + + if(CMAKE_EXE_LINKER_FLAGS) + list(APPEND EXTRA_LDFLAGS ${CMAKE_EXE_LINKER_FLAGS}) + endif() + + # Replace slash with minus, mingw does interpret a slash wrong! + MinGW_ChangeSlashToMinus(${EXTRA_CFLAGS}) + set(EXTRA_CFLAGS ${FLAGS}) + MinGW_ChangeSlashToMinus(${EXTRA_CXXFLAGS}) + set(EXTRA_CXXFLAGS ${FLAGS}) + MinGW_ChangeSlashToMinus(${EXTRA_LDFLAGS}) + set(EXTRA_LDFLAGS ${FLAGS}) + + list(APPEND EXTRA_CFLAGS -I${CMAKE_INSTALL_PREFIX}/include + -I${CMAKE_INSTALL_PREFIX}/include/libxml2) + list(APPEND EXTRA_CXXFLAGS -I${CMAKE_INSTALL_PREFIX}/include + -I${CMAKE_INSTALL_PREFIX}/include/libxml2) + list(APPEND EXTRA_LDFLAGS -LIBPATH:${CMAKE_INSTALL_PREFIX}/lib) + if(CMAKE_SYSTEM_NAME STREQUAL WindowsStore) + list(APPEND EXTRA_CONF --enable-cross-compile) + list(APPEND EXTRA_CFLAGS -DWINAPI_FAMILY=WINAPI_FAMILY_APP -D_WIN32_WINNT=0x0A00) + list(APPEND EXTRA_LDFLAGS -APPCONTAINER WindowsApp.lib) + endif() + if(CMAKE_BUILD_TYPE STREQUAL Release) + list(APPEND EXTRA_CFLAGS -MD) + list(APPEND EXTRA_CXXFLAGS -MD) + else() + list(APPEND EXTRA_CFLAGS -MDd) + list(APPEND EXTRA_CXXFLAGS -MDd) + list(APPEND EXTRA_LDFLAGS -NODEFAULTLIB:libcmt) + endif() + + include(CheckSymbolExists) + check_symbol_exists(_X86_ "Windows.h" _X86_) + check_symbol_exists(_AMD64_ "Windows.h" _AMD64_) + check_symbol_exists(_ARM_ "Windows.h" _ARM_) + check_symbol_exists(_ARM64_ "Windows.h" _ARM64_) + + if(_X86_) + set(EXTRA_ARCH "x86") + list(APPEND EXTRA_CONF --target-os=win32 --cpu=i686) + elseif(_AMD64_) + set(EXTRA_ARCH "x86_64") + list(APPEND EXTRA_CONF --target-os=win64) + elseif(_ARM_) + set(EXTRA_ARCH "arm") + list(APPEND EXTRA_CONF --target-os=win32 --cpu=armv7) + elseif(_ARM64_) + set(EXTRA_ARCH "aarch64") + list(APPEND EXTRA_CONF --target-os=win32 --cpu=aarch64) + else() + message(FATAL_ERROR "Unsupported architecture") + endif() + + externalproject_add(ffmpeg + SOURCE_DIR ${CMAKE_SOURCE_DIR} + CONFIGURE_COMMAND ${MINGW_CALL} + PKG_CONFIG_PATH=${CMAKE_INSTALL_PREFIX}/lib/pkgconfig + ./configure + --prefix=${MINGW_INSTALL_PREFIX} + --arch=${EXTRA_ARCH} + --toolchain=msvc + --enable-w32threads + --enable-openssl + --enable-nonfree + --disable-gnutls + --disable-libzvbi + ${STANDARD_CONF} + ${EXTRA_CONF} + --extra-cflags=[DQ]${EXTRA_CFLAGS}[DQ] + --extra-cxxflags=[DQ]${EXTRA_CXXFLAGS}[DQ] + --extra-ldflags=[DQ]${EXTRA_LDFLAGS}[DQ] + BUILD_COMMAND ${MINGW_CALL} + make -j$ENV{NUMBER_OF_PROCESSORS} + INSTALL_COMMAND ${MINGW_CALL} + make install) endif() install(CODE "Message(Done)") diff --git a/depends/common/ffmpeg/deps.txt b/depends/common/ffmpeg/deps.txt index d2a88045..a03caf25 100644 --- a/depends/common/ffmpeg/deps.txt +++ b/depends/common/ffmpeg/deps.txt @@ -1,4 +1,6 @@ nettle +gas-preprocessor gnutls +zlib zvbi -libxml2 \ No newline at end of file +libxml2 diff --git a/depends/common/ffmpeg/windows-deps.txt b/depends/common/ffmpeg/windows-deps.txt new file mode 100644 index 00000000..9c6f5c66 --- /dev/null +++ b/depends/common/ffmpeg/windows-deps.txt @@ -0,0 +1,7 @@ +gas-preprocessor +libpng +libxml2 +openssl +mingw +xz-utils +zlib diff --git a/depends/common/ffmpeg/windowsstore-deps.txt b/depends/common/ffmpeg/windowsstore-deps.txt new file mode 100644 index 00000000..9c6f5c66 --- /dev/null +++ b/depends/common/ffmpeg/windowsstore-deps.txt @@ -0,0 +1,7 @@ +gas-preprocessor +libpng +libxml2 +openssl +mingw +xz-utils +zlib From 9774878ea6347ffa0aca3d99743cfb39f481b5f3 Mon Sep 17 00:00:00 2001 From: Alwin Esch Date: Sun, 26 Jan 2020 14:08:22 +0100 Subject: [PATCH 13/23] cleanup ffmpeg CMakeLists.txt --- depends/common/ffmpeg/CMakeLists.txt | 228 +++++++++++++-------------- depends/common/ffmpeg/deps.txt | 2 +- 2 files changed, 115 insertions(+), 115 deletions(-) diff --git a/depends/common/ffmpeg/CMakeLists.txt b/depends/common/ffmpeg/CMakeLists.txt index f2b17ce7..57a30394 100644 --- a/depends/common/ffmpeg/CMakeLists.txt +++ b/depends/common/ffmpeg/CMakeLists.txt @@ -1,123 +1,42 @@ -project(ffmpeg) - cmake_minimum_required(VERSION 3.5) +project(ffmpeg) list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}) -if(ENABLE_CCACHE AND CCACHE_PROGRAM) - set(ffmpeg_conf "--cc=${CCACHE_PROGRAM} ${CMAKE_C_COMPILER}" "--cxx=${CCACHE_PROGRAM} ${CMAKE_CXX_COMPILER}") -else() - set(ffmpeg_conf --cc=${CMAKE_C_COMPILER} --cxx=${CMAKE_CXX_COMPILER}) -endif() - -if(CORE_SYSTEM_NAME STREQUAL android OR CORE_SYSTEM_NAME STREQUAL darwin_embedded) - set(CROSSCOMPILING 1) -endif() - -if(CROSSCOMPILING) - set(pkgconf "PKG_CONFIG_LIBDIR=${ADDON_DEPENDS_PATH}/lib/pkgconfig") - list(APPEND ffmpeg_conf --pkg-config=${PKG_CONFIG_EXECUTABLE} --pkg-config-flags=--static) - list(APPEND ffmpeg_conf --enable-cross-compile --cpu=${CPU} --arch=${CPU} --target-os=${OS}) - list(APPEND ffmpeg_conf --ar=${CMAKE_AR} --strip=${CMAKE_STRIP}) - message(STATUS "CROSS: ${ffmpeg_conf}") -endif() - -if(CMAKE_C_FLAGS) - list(APPEND ffmpeg_conf --extra-cflags=${CMAKE_C_FLAGS}) -endif() - -if(CMAKE_CXX_FLAGS) - list(APPEND ffmpeg_conf --extra-cxxflags=${CMAKE_CXX_FLAGS}) -endif() - -if(CMAKE_EXE_LINKER_FLAGS) - list(APPEND ffmpeg_conf --extra-ldflags=${CMAKE_EXE_LINKER_FLAGS}) -endif() - -if(ENABLE_NEON) - list(APPEND ffmpeg_conf --enable-neon) -endif() - -if(CORE_SYSTEM_NAME STREQUAL linux OR CORE_SYSTEM_NAME STREQUAL freebsd) - if(CORE_PLATFORM_NAME STREQUAL rbpi) - list(APPEND ffmpeg_conf --cpu=${CPU} --disable-vaapi --disable-vdpau) - else() - list(APPEND ffmpeg_conf --enable-pic) - if(ENABLE_VAAPI) - list(APPEND ffmpeg_conf --enable-vaapi) - else() - list(APPEND ffmpeg_conf --disable-vaapi) - endif() - if(ENABLE_VDPAU) - list(APPEND ffmpeg_conf --enable-vdpau) - else() - list(APPEND ffmpeg_conf --disable-vdpau) - endif() - endif() -elseif(CORE_SYSTEM_NAME STREQUAL android) - if(CPU MATCHES arm64) - list(APPEND ffmpeg_conf --cpu=cortex-a53 --arch=aarch64) - elseif(CPU MATCHES arm) - list(APPEND ffmpeg_conf --cpu=cortex-a9) - else() - list(APPEND ffmpeg_conf --cpu=i686 --disable-mmx) - endif() - list(APPEND ffmpeg_conf --target-os=linux --extra-libs=-liconv --disable-linux-perf) -elseif(CORE_SYSTEM_NAME STREQUAL darwin_embedded) - if(NOT CPU MATCHES arm64) - list(APPEND ffmpeg_conf --cpu=cortex-a8) - else() - list(APPEND ffmpeg_conf "--as=${NATIVEPREFIX}/bin/gas-preprocessor.pl -arch aarch64 -- ${CMAKE_C_COMPILER}") - endif() - list(APPEND ffmpeg_conf --disable-decoder=mpeg_xvmc --disable-crystalhd --enable-videotoolbox - --target-os=darwin) -elseif(CORE_SYSTEM_NAME STREQUAL osx) - list(APPEND ffmpeg_conf --disable-decoder=mpeg_xvmc --disable-crystalhd --enable-videotoolbox - --target-os=darwin - --disable-securetransport) -endif() - -if(CPU MATCHES arm OR CORE_PLATFORM_NAME STREQUAL rbpi) - list(APPEND ffmpeg_conf --enable-pic --disable-armv5te --disable-armv6t2) -elseif(CPU MATCHES mips) - list(APPEND ffmpeg_conf --disable-mips32r2 --disable-mipsdsp --disable-mipsdspr2) -endif() - -message(STATUS "FFMPEG_CONF: ${ffmpeg_conf}") - # Init base values given on build to ffmpeg set(STANDARD_CONF "") set(EXTRA_CONF "") set(EXTRA_CFLAGS "") set(EXTRA_LDFLAGS "") -# Read version fo ffmpeg to define on extra version +# Read version for ffmpeg to define on extra version file(STRINGS "${CMAKE_SOURCE_DIR}/RELEASE" FFMPEG_VER) # Set the basic ffmpeg configure options (same on all OS) list(APPEND STANDARD_CONF --extra-version=kodi-${FFMPEG_VER} - --disable-devices - --disable-doc - --disable-ffplay - --disable-ffmpeg - --disable-ffprobe - --enable-gpl - --enable-runtime-cpudetect - --enable-postproc - --enable-muxer=spdif - --enable-muxer=adts - --enable-muxer=asf - --enable-muxer=ipod - --enable-encoder=ac3 - --enable-encoder=aac - --enable-encoder=wmav2 - --enable-protocol=http - --enable-encoder=png - --enable-encoder=mjpeg - --enable-demuxer=dash - --enable-libxml2 - --enable-zlib - --enable-static) + --pkg-config-flags=--static + --disable-devices + --disable-doc + --disable-ffplay + --disable-ffmpeg + --disable-ffprobe + --enable-gpl + --enable-runtime-cpudetect + --enable-postproc + --enable-muxer=spdif + --enable-muxer=adts + --enable-muxer=asf + --enable-muxer=ipod + --enable-encoder=ac3 + --enable-encoder=aac + --enable-encoder=wmav2 + --enable-protocol=http + --enable-encoder=png + --enable-encoder=mjpeg + --enable-demuxer=dash + --enable-libxml2 + --enable-zlib + --enable-static) # Determinate debug or release and set ffmpeg for if(CMAKE_BUILD_TYPE STREQUAL Release) @@ -129,6 +48,87 @@ endif() # Run the builds include(ExternalProject) if(NOT WIN32) + if(ENABLE_CCACHE AND CCACHE_PROGRAM) + list(APPEND EXTRA_CONF "--cc=${CCACHE_PROGRAM} ${CMAKE_C_COMPILER}" "--cxx=${CCACHE_PROGRAM} ${CMAKE_CXX_COMPILER}") + else() + list(APPEND EXTRA_CONF --cc=${CMAKE_C_COMPILER} --cxx=${CMAKE_CXX_COMPILER}) + endif() + + if(CORE_SYSTEM_NAME STREQUAL android OR CORE_SYSTEM_NAME STREQUAL darwin_embedded) + set(CROSSCOMPILING 1) + endif() + + if(CROSSCOMPILING) + list(APPEND EXTRA_CONF --enable-cross-compile --arch=${CPU}) + list(APPEND EXTRA_CONF --ar=${CMAKE_AR} --strip=${CMAKE_STRIP}) + message(STATUS "CROSS: ${EXTRA_CONF}") + endif() + + if(CMAKE_C_FLAGS) + list(APPEND EXTRA_CONF --extra-cflags=${CMAKE_C_FLAGS}) + endif() + + if(CMAKE_CXX_FLAGS) + list(APPEND EXTRA_CONF --extra-cxxflags=${CMAKE_CXX_FLAGS}) + endif() + + if(CMAKE_EXE_LINKER_FLAGS) + list(APPEND EXTRA_CONF --extra-ldflags=${CMAKE_EXE_LINKER_FLAGS}) + endif() + + if(ENABLE_NEON) + list(APPEND EXTRA_CONF --enable-neon) + endif() + + if(CORE_SYSTEM_NAME STREQUAL linux OR CORE_SYSTEM_NAME STREQUAL freebsd) + if(CORE_PLATFORM_NAME STREQUAL rbpi) + list(APPEND EXTRA_CONF --cpu=${CPU} --disable-vaapi --disable-vdpau) + else() + list(APPEND EXTRA_CONF --enable-pic) + if(ENABLE_VAAPI) + list(APPEND EXTRA_CONF --enable-vaapi) + else() + list(APPEND EXTRA_CONF --disable-vaapi) + endif() + if(ENABLE_VDPAU) + list(APPEND EXTRA_CONF --enable-vdpau) + else() + list(APPEND EXTRA_CONF --disable-vdpau) + endif() + endif() + elseif(CORE_SYSTEM_NAME STREQUAL android) + if(CPU MATCHES arm64) + list(APPEND EXTRA_CONF --cpu=cortex-a53 --arch=aarch64) + elseif(CPU MATCHES arm) + list(APPEND EXTRA_CONF --cpu=cortex-a9) + else() + list(APPEND EXTRA_CONF --cpu=i686 --disable-mmx) + endif() + list(APPEND EXTRA_CONF --target-os=linux --extra-libs=-liconv --disable-linux-perf) + elseif(CORE_SYSTEM_NAME STREQUAL darwin_embedded) + if(NOT CPU MATCHES arm64) + list(APPEND EXTRA_CONF --cpu=cortex-a8) + else() + list(APPEND EXTRA_CONF "--as=${CMAKE_INSTALL_PREFIX}/bin/gas-preprocessor.pl -arch aarch64 -- ${CMAKE_C_COMPILER}") + list(APPEND --arch=aarch64) + endif() + list(APPEND EXTRA_CONF --disable-decoder=mpeg_xvmc --disable-crystalhd --enable-videotoolbox + --target-os=darwin) + elseif(CORE_SYSTEM_NAME STREQUAL osx) + list(APPEND EXTRA_CONF --disable-decoder=mpeg_xvmc --disable-crystalhd --enable-videotoolbox + --target-os=darwin + --disable-securetransport) + endif() + + if(CPU MATCHES arm OR CORE_PLATFORM_NAME STREQUAL rbpi) + list(APPEND EXTRA_CONF --enable-pic --disable-armv5te --disable-armv6t2) + elseif(CPU MATCHES mips) + list(APPEND EXTRA_CONF --disable-mips32r2 --disable-mipsdsp --disable-mipsdspr2) + endif() + + message(STATUS "FFMPEG_CONF (Standard): ${STANDARD_CONF}") + message(STATUS "FFMPEG_CONF (Extra, OS dependend): ${EXTRA_CONF}") + externalproject_add(ffmpeg SOURCE_DIR ${CMAKE_SOURCE_DIR} CONFIGURE_COMMAND PKG_CONFIG_PATH=${CMAKE_INSTALL_PREFIX}/lib/pkgconfig ${CMAKE_SOURCE_DIR}/configure @@ -137,8 +137,7 @@ if(NOT WIN32) --enable-gnutls --enable-libzvbi ${STANDARD_CONF} - ${EXTRA_CONF} - ${ffmpeg_conf}) + ${EXTRA_CONF}) if(CORE_SYSTEM_NAME STREQUAL darwin_embedded) externalproject_add_step(ffmpeg @@ -171,9 +170,11 @@ else() set(EXTRA_LDFLAGS ${FLAGS}) list(APPEND EXTRA_CFLAGS -I${CMAKE_INSTALL_PREFIX}/include - -I${CMAKE_INSTALL_PREFIX}/include/libxml2) + -I${CMAKE_INSTALL_PREFIX}/include/libxml2 + -FS) list(APPEND EXTRA_CXXFLAGS -I${CMAKE_INSTALL_PREFIX}/include - -I${CMAKE_INSTALL_PREFIX}/include/libxml2) + -I${CMAKE_INSTALL_PREFIX}/include/libxml2 + -FS) list(APPEND EXTRA_LDFLAGS -LIBPATH:${CMAKE_INSTALL_PREFIX}/lib) if(CMAKE_SYSTEM_NAME STREQUAL WindowsStore) list(APPEND EXTRA_CONF --enable-cross-compile) @@ -181,8 +182,8 @@ else() list(APPEND EXTRA_LDFLAGS -APPCONTAINER WindowsApp.lib) endif() if(CMAKE_BUILD_TYPE STREQUAL Release) - list(APPEND EXTRA_CFLAGS -MD) - list(APPEND EXTRA_CXXFLAGS -MD) + list(APPEND EXTRA_CFLAGS -MD -wd4828) + list(APPEND EXTRA_CXXFLAGS -MD -wd4828) else() list(APPEND EXTRA_CFLAGS -MDd) list(APPEND EXTRA_CXXFLAGS -MDd) @@ -214,9 +215,8 @@ else() externalproject_add(ffmpeg SOURCE_DIR ${CMAKE_SOURCE_DIR} CONFIGURE_COMMAND ${MINGW_CALL} - PKG_CONFIG_PATH=${CMAKE_INSTALL_PREFIX}/lib/pkgconfig ./configure - --prefix=${MINGW_INSTALL_PREFIX} + --prefix=[DQ]${CMAKE_INSTALL_PREFIX}[DQ] --arch=${EXTRA_ARCH} --toolchain=msvc --enable-w32threads diff --git a/depends/common/ffmpeg/deps.txt b/depends/common/ffmpeg/deps.txt index a03caf25..6b323b80 100644 --- a/depends/common/ffmpeg/deps.txt +++ b/depends/common/ffmpeg/deps.txt @@ -2,5 +2,5 @@ nettle gas-preprocessor gnutls zlib -zvbi +libzvbi libxml2 From c5d580dcd460a466df4918440041fc272fbb35c4 Mon Sep 17 00:00:00 2001 From: Alwin Esch Date: Sun, 26 Jan 2020 14:09:20 +0100 Subject: [PATCH 14/23] remove not needed files from ffmpeg depends --- .../common/ffmpeg/ConfigureEnvWrapper.cmake | 50 ----- depends/common/ffmpeg/FFMPEG-VERSION | 4 - depends/common/ffmpeg/FindGnuTls.cmake | 29 --- depends/common/ffmpeg/Makefile | 101 ---------- depends/common/ffmpeg/autobuild.sh | 176 ------------------ 5 files changed, 360 deletions(-) delete mode 100644 depends/common/ffmpeg/ConfigureEnvWrapper.cmake delete mode 100644 depends/common/ffmpeg/FFMPEG-VERSION delete mode 100644 depends/common/ffmpeg/FindGnuTls.cmake delete mode 100644 depends/common/ffmpeg/Makefile delete mode 100755 depends/common/ffmpeg/autobuild.sh diff --git a/depends/common/ffmpeg/ConfigureEnvWrapper.cmake b/depends/common/ffmpeg/ConfigureEnvWrapper.cmake deleted file mode 100644 index 212144b1..00000000 --- a/depends/common/ffmpeg/ConfigureEnvWrapper.cmake +++ /dev/null @@ -1,50 +0,0 @@ -# -# This wrapper script allows the setting of ENV variables when called -# from externalProject_add. Can be used for cases where ENV variables -# like PKG_CONFIG_PATH need to be set. -# -# Here is an example of the calling code: -# -# -# set(CONFIGURE_COMMAND_BODY ${CMAKE_SOURCE_DIR}/configure -# --prefix=${CMAKE_INSTALL_PREFIX}) -# string(REPLACE ";" "@@" ENCODED_CONFIGURE_COMMAND_BODY "${CONFIGURE_COMMAND_BODY}") -# -# include(ExternalProject) -# externalproject_add(ffmpeg -# SOURCE_DIR ${CMAKE_SOURCE_DIR} -# CONFIGURE_COMMAND ${CMAKE_COMMAND} -# -DWrapperBinaryDir:PATH= -# -DWrapperSourceDir:PATH= -# -DWrapperInstallDir:PATH=${CMAKE_INSTALL_PREFIX} -# -DWrapperConfigureCommand:STRING=${ENCODED_CONFIGURE_COMMAND_BODY} -P -# /ConfigureEnvWrapper.cmake) -# - -set(ENV{PATH} "${WrapperInstallDir}/bin:$ENV{PATH}") -string(REPLACE "@@" ";" WrapperConfigureCommand "${WrapperConfigureCommand}" ) - -set(ENV{PKG_CONFIG_PATH} ${WrapperInstallDir}/lib/pkgconfig) -set(ENV{LD_LIBRARY_PATH} ${WrapperInstallDir}/lib:$ENV{LD_LIBRARY_PATH}) -set(ENV{LDFLAGS} "-L${WrapperInstallDir}/lib") -set(ENV{CFLAGS} "-I${WrapperInstallDir}/include") -set(ENV{CPPFLAGS} "-I${WrapperInstallDir}/include") -set(ENV{PATH} "${WrapperInstallDir}/bin:$ENV{PATH}") - -message(" -ConfigureEnvWrapper::WrapperBinaryDir ** ${WrapperBinaryDir} ** -ConfigureEnvWrapper::WrapperSourceDir ** ${WrapperSourceDir} ** -ConfigureEnvWrapper::WrapperInstallDir ** ${WrapperInstallDir} ** -ConfigureEnvWrapper::WrapperConfigureCommand ** ${WrapperConfigureCommand} ** -ConfigureEnvWrapper::PATH ** $ENV{PATH} ** -") - -execute_process(COMMAND ${WrapperConfigureCommand} - RESULT_VARIABLE status_code -# OUTPUT_VARIABLE log -) -execute_process(COMMAND "echo $PKG_CONFIG_PATH") -if(NOT status_code EQUAL 0) - message(FATAL_ERROR "configure error in line: ${WrapperConfigureCommand} - status_code: ${status_code}") -endif() diff --git a/depends/common/ffmpeg/FFMPEG-VERSION b/depends/common/ffmpeg/FFMPEG-VERSION deleted file mode 100644 index 620fe798..00000000 --- a/depends/common/ffmpeg/FFMPEG-VERSION +++ /dev/null @@ -1,4 +0,0 @@ -LIBNAME=ffmpeg -BASE_URL=https://github.com/xbmc/FFmpeg -VERSION=4.0.4-Leia-18.4 -ARCHIVE=$(LIBNAME)-$(VERSION).tar.gz diff --git a/depends/common/ffmpeg/FindGnuTls.cmake b/depends/common/ffmpeg/FindGnuTls.cmake deleted file mode 100644 index 7b89b40c..00000000 --- a/depends/common/ffmpeg/FindGnuTls.cmake +++ /dev/null @@ -1,29 +0,0 @@ -# - Try to find gnutls -# Once done this will define -# -# GNUTLS_FOUND - system has gnutls -# GNUTLS_INCLUDE_DIRS - the gnutls include directory -# GNUTLS_LIBRARIES - The gnutls libraries - -include(FindPkgConfig) -find_package(PkgConfig) - -if(PKG_CONFIG_FOUND) - pkg_check_modules (GNUTLS gnutls) -endif() - -if(NOT GNUTLS_FOUND) - find_path(GNUTLS_INCLUDE_DIRS gnutls/gnutls.h) - find_library(GNUTLS_LIBRARIES gnutls) -endif() - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(GnuTls DEFAULT_MSG GNUTLS_INCLUDE_DIRS GNUTLS_LIBRARIES) -#find_package_handle_standard_args(GnuTls DEFAULT_MSG) - -if(GNUTLS_FOUND) - list(APPEND GNUTLS_DEFINITIONS -DHAVE_GNUTLS=1) -endif() - -#mark_as_advanced(GNUTLS_INCLUDE_DIRS GNUTLS_LIBRARIES GNUTLS_DEFINITIONS) -mark_as_advanced(GNUTLS_DEFINITIONS) diff --git a/depends/common/ffmpeg/Makefile b/depends/common/ffmpeg/Makefile deleted file mode 100644 index 731109ff..00000000 --- a/depends/common/ffmpeg/Makefile +++ /dev/null @@ -1,101 +0,0 @@ -include ../../Makefile.include -include FFMPEG-VERSION -DEPS= ../../Makefile.include FFMPEG-VERSION Makefile - -# set to "yes" to enable patching -# we don't apply patches until we move to a vanilla ffmpeg tarball -APPLY_PATCHES=no - -# configuration settings -ffmpg_config = --prefix=$(PREFIX) --extra-version="kodi-$(VERSION)" -ffmpg_config += --cc="$(CC)" --cxx="$(CXX)" --ar=$(AR) --ranlib=$(RANLIB) --strip=$(STRIP) -ffmpg_config += --disable-devices --disable-doc -ffmpg_config += --disable-ffplay --disable-ffmpeg -ffmpg_config += --disable-ffprobe -ffmpg_config += --disable-sdl2 -ffmpg_config += --enable-gpl --enable-runtime-cpudetect -ffmpg_config += --enable-postproc --enable-pthreads -ffmpg_config += --enable-muxer=spdif --enable-muxer=adts -ffmpg_config += --enable-muxer=asf --enable-muxer=ipod -ffmpg_config += --enable-encoder=ac3 --enable-encoder=aac -ffmpg_config += --enable-encoder=wmav2 --enable-protocol=http -ffmpg_config += --enable-gnutls -ffmpg_config += --enable-encoder=png --enable-encoder=mjpeg -ffmpg_config += $(FFMPEG_CONFIGURE_OPTIONS) - -ifeq ($(CROSS_COMPILING), yes) - ffmpg_config += --arch=$(CPU) --enable-cross-compile -endif -ifeq ($(OS), linux) - ffmpg_config += --target-os=$(OS) - ffmpg_config += --enable-pic -endif -ifeq ($(OS), android) - ifeq ($(findstring arm64, $(CPU)), arm64) - ffmpg_config += --arch=aarch64 --cpu=cortex-a53 - else - ifeq ($(findstring arm, $(CPU)), arm) - ffmpg_config += --cpu=cortex-a9 - else - ffmpg_config += --cpu=i686 --disable-mmx - ffmpg_config += --extra-cflags=-no-integrated-as --extra-cflags=-mno-stackrealign - endif - endif - ffmpg_config += --target-os=linux --extra-libs=-liconv --disable-linux-perf -endif -ifeq ($(OS), darwin_embedded) - ifneq ($(CPU), arm64) - ffmpg_config += --cpu=cortex-a8 - ffmpg_config += --as="$(NATIVEPREFIX)/bin/gas-preprocessor.pl -- $(CC)" - else - ffmpg_config += --as="$(NATIVEPREFIX)/bin/gas-preprocessor.pl -arch aarch64 -- $(CC)" - endif - ffmpg_config += --yasmexe=$(NATIVEPREFIX)/bin/yasm - ffmpg_config += --disable-decoder=mpeg_xvmc --disable-crystalhd --enable-videotoolbox - ffmpg_config += --target-os=darwin -endif -ifeq ($(OS), osx) - ffmpg_config += --disable-decoder=mpeg_xvmc --disable-crystalhd --enable-videotoolbox - ffmpg_config += --target-os=darwin - ffmpg_config += --disable-securetransport -endif -ifeq ($(findstring arm, $(CPU)), arm) - ffmpg_config += --enable-pic --disable-armv5te --disable-armv6t2 -endif -ifeq ($(findstring mips, $(CPU)), mips) - ffmpg_config += --disable-mips32r2 --disable-mipsdsp --disable-mipsdspr2 -endif -ifeq ($(Configuration), Release) - ffmpg_config += --disable-debug -endif - -all: .installed-$(PLATFORM) - -$(TARBALLS_LOCATION)/$(ARCHIVE): - cd $(TARBALLS_LOCATION); $(RETRIEVE_TOOL) -Ls --create-dirs -f -o $(TARBALLS_LOCATION)/$(ARCHIVE) $(BASE_URL)/archive/$(VERSION).tar.gz - -$(PLATFORM): $(TARBALLS_LOCATION)/$(ARCHIVE) $(DEPS) - rm -rf $(PLATFORM); mkdir -p $(PLATFORM) - cd $(PLATFORM); $(ARCHIVE_TOOL) $(ARCHIVE_TOOL_FLAGS) $(TARBALLS_LOCATION)/$(ARCHIVE) - cd $(PLATFORM); sed -i".bak" -e "s%pkg_config_default=pkg-config%export PKG_CONFIG_LIBDIR=$(PREFIX)/lib/pkgconfig \&\& pkg_config_default=$(NATIVEPREFIX)/bin/pkg-config%" configure - cd $(PLATFORM);\ - CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" CPPFLAGS="$(CPPFLAGS)" LDFLAGS="$(LDFLAGS)" \ - ./configure $(ffmpg_config) -ifeq ($(OS), darwin_embedded) - cd $(PLATFORM); sed -i -- 's/HAVE_CLOCK_GETTIME 1/HAVE_CLOCK_GETTIME 0/g' config.h -endif - -.build-$(PLATFORM): $(PLATFORM) - $(MAKE) -C $(PLATFORM) - touch $@ - -.installed-$(PLATFORM): .build-$(PLATFORM) - $(MAKE) -C $(PLATFORM) install - touch $@ - -clean: - $(MAKE) -C $(PLATFORM) clean - rm -f .installed-$(PLATFORM) - -distclean:: - rm -rf $(PLATFORM) .installed-$(PLATFORM) diff --git a/depends/common/ffmpeg/autobuild.sh b/depends/common/ffmpeg/autobuild.sh deleted file mode 100755 index dc990b8a..00000000 --- a/depends/common/ffmpeg/autobuild.sh +++ /dev/null @@ -1,176 +0,0 @@ -#!/bin/bash -# -# Copyright (C) 2005-2013 Team XBMC -# http://xbmc.org -# -# This Program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# This Program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with XBMC; see the file COPYING. If not, see -# . -# - - -MYDIR=$(cd $(dirname $0); pwd) -cd $MYDIR -FFMPEG_PREFIX=${MYDIR}/ffmpeg-install - -BASE_URL=$(grep "BASE_URL=" FFMPEG-VERSION | sed 's/BASE_URL=//g') -VERSION=$(grep "VERSION=" FFMPEG-VERSION | sed 's/VERSION=//g') -ARCHIVE=ffmpeg-$(echo "${VERSION}" | sed 's/\//-/g').tar.gz - -function usage { - echo "usage $(basename $0) - [-p | --prefix] ... ffmepg install prefix - [-d | --download] ... no build, download tarfile only - [-r | --release] ... disable debugging symbols - [-s | --shared] ... build shared libraries - [-j] ... make concurrency level - [--cpu=CPU] ... minimum required CPU - [--arch=ARCH] ... select architecture - [--disable-optimizations] - " -} - -while : -do - case $1 in - -h | --help) - usage - exit 0 - ;; - -p | --prefix) - FFMPEG_PREFIX=$2 - shift 2 - ;; - --prefix=*) - FFMPEG_PREFIX=${1#*=} - shift - ;; - -d | --download) - downloadonly=true - shift - ;; - -r | --release) - FLAGS="$FLAGS --disable-debug" - shift - ;; - -s | --shared) - FLAGS="$FLAGS --enable-shared" - shift - ;; - --disable-optimizations) - FLAGS="$FLAGS --disable-optimizations" - shift - ;; - --cpu=*) - FLAGS="$FLAGS --cpu=${1#*=}" - shift - ;; - --arch=*) - FLAGS="$FLAGS --arch=${1#*=}" - shift - ;; - --extra-cflags=*) - FLAGS="$FLAGS --extra-cflags=\"${1#*=}\"" - shift - ;; - --extra-cxxflags=*) - FLAGS="$FLAGS --extra-cxxflags=\"${1#*=}\"" - shift - ;; - -j) - BUILDTHREADS=$2 - shift 2 - ;; - --) - shift - break - ;; - -*) - echo "WARN: Unknown option (ignored): $1" >&2 - shift - ;; - *) - break - ;; - esac -done - -BUILDTHREADS=${BUILDTHREADS:-$(grep -c "^processor" /proc/cpuinfo)} -[ ${BUILDTHREADS} -eq 0 ] && BUILDTHREADS=1 - -[ -z ${VERSION} ] && exit 3 -if [ -f ${FFMPEG_PREFIX}/lib/pkgconfig/libavcodec.pc ] && [ -f .ffmpeg-installed ] -then - CURVER=$(cat .ffmpeg-installed) - [ "$VERSION" == "$CURVER" ] && exit 0 -fi - -[ -f ${ARCHIVE} ] || - curl -Ls --create-dirs -f -o ${ARCHIVE} ${BASE_URL}/archive/${VERSION}.tar.gz || - { echo "error fetching ${BASE_URL}/archive/${VERSION}.tar.gz" ; exit 3; } -[ $downloadonly ] && exit 0 - -[ -d ffmpeg-${VERSION} ] && rm -rf ffmpeg-${VERSION} && rm .ffmpeg-installed >/dev/null 2>&1 -if [ -d ${FFMPEG_PREFIX} ] -then - [ -w ${FFMPEG_PREFIX} ] || SUDO="sudo" -else - [ -w $(dirname ${FFMPEG_PREFIX}) ] || SUDO="sudo" -fi - -mkdir -p "ffmpeg-${VERSION}" -cd "ffmpeg-${VERSION}" || exit 2 -tar --strip-components=1 -xf $MYDIR/${ARCHIVE} - -CFLAGS="$CFLAGS" CXXFLAGS="$CXXFLAGS" LDFLAGS="$LDFLAGS" \ -./configure --prefix=$FFMPEG_PREFIX \ - --extra-version="kodi-${VERSION}" \ - --disable-devices \ - --disable-ffplay \ - --disable-ffmpeg \ - --disable-ffprobe \ - --disable-doc \ - --enable-gpl \ - --enable-runtime-cpudetect \ - --enable-postproc \ - --enable-vaapi \ - --enable-vdpau \ - --enable-bzlib \ - --enable-gnutls \ - --enable-muxer=spdif \ - --enable-muxer=adts \ - --enable-muxer=asf \ - --enable-muxer=ipod \ - --enable-encoder=ac3 \ - --enable-encoder=aac \ - --enable-encoder=wmav2 \ - --enable-protocol=http \ - --enable-encoder=png \ - --enable-encoder=mjpeg \ - --enable-nonfree \ - --enable-pthreads \ - --enable-pic \ - --enable-zlib \ - --disable-mipsdsp \ - --disable-mipsdspr2 \ - ${FLAGS} - -make -j ${BUILDTHREADS} -if [ $? -eq 0 ] -then - [ ${SUDO} ] && echo "Root privileges are required to install to ${FFMPEG_PREFIX}" - ${SUDO} make install && echo "$VERSION" > $MYDIR/.ffmpeg-installed -else - echo "ERROR: Building ffmpeg failed" - exit 1 -fi From 8558517aaf313a56f0c766ed8a471e617cd8c5c5 Mon Sep 17 00:00:00 2001 From: Alwin Esch Date: Sun, 26 Jan 2020 14:15:45 +0100 Subject: [PATCH 15/23] rename zvbi to libzvbi (prevent name warnings) and cleanup --- .../01-zvbi-fix-clang-support.patch | 0 .../02-zvbi-fix-static-linking.patch | 0 .../{zvbi => libzvbi}/03-zvbi-ioctl.patch | 0 .../{zvbi => libzvbi}/04-zvbi-ssize_max.patch | 0 .../05-zvbi-android-pthread_testcancel.patch | 0 .../{zvbi => libzvbi}/06-zvbi-android.patch | 0 .../android/{zvbi => libzvbi}/CMakeLists.txt | 4 +- depends/android/{zvbi => libzvbi}/deps.txt | 0 .../zvbi.sha256 => libzvbi/libzvbi.sha256} | 0 depends/android/libzvbi/libzvbi.txt | 1 + depends/android/zvbi/zvbi.txt | 1 - .../01-zvbi-fix-clang-support.patch | 5 +- .../02-zvbi-ioctl.patch} | 9 +-- .../03-zvbi-ssize_max.patch} | 10 +-- depends/common/libzvbi/04-prevent-test.patch | 76 +++++++++++++++++++ .../05-zvbi-ios-without-settime.patch} | 5 +- .../06-zvbi-fix-static-linkage.patch} | 33 +++----- .../common/{zvbi => libzvbi}/CMakeLists.txt | 6 +- depends/common/{zvbi => libzvbi}/deps.txt | 0 .../zvbi.sha256 => libzvbi/libzvbi.sha256} | 0 depends/common/libzvbi/libzvbi.txt | 1 + .../common/{zvbi => libzvbi}/platforms.txt | 0 .../zvbi/02-zvbi-fix-static-linking.patch | 11 --- .../zvbi/07-zvbi-libm-on-end-configure.patch | 12 --- depends/common/zvbi/zvbi.txt | 1 - 25 files changed, 108 insertions(+), 67 deletions(-) rename depends/android/{zvbi => libzvbi}/01-zvbi-fix-clang-support.patch (100%) rename depends/android/{zvbi => libzvbi}/02-zvbi-fix-static-linking.patch (100%) rename depends/android/{zvbi => libzvbi}/03-zvbi-ioctl.patch (100%) rename depends/android/{zvbi => libzvbi}/04-zvbi-ssize_max.patch (100%) rename depends/android/{zvbi => libzvbi}/05-zvbi-android-pthread_testcancel.patch (100%) rename depends/android/{zvbi => libzvbi}/06-zvbi-android.patch (100%) rename depends/android/{zvbi => libzvbi}/CMakeLists.txt (95%) rename depends/android/{zvbi => libzvbi}/deps.txt (100%) rename depends/android/{zvbi/zvbi.sha256 => libzvbi/libzvbi.sha256} (100%) create mode 100644 depends/android/libzvbi/libzvbi.txt delete mode 100644 depends/android/zvbi/zvbi.txt rename depends/common/{zvbi => libzvbi}/01-zvbi-fix-clang-support.patch (78%) rename depends/common/{zvbi/03-zvbi-ioctl.patch => libzvbi/02-zvbi-ioctl.patch} (55%) rename depends/common/{zvbi/04-zvbi-ssize_max.patch => libzvbi/03-zvbi-ssize_max.patch} (73%) create mode 100644 depends/common/libzvbi/04-prevent-test.patch rename depends/common/{zvbi/06-zvbi-ios-without-settime.patch => libzvbi/05-zvbi-ios-without-settime.patch} (58%) rename depends/common/{zvbi/05-have-libm-on-end.patch => libzvbi/06-zvbi-fix-static-linkage.patch} (54%) rename depends/common/{zvbi => libzvbi}/CMakeLists.txt (91%) rename depends/common/{zvbi => libzvbi}/deps.txt (100%) rename depends/common/{zvbi/zvbi.sha256 => libzvbi/libzvbi.sha256} (100%) create mode 100644 depends/common/libzvbi/libzvbi.txt rename depends/common/{zvbi => libzvbi}/platforms.txt (100%) delete mode 100644 depends/common/zvbi/02-zvbi-fix-static-linking.patch delete mode 100644 depends/common/zvbi/07-zvbi-libm-on-end-configure.patch delete mode 100644 depends/common/zvbi/zvbi.txt diff --git a/depends/android/zvbi/01-zvbi-fix-clang-support.patch b/depends/android/libzvbi/01-zvbi-fix-clang-support.patch similarity index 100% rename from depends/android/zvbi/01-zvbi-fix-clang-support.patch rename to depends/android/libzvbi/01-zvbi-fix-clang-support.patch diff --git a/depends/android/zvbi/02-zvbi-fix-static-linking.patch b/depends/android/libzvbi/02-zvbi-fix-static-linking.patch similarity index 100% rename from depends/android/zvbi/02-zvbi-fix-static-linking.patch rename to depends/android/libzvbi/02-zvbi-fix-static-linking.patch diff --git a/depends/android/zvbi/03-zvbi-ioctl.patch b/depends/android/libzvbi/03-zvbi-ioctl.patch similarity index 100% rename from depends/android/zvbi/03-zvbi-ioctl.patch rename to depends/android/libzvbi/03-zvbi-ioctl.patch diff --git a/depends/android/zvbi/04-zvbi-ssize_max.patch b/depends/android/libzvbi/04-zvbi-ssize_max.patch similarity index 100% rename from depends/android/zvbi/04-zvbi-ssize_max.patch rename to depends/android/libzvbi/04-zvbi-ssize_max.patch diff --git a/depends/android/zvbi/05-zvbi-android-pthread_testcancel.patch b/depends/android/libzvbi/05-zvbi-android-pthread_testcancel.patch similarity index 100% rename from depends/android/zvbi/05-zvbi-android-pthread_testcancel.patch rename to depends/android/libzvbi/05-zvbi-android-pthread_testcancel.patch diff --git a/depends/android/zvbi/06-zvbi-android.patch b/depends/android/libzvbi/06-zvbi-android.patch similarity index 100% rename from depends/android/zvbi/06-zvbi-android.patch rename to depends/android/libzvbi/06-zvbi-android.patch diff --git a/depends/android/zvbi/CMakeLists.txt b/depends/android/libzvbi/CMakeLists.txt similarity index 95% rename from depends/android/zvbi/CMakeLists.txt rename to depends/android/libzvbi/CMakeLists.txt index afe649f9..32cf77a0 100644 --- a/depends/android/zvbi/CMakeLists.txt +++ b/depends/android/libzvbi/CMakeLists.txt @@ -1,4 +1,4 @@ -project(zvbi) +project(libzsvbi) cmake_minimum_required(VERSION 3.5) @@ -14,7 +14,7 @@ elseif (CORE_SYSTEM_NAME STREQUAL android) endif() include(ExternalProject) -externalproject_add(zvbi +externalproject_add(libzsvbi SOURCE_DIR ${CMAKE_SOURCE_DIR} CONFIGURE_COMMAND /configure --prefix=${CMAKE_INSTALL_PREFIX} diff --git a/depends/android/zvbi/deps.txt b/depends/android/libzvbi/deps.txt similarity index 100% rename from depends/android/zvbi/deps.txt rename to depends/android/libzvbi/deps.txt diff --git a/depends/android/zvbi/zvbi.sha256 b/depends/android/libzvbi/libzvbi.sha256 similarity index 100% rename from depends/android/zvbi/zvbi.sha256 rename to depends/android/libzvbi/libzvbi.sha256 diff --git a/depends/android/libzvbi/libzvbi.txt b/depends/android/libzvbi/libzvbi.txt new file mode 100644 index 00000000..78f339c3 --- /dev/null +++ b/depends/android/libzvbi/libzvbi.txt @@ -0,0 +1 @@ +libzvbi http://mirrors.kodi.tv/build-deps/sources/zvbi-0.2.35.tar.bz2 diff --git a/depends/android/zvbi/zvbi.txt b/depends/android/zvbi/zvbi.txt deleted file mode 100644 index 04624bec..00000000 --- a/depends/android/zvbi/zvbi.txt +++ /dev/null @@ -1 +0,0 @@ -zvbi http://mirrors.kodi.tv/build-deps/sources/zvbi-0.2.35.tar.bz2 diff --git a/depends/common/zvbi/01-zvbi-fix-clang-support.patch b/depends/common/libzvbi/01-zvbi-fix-clang-support.patch similarity index 78% rename from depends/common/zvbi/01-zvbi-fix-clang-support.patch rename to depends/common/libzvbi/01-zvbi-fix-clang-support.patch index ca83c55c..42ace29b 100644 --- a/depends/common/zvbi/01-zvbi-fix-clang-support.patch +++ b/depends/common/libzvbi/01-zvbi-fix-clang-support.patch @@ -1,6 +1,5 @@ -diff -ru zvbi/src/misc.h zvbi-fixed/src/misc.h ---- zvbi/src/misc.h 2013-07-02 04:32:31.000000000 +0200 -+++ zvbi-fixed/src/misc.h 2013-08-08 21:37:22.000000000 +0200 +--- a/src/misc.h ++++ b/src/misc.h @@ -52,17 +52,6 @@ # define unlikely(expr) __builtin_expect(expr, 0) #endif diff --git a/depends/common/zvbi/03-zvbi-ioctl.patch b/depends/common/libzvbi/02-zvbi-ioctl.patch similarity index 55% rename from depends/common/zvbi/03-zvbi-ioctl.patch rename to depends/common/libzvbi/02-zvbi-ioctl.patch index 2b0e42d5..4af7cb1a 100644 --- a/depends/common/zvbi/03-zvbi-ioctl.patch +++ b/depends/common/libzvbi/02-zvbi-ioctl.patch @@ -1,15 +1,14 @@ -diff -ru zvbi.orig/contrib/ntsc-cc.c zvbi/contrib/ntsc-cc.c ---- zvbi.orig/contrib/ntsc-cc.c 2011-11-06 11:22:47.000000000 +0200 -+++ zvbi/contrib/ntsc-cc.c 2011-11-06 11:29:04.000000000 +0200 +--- a/contrib/ntsc-cc.c ++++ b/contrib/ntsc-cc.c @@ -32,7 +32,6 @@ #include #include #include -#include #include + #include #include - #ifdef HAVE_GETOPT_LONG -@@ -44,6 +43,7 @@ +@@ -45,6 +44,7 @@ #include "src/libzvbi.h" #ifdef ENABLE_V4L2 diff --git a/depends/common/zvbi/04-zvbi-ssize_max.patch b/depends/common/libzvbi/03-zvbi-ssize_max.patch similarity index 73% rename from depends/common/zvbi/04-zvbi-ssize_max.patch rename to depends/common/libzvbi/03-zvbi-ssize_max.patch index eb980a61..efad9aa8 100644 --- a/depends/common/zvbi/04-zvbi-ssize_max.patch +++ b/depends/common/libzvbi/03-zvbi-ssize_max.patch @@ -1,9 +1,8 @@ Linear memory extents over SSIZE_MAX are undefined, so there is no point in protecting against them. -diff -ru zvbi.orig/src/export.c zvbi/src/export.c ---- zvbi.orig/src/export.c 2011-11-06 11:22:47.000000000 +0200 -+++ zvbi/src/export.c 2011-11-06 11:27:39.000000000 +0200 -@@ -1076,8 +1076,6 @@ +--- a/src/export.c ++++ b/src/export.c +@@ -1056,8 +1056,6 @@ size_t count; count = src_size; @@ -12,7 +11,7 @@ diff -ru zvbi.orig/src/export.c zvbi/src/export.c for (retry = 10;; --retry) { actual = write (e->_handle.fd, src, count); -@@ -1632,12 +1630,7 @@ +@@ -1614,12 +1612,7 @@ free (e->buffer.data); } @@ -26,3 +25,4 @@ diff -ru zvbi.orig/src/export.c zvbi/src/export.c } else { if (VBI_EXPORT_TARGET_ALLOC == e->target) free (e->buffer.data); + diff --git a/depends/common/libzvbi/04-prevent-test.patch b/depends/common/libzvbi/04-prevent-test.patch new file mode 100644 index 00000000..e97cee38 --- /dev/null +++ b/depends/common/libzvbi/04-prevent-test.patch @@ -0,0 +1,76 @@ +--- a/Makefile.am ++++ b/Makefile.am +@@ -22,8 +22,6 @@ SUBDIRS = \ + src \ + $(proxy_dirs) \ + contrib \ +- examples \ +- test \ + po \ + doc + +--- a/Makefile.in ++++ b/Makefile.in +@@ -78,7 +78,7 @@ pkgconfigDATA_INSTALL = $(INSTALL_DATA) + DATA = $(pkgconfig_DATA) + ETAGS = etags + CTAGS = ctags +-DIST_SUBDIRS = m4 src daemon contrib examples test po doc ++DIST_SUBDIRS = m4 src daemon contrib po doc + DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + distdir = $(PACKAGE)-$(VERSION) + top_distdir = $(distdir) +@@ -268,8 +268,6 @@ SUBDIRS = \ + src \ + $(proxy_dirs) \ + contrib \ +- examples \ +- test \ + po \ + doc + +--- a/configure ++++ b/configure +@@ -18591,7 +18591,7 @@ else + fi + + +-ac_config_files="$ac_config_files Makefile contrib/Makefile examples/Makefile daemon/Makefile daemon/zvbid.init doc/Doxyfile doc/Makefile m4/Makefile src/Makefile src/dvb/Makefile test/Makefile po/Makefile.in zvbi.spec zvbi-0.2.pc" ++ac_config_files="$ac_config_files Makefile contrib/Makefile daemon/Makefile daemon/zvbid.init doc/Doxyfile doc/Makefile m4/Makefile src/Makefile src/dvb/Makefile po/Makefile.in zvbi.spec zvbi-0.2.pc" + + cat >confcache <<\_ACEOF + # This file is a shell script that caches the results of configure +@@ -19726,7 +19726,6 @@ do + "po-directories") CONFIG_COMMANDS="$CONFIG_COMMANDS po-directories" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "contrib/Makefile") CONFIG_FILES="$CONFIG_FILES contrib/Makefile" ;; +- "examples/Makefile") CONFIG_FILES="$CONFIG_FILES examples/Makefile" ;; + "daemon/Makefile") CONFIG_FILES="$CONFIG_FILES daemon/Makefile" ;; + "daemon/zvbid.init") CONFIG_FILES="$CONFIG_FILES daemon/zvbid.init" ;; + "doc/Doxyfile") CONFIG_FILES="$CONFIG_FILES doc/Doxyfile" ;; +@@ -19734,7 +19733,6 @@ do + "m4/Makefile") CONFIG_FILES="$CONFIG_FILES m4/Makefile" ;; + "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; + "src/dvb/Makefile") CONFIG_FILES="$CONFIG_FILES src/dvb/Makefile" ;; +- "test/Makefile") CONFIG_FILES="$CONFIG_FILES test/Makefile" ;; + "po/Makefile.in") CONFIG_FILES="$CONFIG_FILES po/Makefile.in" ;; + "zvbi.spec") CONFIG_FILES="$CONFIG_FILES zvbi.spec" ;; + "zvbi-0.2.pc") CONFIG_FILES="$CONFIG_FILES zvbi-0.2.pc" ;; +--- a/configure.in ++++ b/configure.in +@@ -384,7 +384,6 @@ AM_CONDITIONAL(BUILD_STATIC_LIB, [test "x$enable_static" = xyes]) + AC_OUTPUT([ + Makefile + contrib/Makefile +- examples/Makefile + daemon/Makefile + daemon/zvbid.init + doc/Doxyfile +@@ -392,7 +391,6 @@ AC_OUTPUT([ + m4/Makefile + src/Makefile + src/dvb/Makefile +- test/Makefile + po/Makefile.in + zvbi.spec + zvbi-0.2.pc diff --git a/depends/common/zvbi/06-zvbi-ios-without-settime.patch b/depends/common/libzvbi/05-zvbi-ios-without-settime.patch similarity index 58% rename from depends/common/zvbi/06-zvbi-ios-without-settime.patch rename to depends/common/libzvbi/05-zvbi-ios-without-settime.patch index b0e336b4..9240fb3e 100644 --- a/depends/common/zvbi/06-zvbi-ios-without-settime.patch +++ b/depends/common/libzvbi/05-zvbi-ios-without-settime.patch @@ -1,6 +1,5 @@ -diff -ur zvbi/test/date.c zvbi-patched/test/date.c ---- zvbi/test/date.c 2020-01-14 15:05:17.000000000 +0000 -+++ zvbi-patched/test/date.c 2020-01-17 09:34:16.000000000 +0000 +--- a/test/date.c ++++ b/test/date.c @@ -86,7 +86,7 @@ static void set_time (const vbi_local_time * lt) diff --git a/depends/common/zvbi/05-have-libm-on-end.patch b/depends/common/libzvbi/06-zvbi-fix-static-linkage.patch similarity index 54% rename from depends/common/zvbi/05-have-libm-on-end.patch rename to depends/common/libzvbi/06-zvbi-fix-static-linkage.patch index af1641cd..3988a3e2 100644 --- a/depends/common/zvbi/05-have-libm-on-end.patch +++ b/depends/common/libzvbi/06-zvbi-fix-static-linkage.patch @@ -1,29 +1,25 @@ -From defae63a167b0592b6c596a7c1f3ca83e7b65586 Mon Sep 17 00:00:00 2001 -From: Alwin Esch -Date: Wed, 15 Jan 2020 15:50:04 +0100 -Subject: [PATCH] have libm on end - ---- - configure.in | 2 +- - examples/Makefile.am | 2 +- - examples/Makefile.in | 2 +- - 3 files changed, 3 insertions(+), 3 deletions(-) - -diff --git a/configure.in b/configure.in -index 3cf3857..68680fd 100644 +--- a/configure ++++ b/configure +@@ -16515,7 +16515,7 @@ + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_png_png_destroy_write_struct" >&5 + $as_echo "$ac_cv_lib_png_png_destroy_write_struct" >&6; } + if test "x$ac_cv_lib_png_png_destroy_write_struct" = x""yes; then : +- LIBS="$LIBS -lpng -lz" ++ LIBS="-lpng -lz $LIBS" + else + HAVE_PNG="no" + fi --- a/configure.in +++ b/configure.in @@ -244,7 +244,7 @@ dnl (PNG page export) dnl HAVE_PNG="yes" AC_CHECK_LIB(png, png_destroy_write_struct, -- LIBS="-lpng -lz $LIBS", HAVE_PNG="no", -lz -lm) +- LIBS="$LIBS -lpng -lz", HAVE_PNG="no", -lz -lm) + LIBS="-lpng $LIBS -lz -lm", HAVE_PNG="no", -lz -lm) if test "x$HAVE_PNG" = xyes; then AC_DEFINE(HAVE_LIBPNG, 1, [Define if you have libpng]) fi -diff --git a/examples/Makefile.am b/examples/Makefile.am -index 783c758..8187c14 100644 --- a/examples/Makefile.am +++ b/examples/Makefile.am @@ -19,4 +19,4 @@ EXTRA_DIST = \ @@ -32,8 +28,6 @@ index 783c758..8187c14 100644 LDADD = $(top_builddir)/src/libzvbi.la \ - $(PTHREAD_LIB) -lm $(PNG_LIB) + $(PTHREAD_LIB) $(PNG_LIB) -lm -diff --git a/examples/Makefile.in b/examples/Makefile.in -index 62c0414..fe0ba73 100644 --- a/examples/Makefile.in +++ b/examples/Makefile.in @@ -262,7 +262,7 @@ EXTRA_DIST = \ @@ -45,6 +39,3 @@ index 62c0414..fe0ba73 100644 all: all-am --- -2.20.1 - diff --git a/depends/common/zvbi/CMakeLists.txt b/depends/common/libzvbi/CMakeLists.txt similarity index 91% rename from depends/common/zvbi/CMakeLists.txt rename to depends/common/libzvbi/CMakeLists.txt index 765073ca..9d4e77e5 100644 --- a/depends/common/zvbi/CMakeLists.txt +++ b/depends/common/libzvbi/CMakeLists.txt @@ -1,4 +1,4 @@ -project(zvbi) +project(libzvbi) cmake_minimum_required(VERSION 3.5) @@ -11,12 +11,12 @@ if (CORE_SYSTEM_NAME STREQUAL osx) list(APPEND zvbi_conf CFLAGS=-fnested-functions) elseif (CORE_SYSTEM_NAME STREQUAL android) list(APPEND zvbi_conf LIBS=-liconv) -elseif (CORE_SYSTEM_NAME STREQUAL darwind_embedded) +elseif (CORE_SYSTEM_NAME STREQUAL darwin_embedded) list(APPEND zvbi_conf CFLAGS=-DDARWIN_EMBEDDED) endif() include(ExternalProject) -externalproject_add(zvbi +externalproject_add(libzvbi SOURCE_DIR ${CMAKE_SOURCE_DIR} CONFIGURE_COMMAND /configure --prefix=${CMAKE_INSTALL_PREFIX} diff --git a/depends/common/zvbi/deps.txt b/depends/common/libzvbi/deps.txt similarity index 100% rename from depends/common/zvbi/deps.txt rename to depends/common/libzvbi/deps.txt diff --git a/depends/common/zvbi/zvbi.sha256 b/depends/common/libzvbi/libzvbi.sha256 similarity index 100% rename from depends/common/zvbi/zvbi.sha256 rename to depends/common/libzvbi/libzvbi.sha256 diff --git a/depends/common/libzvbi/libzvbi.txt b/depends/common/libzvbi/libzvbi.txt new file mode 100644 index 00000000..78f339c3 --- /dev/null +++ b/depends/common/libzvbi/libzvbi.txt @@ -0,0 +1 @@ +libzvbi http://mirrors.kodi.tv/build-deps/sources/zvbi-0.2.35.tar.bz2 diff --git a/depends/common/zvbi/platforms.txt b/depends/common/libzvbi/platforms.txt similarity index 100% rename from depends/common/zvbi/platforms.txt rename to depends/common/libzvbi/platforms.txt diff --git a/depends/common/zvbi/02-zvbi-fix-static-linking.patch b/depends/common/zvbi/02-zvbi-fix-static-linking.patch deleted file mode 100644 index 03ff7c58..00000000 --- a/depends/common/zvbi/02-zvbi-fix-static-linking.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- zvbi/configure.in 2013-08-28 13:52:48.000000000 +0000 -+++ zvbi.patched/configure.in 2016-11-02 21:25:34.292580446 +0000 -@@ -244,7 +244,7 @@ - dnl - HAVE_PNG="yes" - AC_CHECK_LIB(png, png_destroy_write_struct, -- LIBS="$LIBS -lpng -lz", HAVE_PNG="no", -lz -lm) -+ LIBS="-lpng -lz $LIBS", HAVE_PNG="no", -lz -lm) - if test "x$HAVE_PNG" = xyes; then - AC_DEFINE(HAVE_LIBPNG, 1, [Define if you have libpng]) - fi diff --git a/depends/common/zvbi/07-zvbi-libm-on-end-configure.patch b/depends/common/zvbi/07-zvbi-libm-on-end-configure.patch deleted file mode 100644 index 490f7876..00000000 --- a/depends/common/zvbi/07-zvbi-libm-on-end-configure.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -ur zvbi/configure zvbi-patched/configure ---- zvbi/configure 2020-01-14 15:05:17.000000000 +0000 -+++ zvbi-patched/configure 2020-01-17 22:39:33.000000000 +0000 -@@ -16515,7 +16515,7 @@ - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_png_png_destroy_write_struct" >&5 - $as_echo "$ac_cv_lib_png_png_destroy_write_struct" >&6; } - if test "x$ac_cv_lib_png_png_destroy_write_struct" = x""yes; then : -- LIBS="$LIBS -lpng -lz" -+ LIBS="-lpng -lz $LIBS" - else - HAVE_PNG="no" - fi diff --git a/depends/common/zvbi/zvbi.txt b/depends/common/zvbi/zvbi.txt deleted file mode 100644 index 04624bec..00000000 --- a/depends/common/zvbi/zvbi.txt +++ /dev/null @@ -1 +0,0 @@ -zvbi http://mirrors.kodi.tv/build-deps/sources/zvbi-0.2.35.tar.bz2 From 27ac2333e6038d890f192b3f0d6dbf003c2aee84 Mon Sep 17 00:00:00 2001 From: Alwin Esch Date: Sun, 26 Jan 2020 14:49:05 +0100 Subject: [PATCH 16/23] remove no more needed depends patches --- ...d-test-with-this-as-static-on-ffmpeg.patch | 12 ---------- ...te-public-for-static-on-libpng.pc.in.patch | 24 ------------------- ...d-test-with-this-as-static-on-ffmpeg.patch | 24 ------------------- 3 files changed, 60 deletions(-) delete mode 100644 depends/common/gnutls/03-fix-build-test-with-this-as-static-on-ffmpeg.patch delete mode 100644 depends/common/libpng/01-make-private-public-for-static-on-libpng.pc.in.patch delete mode 100644 depends/common/libxml2/02-fix-build-test-with-this-as-static-on-ffmpeg.patch diff --git a/depends/common/gnutls/03-fix-build-test-with-this-as-static-on-ffmpeg.patch b/depends/common/gnutls/03-fix-build-test-with-this-as-static-on-ffmpeg.patch deleted file mode 100644 index fe4d590d..00000000 --- a/depends/common/gnutls/03-fix-build-test-with-this-as-static-on-ffmpeg.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -ur gnutls/lib/gnutls.pc.in gnutls-patched/lib/gnutls.pc.in ---- gnutls/lib/gnutls.pc.in 2020-01-17 09:38:47.000000000 +0000 -+++ gnutls-patched/lib/gnutls.pc.in 2020-01-17 09:40:17.000000000 +0000 -@@ -18,7 +18,7 @@ - Description: Transport Security Layer implementation for the GNU system - URL: http://www.gnutls.org/ - Version: @VERSION@ --Libs: -L${libdir} -lgnutls -+Libs: -L${libdir} -lgnutls @HOGWEED_LIBS@ @NETTLE_LIBS@ @GMP_LIBS@ @LIBDL@ @LIBIDN2_LIBS@ - Libs.private: @LTLIBZ@ @LTLIBINTL@ @LIBSOCKET@ @LTLIBNSL@ @LTLIBPTHREAD@ @P11_KIT_LIBS@ @LIB_SELECT@ @TSS_LIBS@ @GMP_LIBS@ @LTLIBUNISTRING@ @LIBIDN2_LIBS@ - @GNUTLS_REQUIRES_PRIVATE@ - Cflags: -I${includedir} diff --git a/depends/common/libpng/01-make-private-public-for-static-on-libpng.pc.in.patch b/depends/common/libpng/01-make-private-public-for-static-on-libpng.pc.in.patch deleted file mode 100644 index 5f8af4b3..00000000 --- a/depends/common/libpng/01-make-private-public-for-static-on-libpng.pc.in.patch +++ /dev/null @@ -1,24 +0,0 @@ -From 07a81169b4c29e3556069547da823eb450db2ea1 Mon Sep 17 00:00:00 2001 -From: Alwin Esch -Date: Wed, 15 Jan 2020 15:23:06 +0100 -Subject: [PATCH] make private public for static on libpng.pc.in - ---- - libpng.pc.in | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/libpng.pc.in b/libpng.pc.in -index 9708e9a..a5cde77 100644 ---- a/libpng.pc.in -+++ b/libpng.pc.in -@@ -7,6 +7,6 @@ Name: libpng - Description: Loads and saves PNG files - Version: @PNGLIB_VERSION@ - Requires: zlib --Libs: -L${libdir} -lpng@PNGLIB_MAJOR@@PNGLIB_MINOR@ -+Libs: -L${libdir} -lpng@PNGLIB_MAJOR@@PNGLIB_MINOR@ -lm @LIBS@ - Libs.private: @LIBS@ - Cflags: -I${includedir} --- -2.20.1 - diff --git a/depends/common/libxml2/02-fix-build-test-with-this-as-static-on-ffmpeg.patch b/depends/common/libxml2/02-fix-build-test-with-this-as-static-on-ffmpeg.patch deleted file mode 100644 index 8704d9d5..00000000 --- a/depends/common/libxml2/02-fix-build-test-with-this-as-static-on-ffmpeg.patch +++ /dev/null @@ -1,24 +0,0 @@ -From d40608c79689ba1f014625c9368139bb8a006659 Mon Sep 17 00:00:00 2001 -From: Alwin Esch -Date: Wed, 15 Jan 2020 09:58:43 +0100 -Subject: [PATCH] fix build test with this as static on ffmpeg - ---- - libxml-2.0.pc.in | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/libxml-2.0.pc.in b/libxml-2.0.pc.in -index 2653a7c..c7de7e5 100644 ---- a/libxml-2.0.pc.in -+++ b/libxml-2.0.pc.in -@@ -8,6 +8,6 @@ Name: libXML - Version: @VERSION@ - Description: libXML library version2. - Requires: --Libs: -L${libdir} -lxml2 -+Libs: -L${libdir} -lxml2 @ICU_LIBS@ @THREAD_LIBS@ @Z_LIBS@ @LZMA_LIBS@ @ICONV_LIBS@ @M_LIBS@ @WIN32_EXTRA_LIBADD@ @LIBS@ - Libs.private: @ICU_LIBS@ @THREAD_LIBS@ @Z_LIBS@ @LZMA_LIBS@ @ICONV_LIBS@ @M_LIBS@ @WIN32_EXTRA_LIBADD@ @LIBS@ - Cflags: @XML_INCLUDEDIR@ @XML_CFLAGS@ --- -2.20.1 - From 4162569ce45db275e2ad39f0727b19e3b548cfb2 Mon Sep 17 00:00:00 2001 From: Alwin Esch Date: Sun, 26 Jan 2020 14:51:19 +0100 Subject: [PATCH 17/23] use openssl 1.1.1d on windows UWP --- depends/windowsstore/openssl/CMakeLists.txt | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/depends/windowsstore/openssl/CMakeLists.txt b/depends/windowsstore/openssl/CMakeLists.txt index d1298257..9116e5fa 100644 --- a/depends/windowsstore/openssl/CMakeLists.txt +++ b/depends/windowsstore/openssl/CMakeLists.txt @@ -5,13 +5,16 @@ include(CheckSymbolExists) check_symbol_exists(_X86_ "Windows.h" _X86_) check_symbol_exists(_AMD64_ "Windows.h" _X64_) check_symbol_exists(_ARM_ "Windows.h" _ARM_) +check_symbol_exists(_ARM64_ "Windows.h" _ARM64_) if(_X86_) - set(OPENSSL_ARCHIVE_NAME openssl-1.0.2o-win10-Win32-v141) + set(OPENSSL_ARCHIVE_NAME openssl-1.1.1d-win10-win32-v141-20200105) elseif(_X64_) - set(OPENSSL_ARCHIVE_NAME openssl-1.0.2o-win10-x64-v141) + set(OPENSSL_ARCHIVE_NAME openssl-1.1.1d-win10-x64-v141-20200105) elseif(_ARM_) - set(OPENSSL_ARCHIVE_NAME openssl-1.0.2o-win10-ARM-v141) + set(OPENSSL_ARCHIVE_NAME openssl-1.1.1d-win10-arm-v141-20200105) +elseif(_ARM64_) + set(OPENSSL_ARCHIVE_NAME openssl-1.1.1d-win10-arm64-v141-20200105) else() message(FATAL_ERROR "Unsupported architecture") endif() From a237ea5700f0feaf9f05afb1dbd5b1c3574605a8 Mon Sep 17 00:00:00 2001 From: Alwin Esch Date: Sun, 26 Jan 2020 14:52:18 +0100 Subject: [PATCH 18/23] remove bootstrap call from nettle depend --- depends/common/nettle/CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/depends/common/nettle/CMakeLists.txt b/depends/common/nettle/CMakeLists.txt index 785b3477..17ef97a5 100644 --- a/depends/common/nettle/CMakeLists.txt +++ b/depends/common/nettle/CMakeLists.txt @@ -15,7 +15,6 @@ list(APPEND nettle_conf LIBS=-lgmp) include(ExternalProject) externalproject_add(nettle SOURCE_DIR ${CMAKE_SOURCE_DIR} - UPDATE_COMMAND /.bootstrap CONFIGURE_COMMAND /configure --prefix=${CMAKE_INSTALL_PREFIX} --libdir=${CMAKE_INSTALL_PREFIX}/lib From 615fb13005b675dea76e5805ce234df0bea51573 Mon Sep 17 00:00:00 2001 From: Alwin Esch Date: Sun, 26 Jan 2020 14:53:20 +0100 Subject: [PATCH 19/23] cleanup gnutls --- depends/common/gnutls/CMakeLists.txt | 2 +- depends/common/gnutls/deps.txt | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/depends/common/gnutls/CMakeLists.txt b/depends/common/gnutls/CMakeLists.txt index c67d9e09..c50b81db 100644 --- a/depends/common/gnutls/CMakeLists.txt +++ b/depends/common/gnutls/CMakeLists.txt @@ -1,4 +1,4 @@ -project(gmp) +project(gnutls) cmake_minimum_required(VERSION 3.5) diff --git a/depends/common/gnutls/deps.txt b/depends/common/gnutls/deps.txt index 061b2e57..c7916f58 100644 --- a/depends/common/gnutls/deps.txt +++ b/depends/common/gnutls/deps.txt @@ -1,3 +1,4 @@ nettle gmp xz-utils +zlib From b5a3744244004d308ca8a3734a58df936a465379 Mon Sep 17 00:00:00 2001 From: Alwin Esch Date: Sun, 26 Jan 2020 23:20:55 +0100 Subject: [PATCH 20/23] make GMP usable on iOS --- depends/common/gmp/CMakeLists.txt | 81 +++++++++++++++++++------------ depends/common/gmp/gmp.sha256 | 2 +- depends/common/gmp/gmp.txt | 2 +- 3 files changed, 52 insertions(+), 33 deletions(-) diff --git a/depends/common/gmp/CMakeLists.txt b/depends/common/gmp/CMakeLists.txt index c7e64f4c..04dea1a1 100644 --- a/depends/common/gmp/CMakeLists.txt +++ b/depends/common/gmp/CMakeLists.txt @@ -1,41 +1,60 @@ -project(gmp) - cmake_minimum_required(VERSION 3.5) +project(gmp) list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}) -if(CORE_SYSTEM_NAME MATCHES "linux") - if (CPU MATCHES "i.86") - list(APPEND gmp_conf ABI=32) +include(ExternalProject) + +if(CORE_SYSTEM_NAME STREQUAL osx OR + CORE_SYSTEM_NAME STREQUAL ios OR + CORE_SYSTEM_NAME STREQUAL darwin_embedded) + + if(CORE_SYSTEM_NAME STREQUAL ios OR CORE_SYSTEM_NAME STREQUAL darwin_embedded) + set(EXTRA_ARGS "--disable-assembly") + else() + set(EXTRA_ARGS "--with-pic") + if(CMAKE_SIZEOF_VOID_P EQUAL 8) + set(EXTRA_ARGS "${EXTRA_ARGS} ABI=64") + else() + set(EXTRA_ARGS "${EXTRA_ARGS} ABI=32") + endif() endif() - list(APPEND gmp_conf --with-pic) -elseif(CORE_SYSTEM_NAME MATCHES "darwin_embedded") - list(APPEND gmp_conf --disable-assembly) -elseif(CORE_SYSTEM_NAME MATCHES "osx") - list(APPEND gmp_conf --with-pic) -endif() -# -# Darwin based OSes will use -isysroot, however libtool will expect --sysroot -# So we hack around this otherwise libttol won't be able to find the standard C headers -# -if(CORE_SYSTEM_NAME STREQUAL osx OR CORE_SYSTEM_NAME STREQUAL ios OR CORE_SYSTEM_NAME STREQUAL darwin_embedded) - set (COMPILER_WITH_LIBTOOL_SYSROOT_APPLE - "CC_FOR_BUILD=${CMAKE_C_COMPILER} --sysroot ${CMAKE_OSX_SYSROOT}" - "CPP_FOR_BUILD=${CMAKE_C_COMPILER} -E --sysroot ${CMAKE_OSX_SYSROOT}" - ) + externalproject_add(gmp + SOURCE_DIR ${CMAKE_SOURCE_DIR} + CONFIGURE_COMMAND + bash --login -c + "./configure \ + --prefix=${CMAKE_BINARY_DIR}/gmpbuild \ + CC='${CMAKE_C_COMPILER} ${CMAKE_C_FLAGS}' \ + LDFLAGS='${CMAKE_EXE_LINKER_FLAGS}' \ + CPP='${CMAKE_C_COMPILER} -E' \ + CPPFLAGS='${CMAKE_C_FLAGS}' \ + --host=x86_64-apple-darwin \ + ${EXTRA_ARGS} \ + --enable-static \ + --disable-shared" + BUILD_COMMAND make + INSTALL_COMMAND + make install && + # Is installed to different place to become no conflict during configure with + # "./share/config.site" on addon depends binary folder + cmake -E copy_directory ${CMAKE_BINARY_DIR}/gmpbuild ${CMAKE_INSTALL_PREFIX} + BUILD_IN_SOURCE TRUE) else() - set (COMPILER_WITH_LIBTOOL_SYSROOT_APPLE "") -endif() + if(CORE_SYSTEM_NAME MATCHES "linux" AND CPU MATCHES "i.86") + list(APPEND gmp_conf ABI=32) + endif() -include(ExternalProject) -externalproject_add(gmp - SOURCE_DIR ${CMAKE_SOURCE_DIR} - CONFIGURE_COMMAND /configure - ${COMPILER_WITH_LIBTOOL_SYSROOT_APPLE} - --prefix=${CMAKE_INSTALL_PREFIX} - --disable-shared - ${gmp_conf}) + externalproject_add(gmp + SOURCE_DIR ${CMAKE_SOURCE_DIR} + CONFIGURE_COMMAND /configure + --prefix=${CMAKE_INSTALL_PREFIX} + --disable-assembly + --enable-static + --disable-shared + --with-pic + ${gmp_conf}) +endif() install(CODE "Message(Done)") - diff --git a/depends/common/gmp/gmp.sha256 b/depends/common/gmp/gmp.sha256 index ddeeba7d..5753de38 100644 --- a/depends/common/gmp/gmp.sha256 +++ b/depends/common/gmp/gmp.sha256 @@ -1 +1 @@ -5275bb04f4863a13516b2f39392ac5e272f5e1bb8057b18aec1c9b79d73d8fb2 +258e6cd51b3fbdfc185c716d55f82c08aff57df0c6fbd143cf6ed561267a1526 diff --git a/depends/common/gmp/gmp.txt b/depends/common/gmp/gmp.txt index 08c78cbe..625c12b6 100644 --- a/depends/common/gmp/gmp.txt +++ b/depends/common/gmp/gmp.txt @@ -1 +1 @@ -gmp http://mirrors.kodi.tv/build-deps/sources/gmp-6.1.2.tar.bz2 +gmp https://gmplib.org/download/gmp/gmp-6.2.0.tar.xz From 7b4937b878cf19231f45212f8c5169638bec2854 Mon Sep 17 00:00:00 2001 From: Alwin Esch Date: Sun, 26 Jan 2020 19:42:47 +0100 Subject: [PATCH 21/23] update AppVeyor to show all OS --- appveyor.yml | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 93cd2435..b32852a1 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -10,15 +10,27 @@ environment: app_id: inputstream.ffmpegdirect matrix: - - GENERATOR: "Visual Studio 15" - CONFIG: Release - - GENERATOR: "Visual Studio 15 Win64" - CONFIG: Release - - GENERATOR: "Visual Studio 15 Win64" - CONFIG: Release + - GENERATOR: "Visual Studio 15 2017" + ARCHITECTURE: Win32 + CONFIGURATION: Release + - GENERATOR: "Visual Studio 15 2017" + ARCHITECTURE: x64 + CONFIGURATION: Release + - GENERATOR: "Visual Studio 15 2017" + ARCHITECTURE: Win32 + CONFIGURATION: Release WINSTORE: -DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION="10.0.17763.0" - - GENERATOR: "Visual Studio 15 ARM" - CONFIG: Release + - GENERATOR: "Visual Studio 15 2017" + ARCHITECTURE: x64 + CONFIGURATION: Release + WINSTORE: -DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION="10.0.17763.0" + - GENERATOR: "Visual Studio 15 2017" + ARCHITECTURE: ARM + CONFIGURATION: Release + WINSTORE: -DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION="10.0.17763.0" + - GENERATOR: "Visual Studio 15 2017" + ARCHITECTURE: ARM64 + CONFIGURATION: Release WINSTORE: -DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION="10.0.17763.0" build_script: @@ -29,5 +41,5 @@ build_script: - cd build - mkdir -p definition\%app_id% - echo %app_id% %APPVEYOR_BUILD_FOLDER% %APPVEYOR_REPO_COMMIT% > definition\%app_id%\%app_id%.txt - - cmake -T host=x64 -G "%GENERATOR%" %WINSTORE% -DADDONS_TO_BUILD=%app_id% -DCMAKE_BUILD_TYPE=%CONFIG% -DADDONS_DEFINITION_DIR=%APPVEYOR_BUILD_FOLDER%/build/definition -DADDON_SRC_PREFIX=../.. -DCMAKE_INSTALL_PREFIX=../../xbmc/addons -DPACKAGE_ZIP=1 ../../xbmc/cmake/addons - - cmake --build . --config %CONFIG% --target %app_id% \ No newline at end of file + - cmake -T host=x64 -G "%GENERATOR%" -A %ARCHITECTURE% %WINSTORE% -DADDONS_TO_BUILD=%app_id% -DCMAKE_BUILD_TYPE=%CONFIGURATION% -DADDONS_DEFINITION_DIR=%APPVEYOR_BUILD_FOLDER%/build/definition -DADDON_SRC_PREFIX=../.. -DCMAKE_INSTALL_PREFIX=../../xbmc/addons -DPACKAGE_ZIP=1 ../../xbmc/cmake/addons + - cmake --build . --config %CONFIGURATION% --target %app_id% From 8a8755941138b9d79a37fbba3c5d1428a8243024 Mon Sep 17 00:00:00 2001 From: Alwin Esch Date: Sun, 26 Jan 2020 19:54:57 +0100 Subject: [PATCH 22/23] change addon code to allow windows --- CMakeLists.txt | 70 ++++++++++++------- FindIconv.cmake | 45 ++++++++++++ src/stream/FFmpegStream.cpp | 9 ++- src/stream/platform/posix/PlatformDefs.h | 2 + .../threads/platform/win/ThreadImpl.cpp | 8 +-- src/stream/url/URL.cpp | 32 ++++++--- 6 files changed, 121 insertions(+), 45 deletions(-) create mode 100644 FindIconv.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 7af08d37..9ef6f0c8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,6 +4,11 @@ project(inputstream.ffmpegdirect) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}) find_package(PkgConfig) +if(WIN32) + find_package(LibXml2 REQUIRED) + find_package(Iconv REQUIRED) + find_package(OpenSSL REQUIRED) +endif() find_package(p8-platform REQUIRED) find_package(Kodi REQUIRED) find_package(FFMPEG REQUIRED) @@ -16,7 +21,6 @@ set(CATCHUP_SOURCES src/StreamManager.cpp src/stream/FFmpegLog.cpp src/stream/FFmpegStream.cpp src/stream/commons/Exception.cpp - src/stream/platform/posix/XTimeUtils.cpp src/stream/threads/Atomics.cpp src/stream/threads/Event.cpp src/stream/threads/Thread.cpp @@ -35,8 +39,6 @@ set(CATCHUP_HEADERS src/StreamManager.h src/stream/FFmpegStream.h src/stream/IManageDemuxPacket.h src/stream/commons/Exception.h - src/stream/platform/posix/PlatformDefs.h - src/stream/platform/posix/XTimeUtils.h src/stream/threads/Atomics.h src/stream/threads/Condition.h src/stream/threads/CriticalSection.h @@ -55,38 +57,56 @@ set(CATCHUP_HEADERS src/StreamManager.h src/stream/url/UrlOptions.h src/stream/url/Variant.h) +if(NOT WIN32) + list(APPEND CATCHUP_SOURCES src/stream/platform/posix/XTimeUtils.cpp) + + list(APPEND CATCHUP_HEADERS src/stream/platform/posix/PlatformDefs.h + src/stream/platform/posix/XTimeUtils.h) +endif() + include_directories(${p8-platform_INCLUDE_DIRS} ${INCLUDES} ${FFMPEG_INCLUDE_DIRS} ${ZLIB_INCLUDE_DIRS} ${BZIP2_INCLUDE_DIRS} + ${OPENSSL_INCLUDE_DIR} + ${LIBXML2_INCLUDE_DIRS} ${KODI_INCLUDE_DIR}/..) # Hack way with "/..", need bigger Kodi cmake rework to match right include ways (becomes done in future) -list(APPEND DEPLIBS ${p8-platform_LIBRARIES} ${FFMPEG_LIBRARIES} ${ZLIB_LIBRARIES} ${BZIP2_LIBRARIES}) +list(APPEND DEPLIBS ${p8-platform_LIBRARIES} + ${FFMPEG_LIBRARIES} + ${ZLIB_LIBRARIES} + ${BZIP2_LIBRARIES}) +if(WIN32) + list(APPEND DEPLIBS ${ICONV_LIBRARIES} + ${OPENSSL_LIBRARIES} + ${LIBXML2_LIBRARIES}) +endif() # to see linker output #set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -v") if(CORE_SYSTEM_NAME MATCHES "windows") - list(APPEND DEPLIBS Winmm.lib WS2_32.lib) + list(APPEND DEPLIBS Winmm.lib WS2_32.lib Bcrypt.lib Secur32.lib) endif() -if(CORE_SYSTEM_NAME MATCHES "osx") - find_library(AUDIOTOOLBOX AudioToolbox) - find_library(COREFOUNDATION CoreFoundation) - find_library(COREMEDIA CoreMedia) - find_library(VIDEOTOOLBOX VideoToolbox) - - include_directories(${AVFOUNDATION} - ${COCOA} - ${COREFOUNDATION} - ${COREMEDIA} - ${COREVIDEO} - ${COREMEDIAIO} - ${VIDEOTOOLBOX} - ${COCOA}) - - list(APPEND DEPLIBS ${AUDIOTOOLBOX} ${COREFOUNDATION} ${COREMEDIA} ${VIDEOTOOLBOX}) +if(CORE_SYSTEM_NAME STREQUAL osx OR + CORE_SYSTEM_NAME STREQUAL darwin_embedded) + find_library(AUDIOTOOLBOX AudioToolbox) + find_library(COREFOUNDATION CoreFoundation) + find_library(COREMEDIA CoreMedia) + find_library(VIDEOTOOLBOX VideoToolbox) + + include_directories(${AVFOUNDATION} + ${COCOA} + ${COREFOUNDATION} + ${COREMEDIA} + ${COREVIDEO} + ${COREMEDIAIO} + ${VIDEOTOOLBOX} + ${COCOA}) + + list(APPEND DEPLIBS ${AUDIOTOOLBOX} ${COREFOUNDATION} ${COREMEDIA} ${VIDEOTOOLBOX}) endif() addon_version(inputstream.ffmpegdirect CATCHUP) @@ -97,10 +117,10 @@ build_addon(inputstream.ffmpegdirect CATCHUP DEPLIBS) set_target_properties(inputstream.ffmpegdirect PROPERTIES LINK_FLAGS "${FFMPEG_LDFLAGS}") if(CORE_SYSTEM_NAME STREQUAL windowsstore) - # fix linking - set_target_properties(inputstream.ffmpegdirect PROPERTIES LINK_FLAGS_RELWITHDEBINFO "/LTCG /defaultlib:vccorlib.lib /defaultlib:msvcrt.lib") - set_target_properties(inputstream.ffmpegdirect PROPERTIES LINK_FLAGS_RELEASE "/LTCG /defaultlib:vccorlib.lib /defaultlib:msvcrt.lib") - set_target_properties(inputstream.ffmpegdirect PROPERTIES LINK_FLAGS_DEBUG "/LTCG /defaultlib:vccorlibd.lib /defaultlib:msvcrtd.lib") + # fix linking + set_target_properties(inputstream.ffmpegdirect PROPERTIES LINK_FLAGS_RELWITHDEBINFO "/LTCG /defaultlib:vccorlib.lib /defaultlib:msvcrt.lib") + set_target_properties(inputstream.ffmpegdirect PROPERTIES LINK_FLAGS_RELEASE "/LTCG /defaultlib:vccorlib.lib /defaultlib:msvcrt.lib") + set_target_properties(inputstream.ffmpegdirect PROPERTIES LINK_FLAGS_DEBUG "/LTCG /defaultlib:vccorlibd.lib /defaultlib:msvcrtd.lib") endif() include(CPack) diff --git a/FindIconv.cmake b/FindIconv.cmake new file mode 100644 index 00000000..189c198f --- /dev/null +++ b/FindIconv.cmake @@ -0,0 +1,45 @@ +#.rst: +# FindICONV +# -------- +# Finds the ICONV library +# +# This will define the following variables:: +# +# ICONV_FOUND - system has ICONV +# ICONV_INCLUDE_DIRS - the ICONV include directory +# ICONV_LIBRARIES - the ICONV libraries +# +# and the following imported targets:: +# +# ICONV::ICONV - The ICONV library + +find_path(ICONV_INCLUDE_DIR NAMES iconv.h) + +find_library(ICONV_LIBRARY NAMES iconv libiconv c) + +set(CMAKE_REQUIRED_LIBRARIES ${ICONV_LIBRARY}) +include(CheckFunctionExists) +check_function_exists(iconv HAVE_ICONV_FUNCTION) +if(NOT HAVE_ICONV_FUNCTION) + check_function_exists(libiconv HAVE_LIBICONV_FUNCTION2) + set(HAVE_ICONV_FUNCTION ${HAVE_LIBICONV_FUNCTION2}) + unset(HAVE_LIBICONV_FUNCTION2) +endif() + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(Iconv + REQUIRED_VARS ICONV_LIBRARY ICONV_INCLUDE_DIR HAVE_ICONV_FUNCTION) + +if(ICONV_FOUND) + set(ICONV_LIBRARIES ${ICONV_LIBRARY}) + set(ICONV_INCLUDE_DIRS ${ICONV_INCLUDE_DIR}) + + if(NOT TARGET ICONV::ICONV) + add_library(ICONV::ICONV UNKNOWN IMPORTED) + set_target_properties(ICONV::ICONV PROPERTIES + IMPORTED_LOCATION "${ICONV_LIBRARY}" + INTERFACE_INCLUDE_DIRECTORIES "${ICONV_INCLUDE_DIR}") + endif() +endif() + +mark_as_advanced(ICONV_INCLUDE_DIR ICONV_LIBRARY HAVE_ICONV_FUNCTION) diff --git a/src/stream/FFmpegStream.cpp b/src/stream/FFmpegStream.cpp index e64c3031..88a3519f 100644 --- a/src/stream/FFmpegStream.cpp +++ b/src/stream/FFmpegStream.cpp @@ -25,9 +25,8 @@ // #include -#ifdef TARGET_POSIX -#include "platform/posix/XTimeUtils.h" -#endif +#include +#include #ifndef __STDC_CONSTANT_MACROS #define __STDC_CONSTANT_MACROS @@ -1197,7 +1196,7 @@ bool FFmpegStream::SeekTime(double time, bool backwards, double* startpts) if (pkt) m_demuxPacketMamnager->FreeDemuxPacketFromInputStreamAPI(pkt); else - Sleep(10); + std::this_thread::sleep_for(std::chrono::milliseconds(10)); m_pkt.result = -1; av_packet_unref(&m_pkt.pkt); @@ -2046,4 +2045,4 @@ bool FFmpegStream::SeekChapter(int chapter) AVChapter* ch = m_pFormatContext->chapters[chapter - 1]; double dts = ConvertTimestamp(ch->start, ch->time_base.den, ch->time_base.num); return SeekTime(DVD_TIME_TO_MSEC(dts), true); -} \ No newline at end of file +} diff --git a/src/stream/platform/posix/PlatformDefs.h b/src/stream/platform/posix/PlatformDefs.h index ea0ae821..809620e3 100644 --- a/src/stream/platform/posix/PlatformDefs.h +++ b/src/stream/platform/posix/PlatformDefs.h @@ -11,7 +11,9 @@ #include #include #include +#ifndef _WIN32 #include +#endif #include #include #if defined(TARGET_DARWIN) diff --git a/src/stream/threads/platform/win/ThreadImpl.cpp b/src/stream/threads/platform/win/ThreadImpl.cpp index c37f40ab..f2e23795 100644 --- a/src/stream/threads/platform/win/ThreadImpl.cpp +++ b/src/stream/threads/platform/win/ThreadImpl.cpp @@ -6,10 +6,7 @@ * See LICENSES/README.md for more information. */ -#include "utils/log.h" - -#include "platform/win32/WIN32Util.h" - +#include #include #include @@ -42,7 +39,8 @@ void CThread::SetThreadInfo() { } - CWIN32Util::SetThreadLocalLocale(true); // avoid crashing with setlocale(), see https://connect.microsoft.com/VisualStudio/feedback/details/794122 + // avoid crashing with setlocale(), see https://connect.microsoft.com/VisualStudio/feedback/details/794122 + _configthreadlocale(_ENABLE_PER_THREAD_LOCALE); } std::uintptr_t CThread::GetCurrentThreadNativeHandle() diff --git a/src/stream/url/URL.cpp b/src/stream/url/URL.cpp index 7ad24b3d..30f9a9ef 100644 --- a/src/stream/url/URL.cpp +++ b/src/stream/url/URL.cpp @@ -36,6 +36,18 @@ bool IsURL(const std::string& strFile) return strFile.find("://") != std::string::npos; } +bool IsDOSPath(const std::string& path) +{ + if (path.size() > 1 && path[1] == ':' && isalpha(path[0])) + return true; + + // windows network drives + if (path.size() > 1 && path[0] == '\\' && path[1] == '\\') + return true; + + return false; +} + std::string ValidatePath(const std::string &path)//, bool bFixDoubleSlashes /* = false */) { std::string result = path; @@ -48,22 +60,22 @@ std::string ValidatePath(const std::string &path)//, bool bFixDoubleSlashes /* = // check the path for incorrect slashes #ifdef TARGET_WINDOWS - if (URIUtils::IsDOSPath(path)) + if (IsDOSPath(path)) { StringUtils::Replace(result, '/', '\\'); /* The double slash correction should only be used when *absolutely* necessary! This applies to certain DLLs or use from Python DLLs/scripts that incorrectly generate double (back) slashes. */ - if (bFixDoubleSlashes && !result.empty()) - { - // Fixup for double back slashes (but ignore the \\ of unc-paths) - for (size_t x = 1; x < result.size() - 1; x++) - { - if (result[x] == '\\' && result[x+1] == '\\') - result.erase(x, 1); - } - } + // if (bFixDoubleSlashes && !result.empty()) + // { + // // Fixup for double back slashes (but ignore the \\ of unc-paths) + // for (size_t x = 1; x < result.size() - 1; x++) + // { + // if (result[x] == '\\' && result[x+1] == '\\') + // result.erase(x, 1); + // } + // } } else if (path.find("://") != std::string::npos || path.find(":\\\\") != std::string::npos) #endif From 66f0c1858471f92003467600e1a5241683bd660a Mon Sep 17 00:00:00 2001 From: Alwin Esch Date: Mon, 27 Jan 2020 11:59:16 +0100 Subject: [PATCH 23/23] update Jenkins file to use all --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index f23e198a..3d3080aa 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1 +1 @@ -buildPlugin(version: "Matrix", deploy: ['android-aarch64', 'android-arm7', 'ios-aarch64', 'ios-arm7', 'osx-x86_64', 'ubuntu-ppa']) +buildPlugin(version: "Matrix")