Skip to content

Commit e4420d1

Browse files
setup.py: fix generation of mupdf header tree.
We cannot use `git ls-files` when building using the hard-coded MuPDF default release because it is not a git checkout.
1 parent 015adf1 commit e4420d1

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

setup.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -626,10 +626,16 @@ def add(flavour, from_, to_):
626626
add('b', pipcl.get_soname(f'{mupdf_build_dir}/libmupdf.so'), to_dir)
627627

628628
if 'd' in PYMUPDF_SETUP_FLAVOUR:
629-
# Add MuPDF headers to `ret_d`.
629+
# Add MuPDF headers to `ret_d`. Would prefer to use
630+
# pipcl.git_items() but hard-coded mupdf tree is not a git
631+
# checkout.
630632
include = f'{mupdf_local}/include'
631-
for header in pipcl.git_items(include):
632-
add('d', f'{include}/{header}', f'{to_dir_d}/include/{header}')
633+
for dirpath, dirnames, filenames in os.walk(include):
634+
for filename in filenames:
635+
header_abs = os.path.join(dirpath, filename)
636+
assert header_abs.startswith(include)
637+
header_rel = header_abs[len(include)+1:]
638+
add('d', f'{header_abs}', f'{to_dir_d}/include/{header_rel}')
633639

634640
# Add a .py file containing location of MuPDF.
635641
text = f"mupdf_location='{mupdf_location}'\n"

0 commit comments

Comments
 (0)