source: docker/msys/cefpython-66.0.patch@ 920:42b14124051b

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

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

File size: 8.4 KB
  • cefpython-66.0/tools/build_cpp_projects.py

    old new  
    1 # Copyright (c) 2017 CEF Python, see the Authors file.
     1# Copyright (c) 2017 CEF Python, see the Authors file
    22# All rights reserved. Licensed under BSD 3-clause license.
    33# Project website: https://github.com/cztomczak/cefpython
    44
     
    4646
    4747# Compiler args
    4848COMPILER_ARGS = [
    49     "/EHsc",
     49    #"/EHsc",
    5050]
    5151subprocess_COMPILER_ARGS = [
    52     "/MT",
     52    #"/MT",
     53    "-pthread",
    5354]
    5455
    5556# Linker args
    5657subprocess_LINKER_ARGS = [
    57     "/MANIFEST:NO",
    58     "/LARGEADDRESSAWARE",
     58    #"/MANIFEST:NO",
     59    #"/LARGEADDRESSAWARE",
     60    "-fstack-protector-all"
    5961]
    6062
    6163# Command line args
     
    110112def get_compiler(static=False):
    111113    # NOTES:
    112114    # - VS2008 and VS2010 are both using distutils/msvc9compiler.py
    113     compiler = new_compiler()
     115    compiler = new_compiler(verbose = True)
    114116    # Must initialize so that "compile_options" and others are available
    115     compiler.initialize()
     117    #compiler.initialize()
    116118    if static:
    117         compiler.compile_options.remove("/MD")
     119        #compiler.compile_options.remove("/MD")
    118120        # Overwrite function that adds /MANIFESTFILE, as for subprocess
    119121        # manifest is disabled. Otherwise warning LNK4075 is generated.
    120122        if hasattr(compiler, "manifest_setup_ldargs"):
     
    179181                                 output_progname="subprocess",
    180182                                 output_dir=BUILD_SUBPROCESS,
    181183                                 libraries=["libcef",
    182                                             "libcef_dll_wrapper_MT"],
     184                                            "cef_dll_wrapper",
     185                                            "libcef"],
    183186                                 library_dirs=[lib_dir, lib_dir_vs],
    184187                                 # TODO linker flags for Linux/Mac
    185188                                 extra_preargs=None,
    186                                  extra_postargs=subprocess_LINKER_ARGS)
     189                                 extra_postargs=subprocess_LINKER_ARGS,
     190                                 target_lang="c++")
    187191    else:
    188192        print("[build_cpp_projects.py] Executable is up-to-date: subprocess")
    189193
  • cefpython-66.0/tools/cython_setup.py

    old new  
    129129                r"C:\\Program Files\\Microsoft SDKs\\Windows\\v7.0\\Lib",
    130130                # Visual Studio 2008 installation
    131131                r"C:\\Program Files\\Microsoft SDKs\\Windows\\v6.0A\\Lib",
     132                r"C:\\msys64\\mingw32\\lib"
    132133            ]
    133134        elif ARCH64:
    134135            winsdk_libs = [
     
    180181        #
    181182        # The above warning LNK4217 is caused by the warning below which occurs
    182183        # when building the client_handler.lib static library:
    183         extra_compile_args.extend(["/EHsc", "/wd4305"])
    184         extra_link_args.extend(["/ignore:4217"])
     184        #extra_compile_args.extend(["/EHsc", "/wd4305"])
     185        #extra_link_args.extend(["/ignore:4217"])
     186        if FAST_FLAG:
     187            extra_compile_args.append("-O0")
     188        else:
     189            extra_compile_args.append("-O3")
     190
     191        extra_compile_args.extend([
     192                "-DNDEBUG",
     193                "-std=gnu++11",
     194        ])
     195        os.environ["CC"] = "g++"
     196        os.environ["CXX"] = "g++"
     197        extra_compile_args.extend(["-std=gnu++11"])
     198
     199        # Fix "ImportError ... undefined symbol ..." caused by CEF's
     200        # include/base/ headers by adding the -flto flag (Issue #230).
     201        # Unfortunately -flto prolongs compilation time significantly.
     202        # More on the other flags: https://stackoverflow.com/questions/
     203        # 6687630/ .
     204
     205        if FAST_FLAG:
     206            extra_compile_args.extend(["-flto"])
     207            extra_link_args.extend(["-flto"])
     208        else:
     209            extra_compile_args.extend(["-flto",
     210                                       "-fdata-sections",
     211                                       "-ffunction-sections"])
     212            extra_link_args.extend(["-flto",
     213                                    "-Wl,--gc-sections"])
     214        extra_link_args.extend(["-fstack-protector-all"])
    185215
    186216    if LINUX or MAC:
    187217        # Compiler flags
     
    365395    libraries = list()
    366396    if WINDOWS:
    367397        libraries.extend([
     398            "cef_dll_wrapper",
    368399            "libcef",
    369             "libcef_dll_wrapper_MD",
    370400            "User32",
    371401            "cefpython_app",
    372402            "cpp_utils",
    373403            "client_handler",
     404            "gdi32"
    374405        ])
    375406    elif MAC:
    376407        libraries.extend([
  • cefpython-66.0/src/subprocess/main.cpp

    old new  
    77#if defined(OS_WIN)
    88
    99#include <windows.h>
    10 int APIENTRY wWinMain(HINSTANCE hInstance,
    11                       HINSTANCE hPrevInstance,
    12                       LPTSTR    lpCmdLine,
    13                       int       nCmdShow)
     10int APIENTRY WinMain(HINSTANCE hInstance,
     11                     HINSTANCE hPrevInstance,
     12                     LPSTR     lpCmdLine,
     13                     int       nCmdShow)
    1414{
    1515        UNREFERENCED_PARAMETER(hPrevInstance);
    1616        UNREFERENCED_PARAMETER(lpCmdLine);
  • cefpython-66.0/tools/make_installer.py

    old new  
    102102    create_empty_log_file(os.path.join(PKG_DIR, "debug.log"))
    103103    create_empty_log_file(os.path.join(PKG_DIR, "examples/debug.log"))
    104104
    105     copy_cpp_extension_dependencies_issue359(PKG_DIR)
     105    #copy_cpp_extension_dependencies_issue359(PKG_DIR)
    106106
    107107    print("[make_installer.py] Done. Installer package created: {setup_dir}"
    108108          .format(setup_dir=SETUP_DIR))
  • cefpython-66.0/tools/build.py

    old new  
    7979# Command line args variables
    8080SYS_ARGV_ORIGINAL = None
    8181VERSION = ""
     82NO_RUN_TESTS = False
    8283NO_RUN_EXAMPLES = False
    8384DEBUG_FLAG = False
    8485FAST_FLAG = False
     
    125126
    126127def command_line_args():
    127128    global DEBUG_FLAG, FAST_FLAG, CLEAN_FLAG, KIVY_FLAG, HELLO_WORLD_FLAG, \
    128            REBUILD_CPP, VERSION, NO_RUN_EXAMPLES
     129           REBUILD_CPP, VERSION, NO_RUN_TESTS, NO_RUN_EXAMPLES
    129130
    130131    VERSION = get_version_from_command_line_args(__file__)
    131132    # Other scripts called by this script expect that version number
     
    140141    global SYS_ARGV_ORIGINAL
    141142    SYS_ARGV_ORIGINAL = copy.copy(sys.argv)
    142143
     144    if "--no-run-tests" in sys.argv:
     145        NO_RUN_TESTS = True
     146        print("[build.py] Running tests disabled (--no-run-tests)")
     147        sys.argv.remove("--no-run-tests")
     148
    143149    if "--no-run-examples" in sys.argv:
    144150        NO_RUN_EXAMPLES = True
    145151        print("[build.py] Running examples disabled (--no-run-examples)")
     
    820826        sys.exit(1)
    821827
    822828    # Move the cefpython module
    823     module_pattern = MODULE_NAME_TEMPLATE.format(pyversion=PYVERSION+"*",
    824                                                  ext=MODULE_EXT)
     829    module_pattern = "cefpython_py{pyversion}-cpython-{pyversion}m.dll".\
     830                     format(pyversion=PYVERSION+"*", ext=MODULE_EXT)
    825831    module_pattern = "./build/lib*/" + module_pattern
    826832    move_file_by_pattern(module_pattern, os.path.join(CEFPYTHON_BINARY,
    827833                                                      MODULE_NAME))
     
    902908    delete_directory_reliably(setup_installer_dir)
    903909
    904910    # Run unittests
    905     print("[build.py] Run unittests")
    906     test_runner = os.path.join(UNITTESTS_DIR, "_test_runner.py")
    907     command = ("\"{python}\" {test_runner}"
    908                .format(python=sys.executable,
    909                        test_runner=test_runner))
    910     ret = os.system(command)
    911     if ret != 0:
    912         print("[build.py] ERROR while running unit tests")
    913         sys.exit(1)
     911    if not NO_RUN_TESTS:
     912        print("[build.py] Run unittests")
     913        test_runner = os.path.join(UNITTESTS_DIR, "_test_runner.py")
     914        command = ("\"{python}\" {test_runner}"
     915                   .format(python=sys.executable,
     916                           test_runner=test_runner))
     917        ret = os.system(command)
     918        if ret != 0:
     919            print("[build.py] ERROR while running unit tests")
     920            sys.exit(1)
    914921
    915922    # Run examples
    916923    if not NO_RUN_EXAMPLES:
Note: See TracBrowser for help on using the repository browser.