xpra icon
Bug tracker and wiki

This bug tracker and wiki are being discontinued
please use https://github.com/Xpra-org/xpra instead.


Ticket #94: xpra-x264-setup-Cython-win32.patch

File xpra-x264-setup-Cython-win32.patch, 4.0 KB (added by Antoine Martin, 9 years ago)

to try to tell py2exe to invoke Cython on the x264 bindings

  • setup.py

     
    3939            kw[k] = list(set(v))
    4040    return kw
    4141
    42 from xpra.platform import XPRA_LOCAL_SERVERS_SUPPORTED
    43 if XPRA_LOCAL_SERVERS_SUPPORTED:
    44     from Cython.Distutils import build_ext
     42def cython_version_check():
    4543    from Cython.Compiler.Version import version as cython_version_string
    4644    cython_version = [int(part) for part in cython_version_string.split(".")]
    4745    # This was when the 'for 0 < i < 10:' syntax as added, bump upwards as
     
    5452                 % (cython_version_string,
    5553                    ".".join([str(part) for part in NEEDED_CYTHON])))
    5654
    57     ext_modules = [
    58       Extension("wimpiggy.lowlevel.bindings",
     55ext_modules = []
     56cmdclass = {}
     57from xpra.platform import XPRA_LOCAL_SERVERS_SUPPORTED
     58if XPRA_LOCAL_SERVERS_SUPPORTED:
     59    cython_version_check()
     60    from Cython.Distutils import build_ext
     61    ext_modules += [
     62        Extension("wimpiggy.lowlevel.bindings",
    5963                ["wimpiggy/lowlevel/bindings.pyx"],
    6064                **pkgconfig("pygobject-2.0", "gdk-x11-2.0", "gtk+-x11-2.0",
    6165                            "xtst", "xfixes", "xcomposite", "xdamage", "xrandr")
    6266                ),
    63       Extension("xpra.wait_for_x_server",
     67        Extension("xpra.wait_for_x_server",
    6468                ["xpra/wait_for_x_server.pyx"],
    6569                **pkgconfig("x11")
    6670                ),
    67       Extension("xpra.x264.encoder",
     71        ]
     72    cmdclass = {'build_ext': build_ext}
     73x264_ENABLED = True
     74if x264_ENABLED:
     75    from Cython.Distutils import build_ext
     76    if sys.platform.startswith("win"):
     77        def pkgconfig(*args):
     78            return {}
     79    ext_modules += [
     80        Extension("xpra.x264.encoder",
    6881                ["xpra/x264/encoder.pyx", "xpra/x264/x264lib.c"],
    6982                **pkgconfig("x264", "libswscale", "libavcodec")
    7083                ),
    71       Extension("xpra.x264.decoder",
     84        Extension("xpra.x264.decoder",
    7285                ["xpra/x264/decoder.pyx", "xpra/x264/x264lib.c"],
    7386                **pkgconfig("x264", "libswscale", "libavcodec")
    7487                ),
    75       ]
    76 
     88        ]
    7789    cmdclass = {'build_ext': build_ext}
    78 else:
    79     ext_modules = []
    80     cmdclass = {}
    8190
    8291import wimpiggy
    8392import parti
     
    110119
    111120extra_options = {}
    112121if sys.platform.startswith("win"):
    113     # These files cannot be re-distributed legally :(
     122    # The Microsoft C library DLLs:
     123    # Unfortunately, these files cannot be re-distributed legally :(
    114124    # So here is the md5sum so you can find the right version:
    115125    # 6fda4c0ef8715eead5b8cec66512d3c8  Microsoft.VC90.CRT/Microsoft.VC90.CRT.manifest
    116126    # 4a8bc195abdc93f0db5dab7f5093c52f  Microsoft.VC90.CRT/msvcm90.dll
     
    124134    # 371226b8346f29011137c7aa9e93f2f6  Microsoft.VC90.MFC/mfcm90u.dll
    125135    #
    126136    # This is where I keep them, you will obviously need to change this value:
    127     DLLs="Z:\\"
     137    C_DLLs="Z:\\"
     138    # The x264 DLLs which you can grab from here:
     139    # http://ffmpeg.zeranoe.com/builds/
     140    # This is where I keep them, you will obviously need to change this value:
     141    x264_DLLs="Z:\ffmpeg-win32-shared"
     142   
    128143    import py2exe    #@UnresolvedImport
    129144    assert py2exe is not None
    130145    windows = [
     
    153168                   ('', ['COPYING']),
    154169                   ('', ['README.xpra']),
    155170                   ('', ['website.url']),
     171                   ('', ['xpra/x264/win32/x264lib.dll']),
    156172                   ('icons', glob.glob('icons\\*.*')),
    157                    ('Microsoft.VC90.CRT', glob.glob('%s\\Microsoft.VC90.CRT\\*.*' % DLLs)),
    158                    ('Microsoft.VC90.MFC', glob.glob('%s\\Microsoft.VC90.MFC\\*.*' % DLLs)),
     173                   ('Microsoft.VC90.CRT', glob.glob('%s\\Microsoft.VC90.CRT\\*.*' % C_DLLs)),
     174                   ('Microsoft.VC90.MFC', glob.glob('%s\\Microsoft.VC90.MFC\\*.*' % C_DLLs)),
     175                   ('', glob.glob('%s\\bin\\*.dll' % x264_DLLs)),
    159176               ]
    160177    extra_options = dict(
    161178        windows = windows,