Skip to content

Commit

Permalink
setup.py: fix generation of mupdf header tree.
Browse files Browse the repository at this point in the history
We cannot use `git ls-files` when building using the hard-coded MuPDF default
release because it is not a git checkout.
  • Loading branch information
julian-smith-artifex-com committed Jul 22, 2024
1 parent 015adf1 commit e4420d1
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -626,10 +626,16 @@ def add(flavour, from_, to_):
add('b', pipcl.get_soname(f'{mupdf_build_dir}/libmupdf.so'), to_dir)

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

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

0 comments on commit e4420d1

Please sign in to comment.