<pre style='margin:0'>
Renee Otten (reneeotten) pushed a commit to branch master
in repository macports-ports.

</pre>
<p><a href="https://github.com/macports/macports-ports/commit/37c3dfd057ed944f7b65b36f3f1656743b2a9a08">https://github.com/macports/macports-ports/commit/37c3dfd057ed944f7b65b36f3f1656743b2a9a08</a></p>
<pre style="white-space: pre; background: #F8F8F8"><span style='display:block; white-space:pre;color:#808000;'>commit 37c3dfd057ed944f7b65b36f3f1656743b2a9a08
</span>Author: Mark Mentovai <mark@mentovai.com>
AuthorDate: Fri Sep 29 15:05:25 2023 -0400

<span style='display:block; white-space:pre;color:#404040;'>    py-mupdf: update to 1.23.5
</span>---
 python/py-mupdf/Portfile               | 26 ++++++---------
 python/py-mupdf/files/patch-build.diff | 61 ++++++++++++++++++++++++++++++++++
 python/py-mupdf/files/setup.py.diff    | 19 -----------
 3 files changed, 72 insertions(+), 34 deletions(-)

<span style='display:block; white-space:pre;color:#808080;'>diff --git a/python/py-mupdf/Portfile b/python/py-mupdf/Portfile
</span><span style='display:block; white-space:pre;color:#808080;'>index 8cbf25e978b..59ae0dfc3bf 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/python/py-mupdf/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/python/py-mupdf/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -7,7 +7,7 @@ PortGroup           python 1.0
</span> name                py-mupdf
 
 # Keep synchronized with port:mupdf.
<span style='display:block; white-space:pre;background:#ffe0e0;'>-github.setup        pymupdf PyMuPDF 1.22.5
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+github.setup        pymupdf PyMuPDF 1.23.5
</span> github.tarball_from archive
 
 revision            0
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -33,28 +33,24 @@ long_description    PyMuPDF adds Python bindings and abstractions to MuPDF, a \
</span> 
 homepage            https://pymupdf.readthedocs.io/
 
