diff options
Diffstat (limited to 'third-party/patches')
5 files changed, 296 insertions, 0 deletions
diff --git a/third-party/patches/gettext-Fix-compilation-on-a-system-without-alloca.patch b/third-party/patches/gettext-Fix-compilation-on-a-system-without-alloca.patch new file mode 100644 index 0000000000..5c472c470f --- /dev/null +++ b/third-party/patches/gettext-Fix-compilation-on-a-system-without-alloca.patch @@ -0,0 +1,28 @@ +From 1d12aeb7334104f77070361492ff7cc8225503f5 Mon Sep 17 00:00:00 2001 +From: Daiki Ueno <ueno@gnu.org> +Date: Mon, 14 Nov 2016 13:27:58 +0100 +Subject: [PATCH] intl: Fix compilation on a system without alloca + +* gettext-runtime/intl/dcigettext.c (DCIGETTEXT): Fix typo 'tmp_dirname' +-> 'resolved_dirname'. Reported by Egor Pugin in: +http://lists.gnu.org/archive/html/bug-gettext/2016-09/msg00008.html +--- + gettext-runtime/intl/dcigettext.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/gettext-runtime/intl/dcigettext.c b/gettext-runtime/intl/dcigettext.c +index 83bd77574..92f6fd685 100644 +--- a/gettext-runtime/intl/dcigettext.c ++++ b/gettext-runtime/intl/dcigettext.c +@@ -634,7 +634,7 @@ DCIGETTEXT (const char *domainname, const char *msgid1, const char *msgid2, + for (;;) + { + resolved_dirname = (char *) alloca (path_max + dirname_len); +- ADD_BLOCK (block_list, tmp_dirname); ++ ADD_BLOCK (block_list, resolved_dirname); + + __set_errno (0); + ret = getcwd (resolved_dirname, path_max); +-- +2.16.1.windows.4 + diff --git a/third-party/patches/libtermkey-Add-support-for-Windows.patch b/third-party/patches/libtermkey-Add-support-for-Windows.patch new file mode 100644 index 0000000000..b839e94d05 --- /dev/null +++ b/third-party/patches/libtermkey-Add-support-for-Windows.patch @@ -0,0 +1,170 @@ +From fbe91a958816d85fa93665eb8f7a7a8e05eb9650 Mon Sep 17 00:00:00 2001 +From: Rui Abreu Ferreira <raf-ep@gmx.com> +Date: Tue, 5 Apr 2016 00:12:41 +0100 +Subject: [PATCH] Add support for Windows + +Ported termkey for windows. + +- The TERMKEY_FLAG_NOTERMIOS is ignore in Windows, since there is no termios. +- The termkey_waitkey() function is not implemented in windows, since there + is no poll() alternative. +- The CMake recipe only supports unibilium, not curses. +--- + driver-ti.c | 8 +++++++- + termkey-internal.h | 11 ++++++++++- + termkey.c | 22 ++++++++++++++++++---- + 3 files changed, 35 insertions(+), 6 deletions(-) + +diff --git a/driver-ti.c b/driver-ti.c +index e673ab7..f5f8052 100644 +--- a/driver-ti.c ++++ b/driver-ti.c +@@ -17,7 +17,9 @@ + #include <ctype.h> + #include <stdio.h> + #include <string.h> +-#include <unistd.h> ++#ifndef _WIN32 ++# include <unistd.h> ++#endif + #include <sys/types.h> + #include <sys/stat.h> + +@@ -338,8 +340,10 @@ static int start_driver(TermKey *tk, void *info) + if(fstat(tk->fd, &statbuf) == -1) + return 0; + ++#ifndef _WIN32 + if(S_ISFIFO(statbuf.st_mode)) + return 1; ++#endif + + // Can't call putp or tputs because they suck and don't give us fd control + len = strlen(start_string); +@@ -367,8 +371,10 @@ static int stop_driver(TermKey *tk, void *info) + if(fstat(tk->fd, &statbuf) == -1) + return 0; + ++#ifndef _WIN32 + if(S_ISFIFO(statbuf.st_mode)) + return 1; ++#endif + + /* The terminfo database will contain keys in application cursor key mode. + * We may need to enable that mode +diff --git a/termkey-internal.h b/termkey-internal.h +index 52829b3..b796729 100644 +--- a/termkey-internal.h ++++ b/termkey-internal.h +@@ -4,7 +4,14 @@ + #include "termkey.h" + + #include <stdint.h> +-#include <termios.h> ++#ifndef _WIN32 ++# include <termios.h> ++#endif ++ ++#ifdef _MSC_VER ++#include <BaseTsd.h> ++typedef SSIZE_T ssize_t; ++#endif + + struct TermKeyDriver + { +@@ -41,8 +48,10 @@ struct TermKey { + size_t hightide; /* Position beyond buffstart at which peekkey() should next start + * normally 0, but see also termkey_interpret_csi */ + ++#ifndef _WIN32 + struct termios restore_termios; + char restore_termios_valid; ++#endif + + TermKey_Terminfo_Getstr_Hook *ti_getstr_hook; + void *ti_getstr_hook_data; +diff --git a/termkey.c b/termkey.c +index 2f01f3a..145b99f 100644 +--- a/termkey.c ++++ b/termkey.c +@@ -3,14 +3,20 @@ + + #include <ctype.h> + #include <errno.h> +-#include <poll.h> +-#include <unistd.h> ++#ifndef _WIN32 ++# include <poll.h> ++# include <unistd.h> ++# include <strings.h> ++#endif + #include <string.h> +-#include <strings.h> + + #include <stdio.h> + +-#define strcaseeq(a,b) (strcasecmp(a,b) == 0) ++#ifdef _MSC_VER ++# define strcaseeq(a,b) (_stricmp(a,b) == 0) ++#else ++# define strcaseeq(a,b) (strcasecmp(a,b) == 0) ++#endif + + void termkey_check_version(int major, int minor) + { +@@ -282,7 +288,9 @@ static TermKey *termkey_alloc(void) + tk->buffsize = 256; /* bytes */ + tk->hightide = 0; + ++#ifndef _WIN32 + tk->restore_termios_valid = 0; ++#endif + + tk->ti_getstr_hook = NULL; + tk->ti_getstr_hook_data = NULL; +@@ -483,6 +491,7 @@ int termkey_start(TermKey *tk) + if(tk->is_started) + return 1; + ++#ifndef _WIN32 + if(tk->fd != -1 && !(tk->flags & TERMKEY_FLAG_NOTERMIOS)) { + struct termios termios; + if(tcgetattr(tk->fd, &termios) == 0) { +@@ -517,6 +526,7 @@ int termkey_start(TermKey *tk) + tcsetattr(tk->fd, TCSANOW, &termios); + } + } ++#endif + + struct TermKeyDriverNode *p; + for(p = tk->drivers; p; p = p->next) +@@ -542,8 +552,10 @@ int termkey_stop(TermKey *tk) + if(p->driver->stop_driver) + (*p->driver->stop_driver)(tk, p->info); + ++#ifndef _WIN32 + if(tk->restore_termios_valid) + tcsetattr(tk->fd, TCSANOW, &tk->restore_termios); ++#endif + + tk->is_started = 0; + +@@ -1046,6 +1058,7 @@ TermKeyResult termkey_getkey_force(TermKey *tk, TermKeyKey *key) + return ret; + } + ++#ifndef _WIN32 + TermKeyResult termkey_waitkey(TermKey *tk, TermKeyKey *key) + { + if(tk->fd == -1) { +@@ -1105,6 +1118,7 @@ retry: + + /* UNREACHABLE */ + } ++#endif + + TermKeyResult termkey_advisereadable(TermKey *tk) + { +-- +2.16.1.windows.4 + diff --git a/third-party/patches/libvterm-Remove-VLAs-for-MSVC.patch b/third-party/patches/libvterm-Remove-VLAs-for-MSVC.patch new file mode 100644 index 0000000000..e999c0fa9b --- /dev/null +++ b/third-party/patches/libvterm-Remove-VLAs-for-MSVC.patch @@ -0,0 +1,50 @@ +From eb386b1d82f7d07363c9133b7aa06902ccd555fe Mon Sep 17 00:00:00 2001 +Date: Tue, 27 Feb 2018 17:54:20 -0600 +Subject: [PATCH] Remove VLAs for MSVC + +VLAs are replaced with calls to _alloca() because MSVC does not support them. +--- + src/state.c | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +diff --git a/src/state.c b/src/state.c +index 84299df..f9aabb3 100644 +--- a/src/state.c ++++ b/src/state.c +@@ -1,5 +1,6 @@ + #include "vterm_internal.h" + ++#include <malloc.h> + #include <stdio.h> + #include <string.h> + +@@ -236,7 +237,7 @@ static int on_text(const char bytes[], size_t len, void *user) + VTermPos oldpos = state->pos; + + // We'll have at most len codepoints +- uint32_t codepoints[len]; ++ uint32_t* codepoints = _alloca(len * sizeof(uint32_t)); + int npoints = 0; + size_t eaten = 0; + +@@ -313,7 +314,7 @@ static int on_text(const char bytes[], size_t len, void *user) + + int width = 0; + +- uint32_t chars[glyph_ends - glyph_starts + 1]; ++ uint32_t* chars = _alloca((glyph_ends - glyph_starts + 1) * sizeof(uint32_t)); + + for( ; i < glyph_ends; i++) { + chars[i - glyph_starts] = codepoints[i]; +@@ -512,7 +513,7 @@ static int settermprop_int(VTermState *state, VTermProp prop, int v) + + static int settermprop_string(VTermState *state, VTermProp prop, const char *str, size_t len) + { +- char strvalue[len+1]; ++ char* strvalue = _alloca(len+1); + strncpy(strvalue, str, len); + strvalue[len] = 0; + +-- +2.16.1.windows.4 + diff --git a/third-party/patches/luarocks-Change-default-downloader-to-curl.patch b/third-party/patches/luarocks-Change-default-downloader-to-curl.patch new file mode 100644 index 0000000000..b7109a3b53 --- /dev/null +++ b/third-party/patches/luarocks-Change-default-downloader-to-curl.patch @@ -0,0 +1,24 @@ +From 69313032fad04743c96bc8f2a029b691857488f9 Mon Sep 17 00:00:00 2001 +Date: Thu, 1 Mar 2018 21:41:29 -0600 +Subject: [PATCH] Change default downloader to curl + +--- + install.bat | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/install.bat b/install.bat +index 09cf9aa..76e4059 100644 +--- a/install.bat ++++ b/install.bat +@@ -1037,7 +1037,7 @@ f:write(S[=[ + site_config.LUAROCKS_UNAME_M=[[$UNAME_M]] + site_config.LUAROCKS_ROCKS_TREE=[[$TREE_ROOT]] + site_config.LUAROCKS_PREFIX=[[$PREFIX]] +-site_config.LUAROCKS_DOWNLOADER=[[wget]] ++site_config.LUAROCKS_DOWNLOADER=[[curl]] + site_config.LUAROCKS_MD5CHECKER=[[md5sum]] + ]=]) + if FORCE_CONFIG then +-- +2.16.1.windows.4 + diff --git a/third-party/patches/luv-Add-missing-definitions-for-MinGW.patch b/third-party/patches/luv-Add-missing-definitions-for-MinGW.patch new file mode 100644 index 0000000000..8954ae21c3 --- /dev/null +++ b/third-party/patches/luv-Add-missing-definitions-for-MinGW.patch @@ -0,0 +1,24 @@ +diff --git a/src/dns.c b/src/dns.c +index 8634157..5f36625 100644 +--- a/src/dns.c ++++ b/src/dns.c +@@ -20,6 +20,19 @@ + #include <sys/types.h> + #include <sys/socket.h> + #include <netdb.h> ++#elif __MINGW32__ ++# ifndef AI_NUMERICSERV ++# define AI_NUMERICSERV 0x0008 ++# endif ++# ifndef AI_ALL ++# define AI_ALL 0x00000100 ++# endif ++# ifndef AI_ADDRCONFIG ++# define AI_ADDRCONFIG 0x00000400 ++# endif ++# ifndef AI_V4MAPPED ++# define AI_V4MAPPED 0x00000800 ++# endif + #endif + + static void luv_pushaddrinfo(lua_State* L, struct addrinfo* res) { |