source: docker/msys/cefpython-66.0.patch@ 924:05c2338a2dc4

python3
Last change on this file since 924:05c2338a2dc4 was 920:42b14124051b, checked in by István Váradi <ivaradi@…>, 6 years ago

Win 10 Docker image for building the new Python3-based distribution

File size: 8.4 KB
RevLine 
[920]1--- cefpython-66.0/tools/build_cpp_projects.py.orig 2019-04-02 16:58:20.961263518 +0200
2+++ cefpython-66.0/tools/build_cpp_projects.py 2019-03-09 16:32:28.031876000 +0100
3@@ -1,4 +1,4 @@
4-# Copyright (c) 2017 CEF Python, see the Authors file.
5+# Copyright (c) 2017 CEF Python, see the Authors file
6 # All rights reserved. Licensed under BSD 3-clause license.
7 # Project website: https://github.com/cztomczak/cefpython
8
9@@ -46,16 +46,18 @@
10
11 # Compiler args
12 COMPILER_ARGS = [
13- "/EHsc",
14+ #"/EHsc",
15 ]
16 subprocess_COMPILER_ARGS = [
17- "/MT",
18+ #"/MT",
19+ "-pthread",
20 ]
21
22 # Linker args
23 subprocess_LINKER_ARGS = [
24- "/MANIFEST:NO",
25- "/LARGEADDRESSAWARE",
26+ #"/MANIFEST:NO",
27+ #"/LARGEADDRESSAWARE",
28+ "-fstack-protector-all"
29 ]
30
31 # Command line args
32@@ -110,11 +112,11 @@
33 def get_compiler(static=False):
34 # NOTES:
35 # - VS2008 and VS2010 are both using distutils/msvc9compiler.py
36- compiler = new_compiler()
37+ compiler = new_compiler(verbose = True)
38 # Must initialize so that "compile_options" and others are available
39- compiler.initialize()
40+ #compiler.initialize()
41 if static:
42- compiler.compile_options.remove("/MD")
43+ #compiler.compile_options.remove("/MD")
44 # Overwrite function that adds /MANIFESTFILE, as for subprocess
45 # manifest is disabled. Otherwise warning LNK4075 is generated.
46 if hasattr(compiler, "manifest_setup_ldargs"):
47@@ -179,11 +181,13 @@
48 output_progname="subprocess",
49 output_dir=BUILD_SUBPROCESS,
50 libraries=["libcef",
51- "libcef_dll_wrapper_MT"],
52+ "cef_dll_wrapper",
53+ "libcef"],
54 library_dirs=[lib_dir, lib_dir_vs],
55 # TODO linker flags for Linux/Mac
56 extra_preargs=None,
57- extra_postargs=subprocess_LINKER_ARGS)
58+ extra_postargs=subprocess_LINKER_ARGS,
59+ target_lang="c++")
60 else:
61 print("[build_cpp_projects.py] Executable is up-to-date: subprocess")
62
63--- cefpython-66.0/tools/cython_setup.py.orig 2019-04-02 16:58:31.753618071 +0200
64+++ cefpython-66.0/tools/cython_setup.py 2019-03-09 16:53:19.516724000 +0100
65@@ -129,6 +129,7 @@
66 r"C:\\Program Files\\Microsoft SDKs\\Windows\\v7.0\\Lib",
67 # Visual Studio 2008 installation
68 r"C:\\Program Files\\Microsoft SDKs\\Windows\\v6.0A\\Lib",
69+ r"C:\\msys64\\mingw32\\lib"
70 ]
71 elif ARCH64:
72 winsdk_libs = [
73@@ -180,8 +181,37 @@
74 #
75 # The above warning LNK4217 is caused by the warning below which occurs
76 # when building the client_handler.lib static library:
77- extra_compile_args.extend(["/EHsc", "/wd4305"])
78- extra_link_args.extend(["/ignore:4217"])
79+ #extra_compile_args.extend(["/EHsc", "/wd4305"])
80+ #extra_link_args.extend(["/ignore:4217"])
81+ if FAST_FLAG:
82+ extra_compile_args.append("-O0")
83+ else:
84+ extra_compile_args.append("-O3")
85+
86+ extra_compile_args.extend([
87+ "-DNDEBUG",
88+ "-std=gnu++11",
89+ ])
90+ os.environ["CC"] = "g++"
91+ os.environ["CXX"] = "g++"
92+ extra_compile_args.extend(["-std=gnu++11"])
93+
94+ # Fix "ImportError ... undefined symbol ..." caused by CEF's
95+ # include/base/ headers by adding the -flto flag (Issue #230).
96+ # Unfortunately -flto prolongs compilation time significantly.
97+ # More on the other flags: https://stackoverflow.com/questions/
98+ # 6687630/ .
99+
100+ if FAST_FLAG:
101+ extra_compile_args.extend(["-flto"])
102+ extra_link_args.extend(["-flto"])
103+ else:
104+ extra_compile_args.extend(["-flto",
105+ "-fdata-sections",
106+ "-ffunction-sections"])
107+ extra_link_args.extend(["-flto",
108+ "-Wl,--gc-sections"])
109+ extra_link_args.extend(["-fstack-protector-all"])
110
111 if LINUX or MAC:
112 # Compiler flags
113@@ -365,12 +395,13 @@
114 libraries = list()
115 if WINDOWS:
116 libraries.extend([
117+ "cef_dll_wrapper",
118 "libcef",
119- "libcef_dll_wrapper_MD",
120 "User32",
121 "cefpython_app",
122 "cpp_utils",
123 "client_handler",
124+ "gdi32"
125 ])
126 elif MAC:
127 libraries.extend([
128--- cefpython-66.0/src/subprocess/main.cpp.orig 2019-04-02 20:36:34.016395754 +0200
129+++ cefpython-66.0/src/subprocess/main.cpp 2019-04-02 20:39:33.491183098 +0200
130@@ -7,10 +7,10 @@
131 #if defined(OS_WIN)
132
133 #include <windows.h>
134-int APIENTRY wWinMain(HINSTANCE hInstance,
135- HINSTANCE hPrevInstance,
136- LPTSTR lpCmdLine,
137- int nCmdShow)
138+int APIENTRY WinMain(HINSTANCE hInstance,
139+ HINSTANCE hPrevInstance,
140+ LPSTR lpCmdLine,
141+ int nCmdShow)
142 {
143 UNREFERENCED_PARAMETER(hPrevInstance);
144 UNREFERENCED_PARAMETER(lpCmdLine);
145--- cefpython-66.0/tools/make_installer.py.orig 2018-08-20 19:51:17.000000000 +0200
146+++ cefpython-66.0/tools/make_installer.py 2019-04-02 20:59:22.372933492 +0200
147@@ -102,7 +102,7 @@
148 create_empty_log_file(os.path.join(PKG_DIR, "debug.log"))
149 create_empty_log_file(os.path.join(PKG_DIR, "examples/debug.log"))
150
151- copy_cpp_extension_dependencies_issue359(PKG_DIR)
152+ #copy_cpp_extension_dependencies_issue359(PKG_DIR)
153
154 print("[make_installer.py] Done. Installer package created: {setup_dir}"
155 .format(setup_dir=SETUP_DIR))
156--- cefpython-66.0/tools/build.py.orig 2019-04-02 16:58:17.137138263 +0200
157+++ cefpython-66.0/tools/build.py 2019-04-12 21:32:28.414197037 +0200
158@@ -79,6 +79,7 @@
159 # Command line args variables
160 SYS_ARGV_ORIGINAL = None
161 VERSION = ""
162+NO_RUN_TESTS = False
163 NO_RUN_EXAMPLES = False
164 DEBUG_FLAG = False
165 FAST_FLAG = False
166@@ -125,7 +126,7 @@
167
168 def command_line_args():
169 global DEBUG_FLAG, FAST_FLAG, CLEAN_FLAG, KIVY_FLAG, HELLO_WORLD_FLAG, \
170- REBUILD_CPP, VERSION, NO_RUN_EXAMPLES
171+ REBUILD_CPP, VERSION, NO_RUN_TESTS, NO_RUN_EXAMPLES
172
173 VERSION = get_version_from_command_line_args(__file__)
174 # Other scripts called by this script expect that version number
175@@ -140,6 +141,11 @@
176 global SYS_ARGV_ORIGINAL
177 SYS_ARGV_ORIGINAL = copy.copy(sys.argv)
178
179+ if "--no-run-tests" in sys.argv:
180+ NO_RUN_TESTS = True
181+ print("[build.py] Running tests disabled (--no-run-tests)")
182+ sys.argv.remove("--no-run-tests")
183+
184 if "--no-run-examples" in sys.argv:
185 NO_RUN_EXAMPLES = True
186 print("[build.py] Running examples disabled (--no-run-examples)")
187@@ -820,8 +826,8 @@
188 sys.exit(1)
189
190 # Move the cefpython module
191- module_pattern = MODULE_NAME_TEMPLATE.format(pyversion=PYVERSION+"*",
192- ext=MODULE_EXT)
193+ module_pattern = "cefpython_py{pyversion}-cpython-{pyversion}m.dll".\
194+ format(pyversion=PYVERSION+"*", ext=MODULE_EXT)
195 module_pattern = "./build/lib*/" + module_pattern
196 move_file_by_pattern(module_pattern, os.path.join(CEFPYTHON_BINARY,
197 MODULE_NAME))
198@@ -902,15 +908,16 @@
199 delete_directory_reliably(setup_installer_dir)
200
201 # Run unittests
202- print("[build.py] Run unittests")
203- test_runner = os.path.join(UNITTESTS_DIR, "_test_runner.py")
204- command = ("\"{python}\" {test_runner}"
205- .format(python=sys.executable,
206- test_runner=test_runner))
207- ret = os.system(command)
208- if ret != 0:
209- print("[build.py] ERROR while running unit tests")
210- sys.exit(1)
211+ if not NO_RUN_TESTS:
212+ print("[build.py] Run unittests")
213+ test_runner = os.path.join(UNITTESTS_DIR, "_test_runner.py")
214+ command = ("\"{python}\" {test_runner}"
215+ .format(python=sys.executable,
216+ test_runner=test_runner))
217+ ret = os.system(command)
218+ if ret != 0:
219+ print("[build.py] ERROR while running unit tests")
220+ sys.exit(1)
221
222 # Run examples
223 if not NO_RUN_EXAMPLES:
Note: See TracBrowser for help on using the repository browser.