<span style='display:block; white-space:pre;background:#ffe0e0;'>-checksums           rmd160  280e01ede68b800fd9f30bfc83a24c9bccaffae3 \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-                    sha256  ff299df1f321c0546dc9a09ea5d91c6ce169dbda62c8fddd735c69963bad93d4 \
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-                    size    10780266
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-python.versions     37 38 39 310 311
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+checksums           rmd160  d08fe823f29b7cb5860a00d733973ea8fa685e97 \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                    sha256  0c3fa40951d2f1455c944898df09cbb42a8f0dfb80f8ff7b70ae678426d3c7a0 \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                    size    14640909
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+python.versions     38 39 310 311
</span> python.pep517       yes
 
 if {${name} ne ${subport}} {
     depends_build-append \
                     port:swig-python
     depends_lib-append \
<span style='display:block; white-space:pre;background:#e0ffe0;'>+                    port:freetype \
</span>                     port:mupdf
 
<span style='display:block; white-space:pre;background:#ffe0e0;'>-    patchfiles      setup.py.diff
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-    post-patch {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-        reinplace   "s|@prefix@|${prefix}|g"    ${worksrcpath}/setup.py
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-    }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+    patchfiles      patch-build.diff
</span> 
     build.env-append \
<span style='display:block; white-space:pre;background:#ffe0e0;'>-                    PYMUPDF_SETUP_MUPDF_BUILD=
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-    if {${python.pep517}} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-        # pyproject.toml lists "swig" in "requires", but this port uses
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-        # port:swig-python instead of the Python swig package.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-        build.args  --skip-dependency-check
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-    }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                    PYMUPDF_SETUP_MUPDF_BUILD= \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                    PYMUPDF_SETUP_IMPLEMENTATIONS=a \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                    PYMUPDF_INCLUDES=${prefix}/include:${prefix}/include/freetype2 \
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                    PYMUPDF_MUPDF_LIB=${prefix}/lib
</span> }
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/python/py-mupdf/files/patch-build.diff b/python/py-mupdf/files/patch-build.diff
</span>new file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 00000000000..739c9b41775
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/python/py-mupdf/files/patch-build.diff
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -0,0 +1,61 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git pipcl.py pipcl.py
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 26109b0c2520..7aaa111a07af 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- pipcl.py
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ pipcl.py
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -1449,12 +1449,13 @@ def build_extension(
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+         if optimise:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+             general_flags += ' -O2 -DNDEBUG'
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+         
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++        loadable_module_flag = '-shared'
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+         if darwin():
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-            # MacOS's linker does not like `-z origin`.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-            rpath_flag = "-Wl,-rpath,@loader_path/"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++            rpath_flag = ''
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+             
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+             # Avoid `Undefined symbols for ... "_PyArg_UnpackTuple" ...'.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+             general_flags += ' -undefined dynamic_lookup'
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++            loadable_module_flag = '-bundle'
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+         elif pyodide():
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+             # Setting `-Wl,-rpath,'$ORIGIN',-z,origin` gives:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+             #   emcc: warning: ignoring unsupported linker flag: `-rpath` [-Wlinkflags]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -1511,7 +1512,7 @@ def build_extension(
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+             command = f'''
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                     {command}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                         -fPIC
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-                        -shared
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++                        {loadable_module_flag}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                         {general_flags.strip()}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                         {pythonflags.includes}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                         {includes_text}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -1845,6 +1846,7 @@ def macos_patch( library, *sublibraries):
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+         List of paths of shared libraries; these have typically been
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+         specified with `-l` when `library` was created.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+     '''
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++    return
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+     log2( f'macos_patch(): library={library}  sublibraries={sublibraries}')
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+     if not darwin():
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+         return
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git pyproject.toml pyproject.toml
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 6c14e94fbb57..7cf8fe3db701 100644
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- pyproject.toml
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ pyproject.toml
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -1,5 +1,5 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ [build-system]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-requires = ["libclang", "swig", "setuptools"]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++requires = ["setuptools"]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ 
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # See pep-517.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ #
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+diff --git setup.py setup.py
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+index 4563dc197d7f..d5f1c4ccb1d7 100755
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+--- setup.py
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++++ setup.py
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+@@ -1105,7 +1105,7 @@ def _extension_flags( mupdf_local, mupdf_build_dir, build_type):
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+         libraries = f'{mupdf_local}\\platform\\{infix}\\{wp.cpu.windows_subdir}{build_type_infix}\\{libs}'
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+         compiler_extra = ''
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+     else:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+-        libs = ['mupdf']
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>++        libs = ['mupdf', 'freetype']
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+         defines = None
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+         compiler_extra += (
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                 ' -Wall'
</span><span style='display:block; white-space:pre;color:#808080;'>diff --git a/python/py-mupdf/files/setup.py.diff b/python/py-mupdf/files/setup.py.diff
</span>deleted file mode 100644
<span style='display:block; white-space:pre;color:#808080;'>index 5d3f07562ee..00000000000
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/python/py-mupdf/files/setup.py.diff
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -1,19 +0,0 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>---- setup.py.orig
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+++ setup.py
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-@@ -712,7 +712,15 @@
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-             library_dirs.append( unix_build_dir)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-         extra_swig_args.append(f'-I{mupdf_local}/include')
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- 
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--    if mupdf_local and (linux or openbsd or freebsd):
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+    if True:
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+        include_dirs.append("@prefix@/include")
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+        include_dirs.append("@prefix@/include/mupdf")
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+        include_dirs.append("@prefix@/include/freetype2")
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+        library_dirs.append("@prefix@/lib")
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+        libraries = ["mupdf"]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+        extra_swig_args.append("-I@prefix@/include")
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-+    elif mupdf_local and (linux or openbsd or freebsd):
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-         # setuptools' link command always seems to put '-L
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-         # /usr/local/lib' before any <library_dirs> that we specify,
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-         # so '-l mupdf -l mupdf-third' will end up using the system
</span></pre><pre style='margin:0'>

</pre>