Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
- update to 228
- fix MAPI compilation problems
- simplfy the patch file for dependencies
- drop the patch file for min/max
  • Loading branch information
joankaradimov committed Jun 20, 2020
1 parent 681c855 commit 70cb109
Show file tree
Hide file tree
Showing 7 changed files with 181 additions and 375 deletions.
65 changes: 58 additions & 7 deletions mingw-w64-python-pywin32/001-compile-and-setup-fixes.patch
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
diff -aur 000/setup.py 001/setup.py
--- 000/setup.py 2015-04-09 21:00:48.725278100 -0300
+++ 001/setup.py 2015-04-09 21:02:02.350399800 -0300
@@ -245,16 +245,7 @@
@@ -264,16 +264,7 @@
MSVCCompiler.link = monkeypatched_link


Expand All @@ -19,7 +19,7 @@ diff -aur 000/setup.py 001/setup.py

class WinExt (Extension):
# Base class for all win32 extensions, with some predefined
@@ -291,11 +282,13 @@
@@ -305,11 +296,19 @@

extra_link_args = extra_link_args or []
if export_symbol_file:
Expand All @@ -31,6 +31,12 @@ diff -aur 000/setup.py 001/setup.py
define_macros = define_macros or []
+ define_macros.append(("NTDDI_VERSION", 0x06000000))
+ define_macros.append(("_WIN32_WINNT", 0x0600))
+ define_macros.append(("USE_COM_CONTEXT_DEF", None))
+ define_macros.append(("NO_PYCOM_IDISPATCHEX", None))
+ define_macros.append(("__in", ""))
+ define_macros.append(("__in_opt", ""))
+ define_macros.append(("__out", ""))
+ define_macros.append(("__deref_out_ecount_full(x)", ""))
define_macros.append(("DISTUTILS_BUILD", None))
define_macros.append(("_CRT_SECURE_NO_WARNINGS", None))
self.pch_header = pch_header
Expand Down Expand Up @@ -164,7 +170,7 @@ diff -aur 000/win32/src/PySecurityObjects.h 001/win32/src/PySecurityObjects.h
diff -aur 000/win32/src/PyWinObjects.h 001/win32/src/PyWinObjects.h
--- 000/win32/src/PyWinObjects.h 2015-04-09 21:00:48.881528000 -0300
+++ 001/win32/src/PyWinObjects.h 2015-04-09 21:01:55.881645000 -0300
@@ -50,7 +50,7 @@
@@ -49,7 +49,7 @@
PyObject *str();
PyObject *repr();
int compare(PyObject *ob);
Expand Down Expand Up @@ -251,7 +257,7 @@ diff -aur 000/win32/src/PyWinTypesmodule.cpp 001/win32/src/PyWinTypesmodule.cpp
diff -aur 000/win32/src/win32evtlog.i 001/win32/src/win32evtlog.i
--- 000/win32/src/win32evtlog.i 2015-04-09 21:00:49.256528100 -0300
+++ 001/win32/src/win32evtlog.i 2015-04-09 21:02:02.397275800 -0300
@@ -997,6 +997,14 @@
@@ -1206,6 +1206,14 @@
}
PyCFunction pfnPyEvtUpdateBookmark = (PyCFunction) PyEvtUpdateBookmark;

