Skip to content

Commit

Permalink
refbindings: allow system library loading
Browse files Browse the repository at this point in the history
This amends commit 39e12e0.
We want the reference bindings to be as universal as possible.
mara004 committed Nov 5, 2023
1 parent df54e88 commit 8a33235
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion setupsrc/pypdfium2_setup/autorelease.py
Original file line number Diff line number Diff line change
@@ -23,7 +23,7 @@ def run_local(*args, **kws):

def update_refbindings(version):
RefBindingsFile.unlink()
build_pdfium_bindings(version, guard_symbols=True)
build_pdfium_bindings(version, guard_symbols=True, allow_system_despite_libdirs=True)
shutil.copyfile(DataDir_Bindings/BindingsFN, RefBindingsFile)
assert RefBindingsFile.exists()

6 changes: 4 additions & 2 deletions setupsrc/pypdfium2_setup/packaging_base.py
Original file line number Diff line number Diff line change
@@ -375,7 +375,7 @@ def tar_extract_file(tar, src, dst_path):
shutil.copyfileobj(src_buf, dst_buf)


def run_ctypesgen(target_dir, headers_dir, flags=[], guard_symbols=False, compile_lds=[], run_lds=["."]):
def run_ctypesgen(target_dir, headers_dir, flags=[], guard_symbols=False, compile_lds=[], run_lds=["."], allow_system_despite_libdirs=False):
# The commands below are tailored to our fork of ctypesgen, so make sure we have that
# Import ctypesgen only in this function so it does not have to be available for other setup tasks
import ctypesgen
@@ -386,7 +386,9 @@ def run_ctypesgen(target_dir, headers_dir, flags=[], guard_symbols=False, compil
args = ["ctypesgen", f"--strip-build-path={headers_dir}", "--no-srcinfo", "--library", "pdfium"]

if run_lds:
args += ["--no-system-libsearch", "--runtime-libdirs", *run_lds]
args += ["--runtime-libdirs", *run_lds]
if not allow_system_despite_libdirs:
args += ["--no-system-libsearch"]
if compile_lds:
args += ["--compile-libdirs", *compile_lds]
else:

0 comments on commit 8a33235

Please sign in to comment.