summaryrefslogtreecommitdiff
path: root/win32
diff options
context:
space:
mode:
authorAndrej Shadura <andrew.shadura@collabora.co.uk>2018-10-28 12:50:29 +0100
committerAndrej Shadura <andrew.shadura@collabora.co.uk>2018-10-28 12:50:29 +0100
commit20b38fea7b2b8e6dd31a62dbc5ec9e4c2888a013 (patch)
tree2386d0f12f008c869cf223f84f244fa8488cb5e4 /win32
parentfe91e6f4733198be72be8dc036fb715b3ffa59b9 (diff)
New upstream version 3.10
Diffstat (limited to 'win32')
-rw-r--r--win32/notes.html111
-rw-r--r--win32/override/README.txt.in10
-rw-r--r--win32/patches/atkprivate.c.diff17
-rw-r--r--win32/patches/gdk-pixbuf-util.c.diff18
-rw-r--r--win32/patches/ggettext.c.diff66
-rw-r--r--win32/patches/glib-2-52.diff61
-rw-r--r--win32/patches/glib-gettext-fix.diff124
-rw-r--r--win32/patches/gtkicontheme.c.diff28
-rw-r--r--win32/patches/gtkmain.c.diff17
9 files changed, 309 insertions, 143 deletions
diff --git a/win32/notes.html b/win32/notes.html
index 88c4588..ef5ef61 100644
--- a/win32/notes.html
+++ b/win32/notes.html
@@ -32,7 +32,7 @@ export LIBRARY_PATH=/C/GTK/lib:/C/libs/lib</tt></p></blockquote>
<p>In the MinGW shell (MSYS2 MinGW 32-bit, <b>not</b> MSYS2 MSYS):</p>
<blockquote><p><tt>pacman -Syu<br>
-pacman -S autoconf automake bison libtool mingw-w64-i686-gcc mingw-w64-i686-gettext make perl-XML-Parser pkg-config python2</tt></p></blockquote>
+pacman -S autoconf automake bison gperf libtool mingw-w64-i686-gcc mingw-w64-i686-gettext make perl-XML-Parser pkg-config python2</tt></p></blockquote>
<h3>Install CMake</h3>
@@ -81,11 +81,10 @@ make install</tt></p></blockquote>
<h3>Install GLib</h3>
<p>Download and unzip to <tt>C:\glib</tt>:<br>
-<a href="http://ftp.gnome.org/pub/GNOME/sources/glib/2.52/glib-2.52.1.tar.xz">
-<tt>http://ftp.gnome.org/pub/GNOME/sources/glib/2.52/glib-2.52.1.tar.xz</tt></a></p>
+<a href="http://ftp.gnome.org/pub/GNOME/sources/glib/2.52/glib-2.52.3.tar.xz">
+<tt>http://ftp.gnome.org/pub/GNOME/sources/glib/2.52/glib-2.52.3.tar.xz</tt></a></p>
-<p>Apply the patch <tt>ggettext.c.diff</tt> to <tt>C:\glib\glib\ggettext.c</tt>.<br>
-Apply the recursive patch <tt>glib-2-52.diff</tt>.</p>
+<p>Apply the recursive patches <tt>glib-2-52.diff</tt> and <tt>glib-gettext-fix.diff</tt>.</p>
<p>In the MinGW shell:</p>
<blockquote><p><tt>cd /C/glib<br>
@@ -117,6 +116,42 @@ make install</tt></p></blockquote>
make<br>
make install</tt></p></blockquote>
+<h3>Install FreeType</h3>
+
+<p>Download and unzip to <tt>C:\freetype</tt>:<br>
+<a href="https://sourceforge.net/projects/freetype/files/freetype2/2.9/freetype-2.9.tar.bz2/download">
+<tt>https://sourceforge.net/projects/freetype/files/freetype2/2.9/freetype-2.9.tar.bz2/download</tt></a></p>
+
+<p>In the MinGW shell:</p>
+<blockquote><p><tt>cd /C/freetype<br>
+./configure --prefix=/C/GTK<br>
+make<br>
+make install</tt></p></blockquote>
+
+<h3>Install HarfBuzz</h3>
+
+<p>Download and unzip to <tt>C:\harfbuzz</tt>:<br>
+<a href="https://www.freedesktop.org/software/harfbuzz/release/harfbuzz-1.7.4.tar.bz2">
+<tt>https://www.freedesktop.org/software/harfbuzz/release/harfbuzz-1.7.4.tar.bz2</tt></a></p>
+
+<p>In the MinGW shell:</p>
+<blockquote><p><tt>cd /C/harfbuzz<br>
+./configure --prefix=/C/GTK<br>
+make<br>
+make install</tt></p></blockquote>
+
+<h3>Install Fontconfig</h3>
+
+<p>Download and unzip to <tt>C:\fontconfig</tt>:<br>
+<a href="https://www.freedesktop.org/software/fontconfig/release/fontconfig-2.12.6.tar.bz2">
+<tt>https://www.freedesktop.org/software/fontconfig/release/fontconfig-2.12.6.tar.bz2</tt></a></p>
+
+<p>In the MinGW shell:</p>
+<blockquote><p><tt>cd /C/fontconfig<br>
+./configure --prefix=/C/GTK<br>
+make<br>
+make install</tt></p></blockquote>
+
<h3>Install Pango</h3>
<p>Download and unzip to <tt>C:\pango</tt>:<br>
@@ -135,9 +170,35 @@ make install</tt></p></blockquote>
<a href="http://ftp.gnome.org/pub/GNOME/sources/gdk-pixbuf/2.36/gdk-pixbuf-2.36.6.tar.xz">
<tt>http://ftp.gnome.org/pub/GNOME/sources/gdk-pixbuf/2.36/gdk-pixbuf-2.36.6.tar.xz</tt></a></p>
+<p>Apply the patch <tt>gdk-pixbuf-util.c.diff</tt> to <tt>C:\gdk-pixbuf\gdk-pixbuf\gdk-pixbuf-util.c</tt>.</p>
+
<p>In the MinGW shell:</p>
<blockquote><p><tt>cd /C/gdk-pixbuf<br>
-./configure --prefix=/C/GTK --without-gdiplus --without-libtiff --with-included-loaders=jpeg,png<br>
+./configure --prefix=/C/GTK --enable-relocations --without-gdiplus --without-libtiff --with-included-loaders=jpeg,png<br>
+make<br>
+make install</tt></p></blockquote>
+
+<h3>Install libcroco</h3>
+
+<p>Download and unzip to <tt>C:\libcroco</tt>:<br>
+<a href="http://ftp.gnome.org/pub/GNOME/sources/libcroco/0.6/libcroco-0.6.12.tar.xz">
+<tt>http://ftp.gnome.org/pub/GNOME/sources/libcroco/0.6/libcroco-0.6.12.tar.xz</tt></a></p>
+
+<p>In the MinGW shell:</p>
+<blockquote><p><tt>cd /C/libcroco<br>
+./configure --prefix=/C/GTK<br>
+make<br>
+make install</tt></p></blockquote>
+
+<h3>Install librsvg</h3>
+
+<p>Download and unzip to <tt>C:\librsvg</tt>:<br>
+<a href="http://ftp.gnome.org/pub/GNOME/sources/librsvg/2.40/librsvg-2.40.20.tar.xz">
+<tt>http://ftp.gnome.org/pub/GNOME/sources/librsvg/2.40/librsvg-2.40.20.tar.xz</tt></a></p>
+
+<p>In the MinGW shell:</p>
+<blockquote><p><tt>cd /C/librsvg<br>
+./configure --prefix=/C/GTK --disable-introspection<br>
make<br>
make install</tt></p></blockquote>
@@ -147,6 +208,8 @@ make install</tt></p></blockquote>
<a href="http://ftp.gnome.org/pub/gnome/sources/atk/2.24/atk-2.24.0.tar.xz">
<tt>http://ftp.gnome.org/pub/gnome/sources/atk/2.24/atk-2.24.0.tar.xz</tt></a></p>
+<p>Apply the patch <tt>atkprivate.c.diff</tt> to <tt>C:\atk\atk\atkprivate.c</tt>.</p>
+
<p>In the MinGW shell:</p>
<blockquote><p><tt>cd /C/atk<br>
./configure --prefix=/C/GTK<br>
@@ -159,7 +222,9 @@ make install</tt></p></blockquote>
<a href="http://ftp.gnome.org/pub/GNOME/sources/gtk+/2.24/gtk+-2.24.31.tar.xz">
<tt>http://ftp.gnome.org/pub/GNOME/sources/gtk+/2.24/gtk+-2.24.31.tar.xz</tt></a></p>
-<p>Apply the patch <tt>gdkwindow-win32.c.diff</tt> to <tt>C:\gtksrc\gdk\win32\gdkwindow-win32.c</tt>.</p>
+<p>Apply the patch <tt>gdkwindow-win32.c.diff</tt> to <tt>C:\gtksrc\gdk\win32\gdkwindow-win32.c</tt>.<br>
+Apply the patch <tt>gtkicontheme.c.diff</tt> to <tt>C:\gtksrc\gtk\gtkicontheme.c</tt>.<br>
+Apply the patch <tt>gtkmain.c.diff</tt> to <tt>C:\gtksrc\gtk\gtkmain.c</tt>.</p>
<p>In the MinGW shell:</p>
<blockquote><p><tt>cd /C/gtksrc<br>
@@ -439,6 +504,30 @@ autoreconf<br>
make<br>
make install</tt></p></blockquote>
+<h3>Install libbinio</h3>
+
+<p>Download and unzip to <tt>C:\libbinio</tt>:<br>
+<a href="https://sourceforge.net/projects/libbinio/files/libbinio/1.4/libbinio-1.4.tar.bz2/download">
+<tt>https://sourceforge.net/projects/libbinio/files/libbinio/1.4/libbinio-1.4.tar.bz2/download</tt></a></p>
+
+<p>In the MinGW shell:</p>
+<blockquote><p><tt>cd /C/libbinio<br>
+./configure --prefix=/C/libs<br>
+make<br>
+make install</tt></p></blockquote>
+
+<h3>Install adplug</h3>
+
+<p>Download and unzip to <tt>C:\adplug</tt>:<br>
+<a href="https://github.com/adplug/adplug/releases/download/adplug-2.3/adplug-2.3.tar.bz2">
+<tt>https://github.com/adplug/adplug/releases/download/adplug-2.3/adplug-2.3.tar.bz2</tt></a></p>
+
+<p>In the MinGW shell:</p>
+<blockquote><p><tt>cd /C/adplug<br>
+./configure --prefix=/C/libs<br>
+make<br>
+make install</tt></p></blockquote>
+
<h3>Install libmodplug</h3>
<p>Download and unzip to <tt>C:\libmodplug</tt>:<br>
@@ -481,8 +570,8 @@ make install</tt></p></blockquote>
<h3>Install Audacious</h3>
<p>Download and unzip to <tt>C:\audacious</tt>:<br>
-<a href="http://distfiles.audacious-media-player.org/audacious-3.8.tar.bz2">
-<tt>http://distfiles.audacious-media-player.org/audacious-3.8.tar.bz2</tt></a></p>
+<a href="https://distfiles.audacious-media-player.org/audacious-3.8.tar.bz2">
+<tt>https://distfiles.audacious-media-player.org/audacious-3.8.tar.bz2</tt></a></p>
<p>In the MinGW shell:</p>
<blockquote><p><tt>cd /C/audacious<br>
@@ -493,8 +582,8 @@ make install</tt></p></blockquote>
<h3>Install Audacious Plugins</h3>
<p>Download and unzip to <tt>C:\audacious-plugins</tt>:<br>
-<a href="http://distfiles.audacious-media-player.org/audacious-plugins-3.8.tar.bz2">
-<tt>http://distfiles.audacious-media-player.org/audacious-plugins-3.8.tar.bz2</tt></a></p>
+<a href="https://distfiles.audacious-media-player.org/audacious-plugins-3.8.tar.bz2">
+<tt>https://distfiles.audacious-media-player.org/audacious-plugins-3.8.tar.bz2</tt></a></p>
<p>In the MinGW shell:</p>
<blockquote><p><tt>cd /C/audacious-plugins<br>
diff --git a/win32/override/README.txt.in b/win32/override/README.txt.in
index 1801df2..1e528d8 100644
--- a/win32/override/README.txt.in
+++ b/win32/override/README.txt.in
@@ -1,6 +1,6 @@
Audacious @PACKAGE_VERSION@ for Windows
- http://audacious-media-player.org
+ https://audacious-media-player.org
Audacious is free and open source software. By installing Audacious, you agree
to be bound by various licenses governing its use and redistribution.
@@ -27,9 +27,9 @@ from the use of this software.
EXCEPTIONS
-Other than the Audacious logo itself, the images included with Audacious are
-either based on the Tango Icon Library (public domain) or the GNOME Icon Theme
-(CC BY-SA 3.0; see https://creativecommons.org/licenses/by-sa/3.0/us/).
+Audacious includes icons adapted from the Paper Icon Set by Sam Hewitt. These
+icons are distributed under the Creative Commons Attribution-ShareAlike 4.0
+license (see https://creativecommons.org/licenses/by-sa/4.0/).
Please note that many of the plugins distributed with Audacious are under
different licenses, whose full text may be found either in the "About" window
@@ -85,4 +85,4 @@ and license of each project can be found on the Internet.
If you are an author of one of these projects and do not wish your software
included with Audacious in binary form, please contact us via the support forum:
- http://redmine.audacious-media-player.org/projects/audacious/boards
+ https://redmine.audacious-media-player.org/projects/audacious/boards
diff --git a/win32/patches/atkprivate.c.diff b/win32/patches/atkprivate.c.diff
new file mode 100644
index 0000000..b66c20d
--- /dev/null
+++ b/win32/patches/atkprivate.c.diff
@@ -0,0 +1,17 @@
+--- atk/atkprivate.c.0 2017-01-09 09:37:24.000000000 -0500
++++ atk/atkprivate.c 2018-05-30 23:18:27.572970500 -0400
+@@ -77,9 +77,13 @@
+ g_free (root);
+
+ /* atk_localedir is passed to bindtextdomain() which isn't
+- * UTF-8-aware.
++ * UTF-8-aware. Try to convert the path back to the legacy
++ * 8-bit locale. If that's impossible, there's not much we
++ * can do so just return the original build-time path.
+ */
+ atk_localedir = g_win32_locale_filename_from_utf8 (temp);
++ if (atk_localedir == NULL)
++ atk_localedir = g_strdup (ATK_LOCALEDIR);
+ g_free (temp);
+ }
+ return atk_localedir;
diff --git a/win32/patches/gdk-pixbuf-util.c.diff b/win32/patches/gdk-pixbuf-util.c.diff
new file mode 100644
index 0000000..6abea31
--- /dev/null
+++ b/win32/patches/gdk-pixbuf-util.c.diff
@@ -0,0 +1,18 @@
+--- gdk-pixbuf/gdk-pixbuf-util.c.0 2016-12-20 08:43:26.000000000 -0500
++++ gdk-pixbuf/gdk-pixbuf-util.c 2018-05-30 22:57:54.900626100 -0400
+@@ -363,9 +363,13 @@
+ {
+ gchar *retval;
+ /* The localedir is passed to bindtextdomain() which isn't
+- * UTF-8-aware.
+- */
++ * UTF-8-aware. Try to convert the path back to the legacy
++ * 8-bit locale. If that's impossible, there's not much we
++ * can do so just return the original build-time path.
++ */
+ retval = g_win32_locale_filename_from_utf8 (temp);
++ if (retval == NULL)
++ retval = g_strdup (GDK_PIXBUF_LOCALEDIR);
+ g_free (temp);
+ return retval;
+ }
diff --git a/win32/patches/ggettext.c.diff b/win32/patches/ggettext.c.diff
deleted file mode 100644
index 7bb8ae8..0000000
--- a/win32/patches/ggettext.c.diff
+++ /dev/null
@@ -1,66 +0,0 @@
---- ggettext.c.0 2013-10-25 11:58:38 -0400
-+++ ggettext.c 2014-03-23 22:07:29 -0400
-@@ -94,17 +94,32 @@
- #endif /* G_OS_WIN32 */
-
-
--static void
-+static gboolean
- ensure_gettext_initialized (void)
- {
- static gsize initialised;
-
-+#ifdef G_OS_WIN32
-+ static GThread * init_thread_atomic;
-+ GThread * init_thread = g_atomic_pointer_get (& init_thread_atomic);
-+
-+ /* avoid deadlock if _glib_get_locale_dir() calls back into gettext */
-+ if (G_UNLIKELY (init_thread && init_thread == g_thread_self ()))
-+ return FALSE;
-+#endif
-+
- if (g_once_init_enter (&initialised))
- {
- #ifdef G_OS_WIN32
-- gchar *tmp = _glib_get_locale_dir ();
-+ gchar *tmp;
-+
-+ g_atomic_pointer_set (&init_thread_atomic, g_thread_self ());
-+
-+ tmp = _glib_get_locale_dir ();
- bindtextdomain (GETTEXT_PACKAGE, tmp);
- g_free (tmp);
-+
-+ g_atomic_pointer_set (&init_thread_atomic, NULL);
- #else
- bindtextdomain (GETTEXT_PACKAGE, GLIB_LOCALE_DIR);
- #endif
-@@ -113,6 +128,8 @@
- # endif
- g_once_init_leave (&initialised, TRUE);
- }
-+
-+ return TRUE;
- }
-
- /**
-@@ -128,7 +145,8 @@
- const gchar *
- glib_gettext (const gchar *str)
- {
-- ensure_gettext_initialized ();
-+ if (G_UNLIKELY (!ensure_gettext_initialized ()))
-+ return str;
-
- return g_dgettext (GETTEXT_PACKAGE, str);
- }
-@@ -152,7 +170,8 @@
- glib_pgettext (const gchar *msgctxtid,
- gsize msgidoffset)
- {
-- ensure_gettext_initialized ();
-+ if (G_UNLIKELY (!ensure_gettext_initialized ()))
-+ return msgctxtid;
-
- return g_dpgettext (GETTEXT_PACKAGE, msgctxtid, msgidoffset);
- }
diff --git a/win32/patches/glib-2-52.diff b/win32/patches/glib-2-52.diff
index 14d08db..624090f 100644
--- a/win32/patches/glib-2-52.diff
+++ b/win32/patches/glib-2-52.diff
@@ -166,64 +166,3 @@ index b547012b6..4eb7d96c1 100644
ext_down = g_utf8_casefold (content_type, -1);
if (!ext_down)
-diff --git a/gio/gwin32registrykey.c b/gio/gwin32registrykey.c
-index 313980bc0..ab03a469f 100644
---- a/gio/gwin32registrykey.c
-+++ b/gio/gwin32registrykey.c
-@@ -89,18 +89,18 @@ typedef NTSTATUS
- PULONG result_size);
-
- typedef NTSTATUS
--(* NtNotifyChangeMultipleKeysFunc)(HANDLE key_handle,
-- ULONG subkey_count,
-- POBJECT_ATTRIBUTES subkeys,
-- HANDLE event,
-- PIO_APC_ROUTINE apc_routine,
-- PVOID apc_closure,
-- PIO_STATUS_BLOCK status_block,
-- ULONG filter,
-- BOOLEAN watch_tree,
-- PVOID buffer,
-- ULONG buffer_size,
-- BOOLEAN async);
-+(NTAPI * NtNotifyChangeMultipleKeysFunc)(HANDLE key_handle,
-+ ULONG subkey_count,
-+ POBJECT_ATTRIBUTES subkeys,
-+ HANDLE event,
-+ PIO_APC_ROUTINE apc_routine,
-+ PVOID apc_closure,
-+ PIO_STATUS_BLOCK status_block,
-+ ULONG filter,
-+ BOOLEAN watch_tree,
-+ PVOID buffer,
-+ ULONG buffer_size,
-+ BOOLEAN async);
-
- static NtQueryKeyFunc nt_query_key = NULL;
- static NtNotifyChangeMultipleKeysFunc nt_notify_change_multiple_keys = NULL;
-diff --git a/glib/gfileutils.c b/glib/gfileutils.c
-index 6789c537f..ea3806eeb 100644
---- a/glib/gfileutils.c
-+++ b/glib/gfileutils.c
-@@ -317,6 +317,11 @@ gboolean
- g_file_test (const gchar *filename,
- GFileTest test)
- {
-+#ifdef G_OS_WIN32
-+ int attributes;
-+ wchar_t *wfilename;
-+#endif
-+
- g_return_val_if_fail (filename != NULL, FALSE);
-
- #ifdef G_OS_WIN32
-@@ -327,8 +332,7 @@ g_file_test (const gchar *filename,
- # ifndef FILE_ATTRIBUTE_DEVICE
- # define FILE_ATTRIBUTE_DEVICE 64
- # endif
-- int attributes;
-- wchar_t *wfilename = g_utf8_to_utf16 (filename, -1, NULL, NULL, NULL);
-+ wfilename = g_utf8_to_utf16 (filename, -1, NULL, NULL, NULL);
-
- if (wfilename == NULL)
- return FALSE;
diff --git a/win32/patches/glib-gettext-fix.diff b/win32/patches/glib-gettext-fix.diff
new file mode 100644
index 0000000..7f06934
--- /dev/null
+++ b/win32/patches/glib-gettext-fix.diff
@@ -0,0 +1,124 @@
+From 1d4e36a04b8ab49fafccb0bbdb74d4961b5eed58 Mon Sep 17 00:00:00 2001
+From: Руслан Ижбулатов <lrn1986@gmail.com>
+Date: Thu, 13 Jul 2017 01:42:13 +0000
+Subject: [PATCH] W32 - don't use gettext & gcov during gettext init
+
+Non-representable characters during UTF16->locale conversion
+will cause gcov code to return an error, for which it will try
+to use gettext, so that the error message is localized.
+
+If such call is made while gettext is being initialized
+(there's a g_once_init_enter up the stack), the thread will hang forever.
+
+To solve this, use W32 API to do the UTF16->locale conversion
+and don't use gettext when it returns an error.
+
+Also optimize g_win32_locale_filename_from_utf8() a bit,
+as we need more UTF16 and less UTF8 now.
+
+https://bugzilla.gnome.org/show_bug.cgi?id=784579
+---
+ glib/gwin32.c | 76 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----------------
+ 1 file changed, 60 insertions(+), 16 deletions(-)
+
+diff --git a/glib/gwin32.c b/glib/gwin32.c
+index 81aab00..97a4808 100644
+--- a/glib/gwin32.c
++++ b/glib/gwin32.c
+@@ -672,6 +672,49 @@ g_win32_get_windows_version (void)
+ return windows_version;
+ }
+
++/*
++ * Doesn't use gettext (and gconv), preventing recursive calls when
++ * g_win32_locale_filename_from_utf8() is called during
++ * gettext initialization.
++ */
++static gchar *
++special_wchar_to_locale_enoding (wchar_t *wstring)
++{
++ int sizeof_output;
++ int wctmb_result;
++ char *result;
++ BOOL not_representable = FALSE;
++
++ sizeof_output = WideCharToMultiByte (CP_ACP,
++ WC_NO_BEST_FIT_CHARS,
++ wstring, -1,
++ NULL, 0,
++ NULL,
++ &not_representable);
++
++ if (not_representable ||
++ sizeof_output == 0 ||
++ sizeof_output > MAX_PATH)
++ return NULL;
++
++ result = g_malloc0 (sizeof_output + 1);
++
++ wctmb_result = WideCharToMultiByte (CP_ACP,
++ WC_NO_BEST_FIT_CHARS,
++ wstring, -1,
++ result, sizeof_output + 1,
++ NULL,
++ &not_representable);
++
++ if (wctmb_result == sizeof_output &&
++ not_representable == FALSE)
++ return result;
++
++ g_free (result);
++
++ return NULL;
++}
++
+ /**
+ * g_win32_locale_filename_from_utf8:
+ * @utf8filename: a UTF-8 encoded filename.
+@@ -704,26 +747,27 @@ g_win32_get_windows_version (void)
+ gchar *
+ g_win32_locale_filename_from_utf8 (const gchar *utf8filename)
+ {
+- gchar *retval = g_locale_from_utf8 (utf8filename, -1, NULL, NULL, NULL);
++ gchar *retval;
++ wchar_t *wname;
++
++ wname = g_utf8_to_utf16 (utf8filename, -1, NULL, NULL, NULL);
++
++ if (wname == NULL)
++ return NULL;
++
++ retval = special_wchar_to_locale_enoding (wname);
+
+ if (retval == NULL)
+ {
+- /* Conversion failed, so convert to wide chars, check if there
+- * is a 8.3 version, and use that.
+- */
+- wchar_t *wname = g_utf8_to_utf16 (utf8filename, -1, NULL, NULL, NULL);
+- if (wname != NULL)
+- {
+- wchar_t wshortname[MAX_PATH + 1];
+- if (GetShortPathNameW (wname, wshortname, G_N_ELEMENTS (wshortname)))
+- {
+- gchar *tem = g_utf16_to_utf8 (wshortname, -1, NULL, NULL, NULL);
+- retval = g_locale_from_utf8 (tem, -1, NULL, NULL, NULL);
+- g_free (tem);
+- }
+- g_free (wname);
+- }
++ /* Conversion failed, so check if there is a 8.3 version, and use that. */
++ wchar_t wshortname[MAX_PATH + 1];
++
++ if (GetShortPathNameW (wname, wshortname, G_N_ELEMENTS (wshortname)))
++ retval = special_wchar_to_locale_enoding (wshortname);
+ }
++
++ g_free (wname);
++
+ return retval;
+ }
+
+--
+libgit2 0.27.1
+
diff --git a/win32/patches/gtkicontheme.c.diff b/win32/patches/gtkicontheme.c.diff
new file mode 100644
index 0000000..d23a44c
--- /dev/null
+++ b/win32/patches/gtkicontheme.c.diff
@@ -0,0 +1,28 @@
+From bac94a7aaf2409d673c971e0733f292e74a6cec7 Mon Sep 17 00:00:00 2001
+From: John Lindgren <john@jlindgren.net>
+Date: Sun, 21 Jan 2018 02:09:14 -0500
+Subject: [PATCH] Fix incorrect optimization in find_builtin_icon().
+
+When we found an icon with exactly the requested size, we'd stop
+searching immediately (good), but we'd neglect to set the returned
+min_difference to 0 (bad). This caused theme_lookup_icon() to
+prefer other, potentially much worse, matches over the exact one.
+---
+ gtk/gtkicontheme.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/gtk/gtkicontheme.c b/gtk/gtkicontheme.c
+index 532d94bee5..470158ceea 100644
+--- a/gtk/gtkicontheme.c
++++ b/gtk/gtkicontheme.c
+@@ -3396,6 +3396,7 @@ find_builtin_icon (const gchar *icon_name,
+
+ if (difference == 0)
+ {
++ min_difference = 0;
+ min_icon = default_icon;
+ break;
+ }
+--
+2.16.0
+
diff --git a/win32/patches/gtkmain.c.diff b/win32/patches/gtkmain.c.diff
new file mode 100644
index 0000000..e7f0cf9
--- /dev/null
+++ b/win32/patches/gtkmain.c.diff
@@ -0,0 +1,17 @@
+--- gtk/gtkmain.c.0 2016-01-19 14:03:55.000000000 -0500
++++ gtk/gtkmain.c 2018-05-30 22:19:18.138767100 -0400
+@@ -134,9 +134,13 @@
+ g_free (root);
+
+ /* gtk_localedir is passed to bindtextdomain() which isn't
+- * UTF-8-aware.
++ * UTF-8-aware. Try to convert the path back to the legacy
++ * 8-bit locale. If that's impossible, there's not much we
++ * can do so just return the original build-time path.
+ */
+ gtk_localedir = g_win32_locale_filename_from_utf8 (temp);
++ if (gtk_localedir == NULL)
++ gtk_localedir = g_strdup (GTK_LOCALEDIR);
+ g_free (temp);
+ }
+ return gtk_localedir;