Expand All @@ -263,9 +269,9 @@ diff -aur 000/win32/src/win32evtlog.i 001/win32/src/win32evtlog.i
+#define EVT_VARIANT_TYPE_MASK 0x7F
+#endif
+
PyObject *PyWinObject_FromEVT_VARIANT(PEVT_VARIANT val)
PyObject *PyList_FromEVT_VARIANTArray(PEVT_VARIANT val)
{
if (val->Type & EVT_VARIANT_TYPE_ARRAY){
if ((val->Type & EVT_VARIANT_TYPE_ARRAY) == 0) {
diff -aur 000/win32/src/win32file_comm.cpp 001/win32/src/win32file_comm.cpp
--- 000/win32/src/win32file_comm.cpp 2015-04-09 21:00:49.490903600 -0300
+++ 001/win32/src/win32file_comm.cpp 2015-04-09 21:02:02.412900800 -0300
Expand Down Expand Up @@ -334,7 +340,7 @@ diff -aur 000/win32/src/win32inet.i 001/win32/src/win32inet.i
diff -aur 000/win32/src/win32pdhmodule.cpp 001/win32/src/win32pdhmodule.cpp
--- 000/win32/src/win32pdhmodule.cpp 2015-04-09 21:00:49.662779100 -0300
+++ 001/win32/src/win32pdhmodule.cpp 2015-04-09 21:02:02.444150800 -0300
@@ -1004,7 +1004,7 @@
@@ -1005,7 +1005,7 @@
{ \
if (i < seqLen) { \
PyObject *subItem = PyTuple_GET_ITEM(flags_tuple, i); \
Expand All @@ -360,3 +366,48 @@ diff -aur 000/win32/src/win32service.i 001/win32/src/win32service.i
%}

%{
--- 000/com/win32comext/mapi/src/mapi_headers/mapidefs.h 2020-06-13 08:39:03.000000000 +0300
+++ 001/com/win32comext/mapi/src/mapi_headers/mapidefs.h 2020-06-19 16:10:51.180079900 +0300
@@ -2728,5 +2728,4 @@
#endif

#endif /* MAPIDEFS_H */
-

--- 000/com/win32comext/mapi/src/mapi_headers/MAPICode.h 2020-06-13 08:39:03.000000000 +0300
+++ 001/com/win32comext/mapi/src/mapi_headers/MAPICode.h 2020-06-19 16:11:57.872096400 +0300
@@ -216,5 +216,4 @@
#endif

#endif /* MAPICODE_H */
-

--- 000/com/win32comext/mapi/src/mapi_headers/MSPST.h 2020-06-13 08:39:03.000000000 +0300
+++ 001/com/win32comext/mapi/src/mapi_headers/MSPST.h 2020-06-19 16:12:52.572096500 +0300
@@ -97,5 +97,4 @@
0xd9, 0x6e, 0x00, 0x00 }

#endif /* _MSPST_H_ */
-

--- 000/com/win32comext/mapi/src/mapi_headers/MAPIForm.h~ 2020-06-13 08:39:03.000000000 +0300
+++ 001/com/win32comext/mapi/src/mapi_headers/MAPIForm.h 2020-06-20 13:20:38.548390500 +0300
@@ -631,5 +631,4 @@

#endif /* MAPIFORM_H */

-

--- 000/com/win32comext/mapi/src/PyIMAPIAdviseSink.cpp 2020-06-13 08:39:03.000000000 +0300
+++ 001/com/win32comext/mapi/src/PyIMAPIAdviseSink.cpp 2020-06-20 13:17:46.660390600 +0300
@@ -6,6 +6,10 @@
#include "PyMAPIUtil.h"
#include "PyIMAPIAdviseSink.h"

+#ifdef __MINGW32__
+#define __FUNCSIG__ __PRETTY_FUNCTION__
+#endif
+
// @doc - This file contains autoduck documentation
// ---------------------------------------------------
//
74 changes: 74 additions & 0 deletions mingw-w64-python-pywin32/002-dependency-fixes.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
diff -aur 000/setup.py 001/setup.py
--- 000/setup.py 2015-04-09 21:00:48.725278100 -0300
+++ 001/setup.py 2015-04-09 21:02:02.350399800 -0300
@@ -100,7 +100,7 @@

# some modules need a static CRT to avoid problems caused by them having a
# manifest.
-static_crt_modules = ["winxpgui"]
+static_crt_modules = []


from distutils.dep_util import newer_group
@@ -476,6 +476,7 @@

class WinExt_win32(WinExt):
def __init__ (self, name, **kw):
+ kw["libraries"] = kw.get("libraries", "") + " oleaut32 ole32 pywintypes"
WinExt.__init__(self, name, **kw)
def get_pywin32_dir(self):
return "win32"
@@ -499,7 +500,7 @@
# itself - thus, output is "win32comext"
class WinExt_win32com(WinExt):
def __init__ (self, name, **kw):
- kw["libraries"] = kw.get("libraries", "") + " oleaut32 ole32"
+ kw["libraries"] = kw.get("libraries", "") + " oleaut32 ole32 uuid pywintypes pythoncom"

# COM extensions require later windows headers.
if not kw.get("windows_h_version"):
@@ -1500,6 +1504,10 @@
"win32/src/PySecurityObjects.h",
],
extra_compile_args = ['-DBUILD_PYWINTYPES'],
+ extra_link_args = ['-Wl,--out-implib,build/temp.mingw-%d.%d/libpywintypes.dll.a' % (
+ sys.version_info.major,
+ sys.version_info.minor,
+ )],
libraries = "advapi32 user32 ole32 oleaut32",
pch_header = "PyWinTypes.h",
)
@@ -1764,9 +1762,13 @@
%(win32com)s/include\\PyIEnumContextProps.h %(win32com)s/include\\PyIClientSecurity.h
%(win32com)s/include\\PyIServerSecurity.h
""" % dirs).split(),
- libraries = "oleaut32 ole32 user32 urlmon",
- export_symbol_file = 'com/win32com/src/PythonCOM.def',
+ libraries = "oleaut32 ole32 user32 urlmon uuid pywintypes",
+ # export_symbol_file = 'com/win32com/src/PythonCOM.def',
extra_compile_args = ['-DBUILD_PYTHONCOM'],
+ extra_link_args = ['-Wl,--out-implib,build/temp.mingw-%d.%d/libpythoncom.dll.a' % (
+ sys.version_info.major,
+ sys.version_info.minor,
+ )],
pch_header = "stdafx.h",
windows_h_version = 0x500,
base_address = dll_base_address,
@@ -1917,7 +1917,7 @@
%(internet)s/PyIInternetProtocolSink.cpp %(internet)s/PyIInternetSecurityManager.cpp
""" % dirs).split(),
depends=["%(internet)s/internet_pch.h" % dirs]),
- WinExt_win32com('mapi', libraries="advapi32", pch_header="PythonCOM.h",
+ WinExt_win32com('mapi', libraries="advapi32 mapi", pch_header="PythonCOM.h",
include_dirs=["%(mapi)s/mapi_headers" % dirs],
sources=("""
%(mapi)s/mapi.i %(mapi)s/mapi.cpp
@@ -2273,7 +2273,7 @@
sources=[os.path.join("win32", "src", s) for s in
"PythonService.cpp PythonService.rc".split()],
unicode_mode = True,
- libraries = "user32 advapi32 ole32 shell32"),
+ libraries = "user32 advapi32 ole32 shell32 pywintypes"),
WinExt_pythonwin_subsys_win("Pythonwin",
sources = [
"Pythonwin/pythonwin.cpp",
193 changes: 0 additions & 193 deletions mingw-w64-python-pywin32/002-min-max.patch

This file was deleted.

Loading

0 comments on commit 70cb109

Please sign in to comment.