Skip to content

Commit

Permalink
setup.py: also add MuPDF C++ headers to mupdf-devel/include.
Browse files Browse the repository at this point in the history
  • Loading branch information
julian-smith-artifex-com committed Oct 28, 2024
1 parent 216414e commit d92e85c
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -658,17 +658,22 @@ 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`. Would prefer to use
# Add MuPDF C and C++ 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 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}')
for root in (
f'{mupdf_local}/include',
f'{mupdf_local}/platform/c++/include',
):
for dirpath, dirnames, filenames in os.walk(root):
for filename in filenames:
if not filename.endswith('.h'):
continue
header_abs = os.path.join(dirpath, filename)
assert header_abs.startswith(root)
header_rel = header_abs[len(root)+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 d92e85c

Please sign in to comment.