source: docker/msys/cefpython-66.0.patch@ 936:2d2c88cfc74a

python3
Last change on this file since 936:2d2c88cfc74a was 936:2d2c88cfc74a, checked in by István Váradi <ivaradi@…>, 5 years ago

Programs are produced for the Windows subsysteam (re #347)

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