summarylogtreecommitdiffstats
path: root/0098-distutils-add-windmc-to-cygwinccompiler.patch
diff options
context:
space:
mode:
authoratomlong2021-10-23 17:55:22 +0800
committeratomlong2021-10-23 18:06:15 +0800
commit80096c8de4b34ec1ed8f30bb428918cd592b2424 (patch)
treeb48dd1e73de9ea35a4709fb6b93deb16331ec514 /0098-distutils-add-windmc-to-cygwinccompiler.patch
parent89a67c05174951d172252b1db96ff93cc4ec4bcd (diff)
downloadaur-mingw-w64-python.tar.gz
update to 3.9.7
Diffstat (limited to '0098-distutils-add-windmc-to-cygwinccompiler.patch')
-rw-r--r--0098-distutils-add-windmc-to-cygwinccompiler.patch58
1 files changed, 58 insertions, 0 deletions
diff --git a/0098-distutils-add-windmc-to-cygwinccompiler.patch b/0098-distutils-add-windmc-to-cygwinccompiler.patch
new file mode 100644
index 000000000000..fafce741ac9c
--- /dev/null
+++ b/0098-distutils-add-windmc-to-cygwinccompiler.patch
@@ -0,0 +1,58 @@
+From 0c751ecfc03048c60a59b090cf93f64d09255c4b Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B9?=
+ <alexey.pawlow@gmail.com>
+Date: Thu, 17 Jun 2021 18:52:28 +0530
+Subject: [PATCH 098/N] distutils: add windmc to cygwinccompiler
+
+---
+ Lib/distutils/cygwinccompiler.py | 26 ++++++++++++++++++++++++--
+ 1 file changed, 24 insertions(+), 2 deletions(-)
+
+diff --git a/Lib/distutils/cygwinccompiler.py b/Lib/distutils/cygwinccompiler.py
+index 75bc17b..6a40e80 100644
+--- a/Lib/distutils/cygwinccompiler.py
++++ b/Lib/distutils/cygwinccompiler.py
+@@ -170,6 +170,28 @@ class CygwinCCompiler(UnixCCompiler):
+ self.spawn(["windres", "-i", src, "-o", obj])
+ except DistutilsExecError as msg:
+ raise CompileError(msg)
++ elif ext == '.mc':
++ # Adapted from msvc9compiler:
++ #
++ # Compile .MC to .RC file to .RES file.
++ # * '-h dir' specifies the directory for the generated include file
++ # * '-r dir' specifies the target directory of the generated RC file and the binary message resource it includes
++ #
++ # For now (since there are no options to change this),
++ # we use the source-directory for the include file and
++ # the build directory for the RC file and message
++ # resources. This works at least for win32all.
++ h_dir = os.path.dirname(src)
++ rc_dir = os.path.dirname(obj)
++ try:
++ # first compile .MC to .RC and .H file
++ self.spawn(['windmc'] + ['-h', h_dir, '-r', rc_dir] + [src])
++ base, _ = os.path.splitext(os.path.basename(src))
++ rc_file = os.path.join(rc_dir, base + '.rc')
++ # then compile .RC to .RES file
++ self.spawn(['windres', '-i', rc_file, '-o', obj])
++ except DistutilsExecError as msg:
++ raise CompileError(msg)
+ else: # for other files use the C-compiler
+ try:
+ self.spawn(self.compiler_so + cc_args + [src, '-o', obj] +
+@@ -264,9 +286,9 @@ class CygwinCCompiler(UnixCCompiler):
+ base, ext = os.path.splitext(src_name)
+ # use 'normcase' only for resource suffixes
+ ext_normcase = os.path.normcase(ext)
+- if ext_normcase in ['.rc','.res']:
++ if ext_normcase in ['.rc', '.res', '.mc']:
+ ext = ext_normcase
+- if ext not in (self.src_extensions + ['.rc','.res']):
++ if ext not in (self.src_extensions + ['.rc', '.res', '.mc']):
+ raise UnknownFileError("unknown file type '%s' (from '%s')" % \
+ (ext, src_name))
+ base = os.path.splitdrive(base)[1] # Chop off the drive
+--
+2.33.0
+