diff --git a/docs/man/borg.1 b/docs/man/borg.1 index 4d235eae71..482f69d00c 100644 --- a/docs/man/borg.1 +++ b/docs/man/borg.1 @@ -662,6 +662,12 @@ operations), see \fI\%tempfile\fP for details. .B Building: .INDENT 7.0 .TP +.B BORG_OPENSSL_INC +Adds given OpenSSL header file directory (setup.py, only applicable for OpenBSD). +.TP +.B BORG_OPENSSL_LIB +Adds given OpenSSL library directory (setup, only applicable for OpenBSD). +.TP .B BORG_OPENSSL_PREFIX Adds given OpenSSL header file directory to the default locations (setup.py). .TP diff --git a/docs/usage/general/environment.rst.inc b/docs/usage/general/environment.rst.inc index d88133fa0f..d55e33278f 100644 --- a/docs/usage/general/environment.rst.inc +++ b/docs/usage/general/environment.rst.inc @@ -198,6 +198,10 @@ Directories and files: operations), see tempfile_ for details. Building: + BORG_OPENSSL_INC + Adds given OpenSSL header file directory (setup.py, only applicable for OpenBSD). + BORG_OPENSSL_LIB + Adds given OpenSSL library directory (setup.py, only applicable for OpenBSD). BORG_OPENSSL_PREFIX Adds given OpenSSL header file directory to the default locations (setup.py). BORG_LIBACL_PREFIX diff --git a/setup.py b/setup.py index 2d43469275..477e8b2feb 100644 --- a/setup.py +++ b/setup.py @@ -132,15 +132,15 @@ def lib_ext_kwargs(pc, prefix_env_var, lib_name, lib_pkg_name, pc_version, lib_s f"or ensure {lib_pkg_name}.pc is in PKG_CONFIG_PATH." ) - crypto_extra_objects = [] if is_win32: crypto_ext_lib = lib_ext_kwargs(pc, "BORG_OPENSSL_PREFIX", "libcrypto", "libcrypto", ">=1.1.1", lib_subdir="") elif is_openbsd: # Use openssl (not libressl) because we need AES-OCB via EVP api. Link # it statically to avoid conflicting with shared libcrypto from the base - # OS pulled in via dependencies. - crypto_ext_lib = {"include_dirs": ["/usr/local/include/eopenssl30"]} - crypto_extra_objects += ["/usr/local/lib/eopenssl30/libcrypto.a"] + # OS pulled in via dependencies. Make crypto paths configurable. + include_dirs = [os.environ.get("BORG_OPENSSL_INC", "/usr/local/include/eopenssl30")] + extra_objects = [os.path.join(os.environ.get("BORG_OPENSSL_LIB", "/usr/local/lib/eopenssl30"), "libcrypto.a")] + crypto_ext_lib = {"include_dirs": include_dirs, "extra_objects": extra_objects} else: crypto_ext_lib = lib_ext_kwargs(pc, "BORG_OPENSSL_PREFIX", "crypto", "libcrypto", ">=1.1.1") @@ -148,7 +148,6 @@ def lib_ext_kwargs(pc, prefix_env_var, lib_name, lib_pkg_name, pc_version, lib_s dict(sources=[crypto_ll_source]), crypto_ext_lib, dict(extra_compile_args=cflags), - dict(extra_objects=crypto_extra_objects), ) compress_ext_kwargs = members_appended(