From 7b27082a730ee2a38ac2a70433f08f6193080dcd Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Fri, 15 Mar 2019 19:54:33 +0100 Subject: [PATCH] setup.py: bundled code vs system libs: use env vars we use anyway these are already used internally when the build system can not find a system library (neither via pkginfo nor BORG_LIBXXX_PREFIX is given) and then triggers usage of the bundled code via these env vars. now they are also used to tell right from the beginning "use the bundled code" and in that case it will not try to locate system libs and headers. --- setup.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/setup.py b/setup.py index c76058936..48f5c583f 100644 --- a/setup.py +++ b/setup.py @@ -24,14 +24,19 @@ import setup_compress import setup_crypto import setup_docs -# True: use the shared liblz4 (>= 1.7.0 / r129) from the system, False: use the bundled lz4 code -prefer_system_liblz4 = True +# BORG_USE_BUNDLED_XXX=YES --> use the bundled code +# BORG_USE_BUNDLED_XXX undefined --> try using system lib +# Note: do not use =NO, that is not supported! -# True: use the shared libzstd (>= 1.3.0) from the system, False: use the bundled zstd code -prefer_system_libzstd = True +# needed: lz4 (>= 1.7.0 / r129) +prefer_system_liblz4 = not bool(os.environ.get('BORG_USE_BUNDLED_LZ4')) + +# needed: zstd (>= 1.3.0) +prefer_system_libzstd = not bool(os.environ.get('BORG_USE_BUNDLED_ZSTD')) + +# needed: blake2 (>= 0.98.1) +prefer_system_libb2 = not bool(os.environ.get('BORG_USE_BUNDLED_B2')) -# True: use the shared libb2 (>= 0.98.1) from the system, False: use the bundled blake2 code -prefer_system_libb2 = True cpu_threads = multiprocessing.cpu_count() if multiprocessing else 1