Skip to content

Commit

Permalink
minimal builds now have no cython compilation
Browse files Browse the repository at this point in the history
git-svn-id: https://xpra.org/svn/Xpra/trunk@21532 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Feb 4, 2019
1 parent 0f9878b commit cccc1c1
Showing 1 changed file with 39 additions and 29 deletions.
68 changes: 39 additions & 29 deletions src/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ def is_RH():
proxy_ENABLED = DEFAULT
client_ENABLED = DEFAULT
scripts_ENABLED = not WIN32
cython_ENABLED = DEFAULT

x11_ENABLED = DEFAULT and not WIN32 and not OSX
xinput_ENABLED = x11_ENABLED
Expand Down Expand Up @@ -221,26 +222,29 @@ def is_RH():
rebuild_ENABLED = True

#allow some of these flags to be modified on the command line:
SWITCHES = ["enc_x264", "enc_x265", "enc_ffmpeg",
"nvenc", "cuda_kernels", "cuda_rebuild", "nvfbc",
"vpx", "webp", "pillow", "jpeg_encoder", "jpeg_decoder",
"v4l2",
"dec_avcodec2", "csc_swscale",
"csc_libyuv",
"bencode", "cython_bencode", "vsock", "netdev", "mdns",
"clipboard",
"scripts",
"server", "client", "dbus", "x11", "xinput", "uinput", "sd_listen",
"gtk_x11", "service",
"gtk2", "gtk3", "example",
"html5", "minify", "html5_gzip", "html5_brotli",
"pam", "xdg_open",
"sound", "opengl", "printing", "webcam", "notifications", "keyboard",
"rebuild",
"annotate", "warn", "strict",
"shadow", "proxy", "rfb",
"debug", "PIC",
"Xdummy", "Xdummy_wrapper", "verbose", "tests", "bundle_tests"]
SWITCHES = [
"cython",
"enc_x264", "enc_x265", "enc_ffmpeg",
"nvenc", "cuda_kernels", "cuda_rebuild", "nvfbc",
"vpx", "webp", "pillow", "jpeg_encoder", "jpeg_decoder",
"v4l2",
"dec_avcodec2", "csc_swscale",
"csc_libyuv",
"bencode", "cython_bencode", "vsock", "netdev", "mdns",
"clipboard",
"scripts",
"server", "client", "dbus", "x11", "xinput", "uinput", "sd_listen",
"gtk_x11", "service",
"gtk2", "gtk3", "example",
"html5", "minify", "html5_gzip", "html5_brotli",
"pam", "xdg_open",
"sound", "opengl", "printing", "webcam", "notifications", "keyboard",
"rebuild",
"annotate", "warn", "strict",
"shadow", "proxy", "rfb",
"debug", "PIC",
"Xdummy", "Xdummy_wrapper", "verbose", "tests", "bundle_tests",
]
if WIN32:
SWITCHES.append("zip")
zip_ENABLED = True
Expand Down Expand Up @@ -311,6 +315,9 @@ def is_RH():
v = switches_info[k]
print("* %s : %s" % (str(k).ljust(20), {None : "Auto", True : "Y", False : "N"}.get(v, v)))

if (enc_ffmpeg_ENABLED or enc_x264_ENABLED or enc_x265_ENABLED or
nvenc_ENABLED or OSX or x11_ENABLED):
assert cython_ENABLED
#sanity check the flags:
if clipboard_ENABLED and not server_ENABLED and not gtk2_ENABLED and not gtk3_ENABLED:
print("Warning: clipboard can only be used with the server or one of the gtk clients!")
Expand Down Expand Up @@ -500,6 +507,7 @@ def cython_add(extension, min_version=(0, 19)):
#python2.7 setup.py build -b build-2.7 install --no-compile --root=/var/tmp/portage/x11-wm/xpra-0.7.0/temp/images/2.7
if "--no-compile" in sys.argv and not ("build" in sys.argv and "install" in sys.argv):
return
assert cython_ENABLED, "cython compilation is disabled"
cython_version_check(min_version)
from Cython.Distutils import build_ext
ext_modules.append(extension)
Expand Down Expand Up @@ -1753,8 +1761,9 @@ def osx_pkgconfig(*pkgs_options, **ekw):

add_packages("xpra.buffers")
buffers_pkgconfig = pkgconfig(optimize=3)
cython_add(Extension("xpra.buffers.membuf",
["xpra/buffers/membuf.pyx"]+membuffers_c, **buffers_pkgconfig))
if cython_ENABLED:
cython_add(Extension("xpra.buffers.membuf",
["xpra/buffers/membuf.pyx"]+membuffers_c, **buffers_pkgconfig))


toggle_packages(dbus_ENABLED, "xpra.dbus")
Expand Down Expand Up @@ -1799,13 +1808,14 @@ def osx_pkgconfig(*pkgs_options, **ekw):
**quartz_pkgconfig
))

monotonic_time_pkgconfig = pkgconfig()
if not OSX and not WIN32 and not OPENBSD:
add_to_keywords(monotonic_time_pkgconfig, 'extra_link_args', "-lrt")
cython_add(Extension("xpra.monotonic_time",
["xpra/monotonic_time.pyx", "xpra/monotonic_ctime.c"],
**monotonic_time_pkgconfig
))
if cython_ENABLED:
monotonic_time_pkgconfig = pkgconfig()
if not OSX and not WIN32 and not OPENBSD:
add_to_keywords(monotonic_time_pkgconfig, 'extra_link_args', "-lrt")
cython_add(Extension("xpra.monotonic_time",
["xpra/monotonic_time.pyx", "xpra/monotonic_ctime.c"],
**monotonic_time_pkgconfig
))


toggle_packages(x11_ENABLED, "xpra.x11", "xpra.x11.bindings")
Expand Down

0 comments on commit cccc1c1

Please sign in to comment.