MCPcopy
hub / github.com/borgbackup/borg / lib_ext_kwargs

Function lib_ext_kwargs

setup.py:123–139  ·  view source on GitHub ↗
(pc, prefix_env_var, lib_name, lib_pkg_name, pc_version, lib_subdir="lib")

Source from the content-addressed store, hash-verified

121 pc = None
122
123 def lib_ext_kwargs(pc, prefix_env_var, lib_name, lib_pkg_name, pc_version, lib_subdir="lib"):
124 system_prefix = os.environ.get(prefix_env_var)
125 if system_prefix:
126 print(f"Detected and preferring {lib_pkg_name} [via {prefix_env_var}]")
127 return dict(
128 include_dirs=[os.path.join(system_prefix, "include")],
129 library_dirs=[os.path.join(system_prefix, lib_subdir)],
130 libraries=[lib_name],
131 )
132
133 if pc and pc.installed(lib_pkg_name, pc_version):
134 print(f"Detected and preferring {lib_pkg_name} [via pkg-config]")
135 return pc.parse(lib_pkg_name)
136 raise Exception(
137 f"Could not find {lib_name} lib/headers, please set {prefix_env_var} "
138 f"or ensure {lib_pkg_name}.pc is in PKG_CONFIG_PATH."
139 )
140
141 if is_win32:
142 crypto_ext_lib = lib_ext_kwargs(pc, "BORG_OPENSSL_PREFIX", "libcrypto", "libcrypto", ">=1.1.1", lib_subdir="")

Callers 1

setup.pyFile · 0.85

Calls 2

getMethod · 0.45
parseMethod · 0.45

Tested by

no test coverage detected