ElyPDF's licences on Windows come from MuPDF's MSBuild projects
mupdf-parts.py reads which third parties and font families the Windows build compiled in; Make builds still list their folders. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
e48035cdd5
commit
76b78782d5
2 files changed
+38
-4
No files matched your search
+12
-4
@@ -39,8 +39,17 @@ case $slug in
|
||||
ely-pdf)
|
||||
put MuPDF "$root/engines/mupdf-src/COPYING"
|
||||
# Every third party the MuPDF build compiled in.
|
||||
for part in "$root"/engines/mupdf-build/thirdparty/*; do
|
||||
name=${part##*/}
|
||||
case $(uname) in
|
||||
MINGW* | MSYS*)
|
||||
parts=$(python3 "$root/packaging/windows/mupdf-parts.py" "$root/engines/mupdf-src" parts)
|
||||
families=$(python3 "$root/packaging/windows/mupdf-parts.py" "$root/engines/mupdf-src" fonts)
|
||||
;;
|
||||
*)
|
||||
parts=$(ls "$root/engines/mupdf-build/thirdparty")
|
||||
families=$(ls "$root/engines/mupdf-build/generated/resources/fonts")
|
||||
;;
|
||||
esac
|
||||
for name in $parts; do
|
||||
found=$(find "$root/engines/mupdf-src/thirdparty/$name" -maxdepth 1 -type f \
|
||||
\( -iname 'licen[cs]e*' -o -iname 'copying*' -o -iname '*-license.txt' \))
|
||||
[ "$name" = libjpeg ] && found=$root/engines/mupdf-src/thirdparty/libjpeg/README
|
||||
@@ -49,8 +58,7 @@ case $slug in
|
||||
put "MuPDF/$name" $found
|
||||
done
|
||||
# Every font family MuPDF built into the worker.
|
||||
for part in "$root"/engines/mupdf-build/generated/resources/fonts/*; do
|
||||
name=${part##*/}
|
||||
for name in $families; do
|
||||
fonts=$root/engines/mupdf-src/resources/fonts/$name
|
||||
found=$(find "$fonts" -maxdepth 1 -type f \( -iname 'licen[cs]e*' -o -iname 'copying*' -o -iname 'notice*' -o -iname 'ofl*' \))
|
||||
[ -n "$found" ] || { echo "licenses.sh: no licence for MuPDF's $name fonts" >&2; exit 1; }
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
"""Usage: mupdf-parts.py <mupdf-src> parts|fonts; what MSBuild compiled."""
|
||||
import re
|
||||
import sys
|
||||
|
||||
src, what = sys.argv[1], sys.argv[2]
|
||||
projects = f"{src}/platform/win32"
|
||||
# The libraries build-mupdf.sh links into the worker.
|
||||
built = ["libthirdparty", "libextract", "libharfbuzz", "libleptonica", "libmubarcode",
|
||||
"libtesseract", "libmupdf", "libpkcs7"]
|
||||
compiled = re.compile(r'<ClCompile Include="\.\.\\\.\.\\thirdparty\\([^\\"]+)\\')
|
||||
embedded = re.compile(r'Include="\.\.\\\.\.\\resources\\fonts\\([^\\"]+)\\')
|
||||
found = set()
|
||||
if what == "parts":
|
||||
for name in built:
|
||||
with open(f"{projects}/{name}.vcxproj", encoding="utf-8") as project:
|
||||
found |= set(compiled.findall(project.read()))
|
||||
elif what == "fonts":
|
||||
with open(f"{projects}/libresources.vcxproj", encoding="utf-8") as project:
|
||||
found = set(embedded.findall(project.read()))
|
||||
else:
|
||||
sys.exit(f"mupdf-parts.py: parts or fonts, not {what}")
|
||||
if not found:
|
||||
sys.exit(f"mupdf-parts.py: no {what} in {projects}")
|
||||
# Bash reads these names; Windows would end them CRLF.
|
||||
sys.stdout.reconfigure(newline="\n")
|
||||
print("\n".join(sorted(found)))
|
||||
Reference in new issue
Block a user