--- meld-3.20.2/meld/build_helpers.py.orig	2020-02-15 23:32:20.000000000 +0100
+++ meld-3.20.2/meld/build_helpers.py	2020-02-16 09:29:41.241211600 +0100
@@ -29,6 +29,8 @@
 import os.path
 import platform
 import sys
+import shutil
+from distutils.util import get_platform
 from distutils.log import info
 
 try:
@@ -46,7 +46,7 @@
 
 
 def has_help(self):
-    return "build_help" in self.distribution.cmdclass and not windows_build
+    return "build_help" in self.distribution.cmdclass and (not windows_build or get_platform().startswith('mingw'))
 
 
 def has_icons(self):
@@ -54,7 +54,7 @@
 
 
 def has_i18n(self):
-    return "build_i18n" in self.distribution.cmdclass and not windows_build
+    return "build_i18n" in self.distribution.cmdclass and (not windows_build or get_platform().startswith('mingw'))
 
 
 def has_data(self):
@@ -122,7 +124,7 @@
 
         data_files.append(('share/meld', [target]))
 
-        if windows_build:
+        if windows_build and not get_platform().startswith('mingw'):
             gschemas = self.frozen_gschemas
         else:
             gschemas = self.gschemas
@@ -196,14 +196,19 @@
                 self.spawn(msgfmt)
                 for page in self.C_PAGES:
                     itstool = [
-                        'itstool', '-m', mo_file, '-o', build_path, page]
+                        'sh', '-c',
+                        "itstool -m %s -o %s %s" % (mo_file, build_path, page)]
                     self.spawn(itstool)
                 for extra in self.C_EXTRA:
                     extra_path = os.path.join(
                         build_path, os.path.basename(extra))
                     if os.path.exists(extra_path):
                         os.unlink(extra_path)
-                    os.symlink(os.path.relpath(extra, source_path), extra_path)
+                    # symlinks require special privileges on Windows :-(
+                    if os.name == 'nt':
+                        shutil.copy(extra, extra_path)
+                    else:
+                        os.symlink(os.path.relpath(extra, source_path), extra_path)
             else:
                 distutils.dir_util.copy_tree(source_path, build_path)
 
@@ -314,17 +314,14 @@
 
         # If we're on Windows, assume we're building frozen and make a bunch
         # of insane assumptions.
-        if windows_build:
+        if windows_build and not get_platform().startswith('mingw'):
             msgfmt = "C:\\Python27\\Tools\\i18n\\msgfmt"
         else:
             msgfmt = "msgfmt"
 
         # Update po(t) files and print a report
         # We have to change the working dir to the po dir for intltool
-        cmd = [
-            "intltool-update",
-            (self.merge_po and "-r" or "-p"), "-g", self.domain
-        ]
+        cmd = ["sh", "-c", "intltool-update %s -g %s" % ((self.merge_po and "-r" or "-p"), self.domain)]
         wd = os.getcwd()
         os.chdir(self.po_dir)
         self.spawn(cmd)
@@ -335,7 +335,7 @@
             mo_file = os.path.join(mo_dir, "%s.mo" % self.domain)
             if not os.path.exists(mo_dir):
                 os.makedirs(mo_dir)
-            cmd = [msgfmt, po_file, "-o", mo_file]
+            cmd = ["sh", "-c", "%s %s -o %s" % (msgfmt, po_file, mo_file)]
             po_mtime = os.path.getmtime(po_file)
             mo_mtime = (
                 os.path.exists(mo_file) and os.path.getmtime(mo_file) or 0)
@@ -385,8 +385,8 @@
                     if file_merged.endswith(".in"):
                         file_merged = file_merged[:-3]
                     file_merged = os.path.join(build_target, file_merged)
-                    cmd = ["intltool-merge", switch, self.po_dir, file,
-                           file_merged]
+                    cmd = ["sh", "-c", "intltool-merge %s %s %s %s" % (switch, self.po_dir, file,
+                           file_merged)]
                     mtime_merged = (os.path.exists(file_merged) and
                                     os.path.getmtime(file_merged) or 0)
                     mtime_file = os.path.getmtime(file)
@@ -431,7 +431,7 @@
                 elif line.startswith('# END'):
                     end = i
 
-            if start and end:
+            if start and end and not get_platform().startswith('mingw'):
                 lines[start:end + 1] = [
                     self.data_line % datadir,
                     self.locale_line % localedir,
