Event Timeline
Comment Actions
Fails to build with the error seen below.
Not specifying PYMUPDF_SETUP_MUPDF_BUILD results in another error after the package tries to build MuPDF from scratch when building components with gmake. The build system is very complex. I feel like they need to use a different build infrastructure/tool than setuptools (cmake?) and they're going way too deep trying to get the build to work within the confines of setuptools, pip, etc.
^[[1m<...>/freebsd-ports/print/py-PyMuPDF/work-py311/pymupdf-1.26.5/src/build/extra.i.cpp:3346:10: ^[[0m^[[0;1;31mfatal error: ^[[0m^[[1m'mupdf/classes2.h' file not found^[[0m^M
 3346 | #include ^[[0;32m"mupdf/classes2.h"^[[0m^M
      | ^[[0;1;32m         ^~~~~~~~~~~~~~~~~~^M                                                                     
^[[0m1 error generated.^M                            
Traceback (most recent call last):^M                                                    
  File "/usr/local/lib/python3.11/site-packages/pyproject_hooks/_in_process/_in_process.py", line 389, in <module>^M
    main()^M                                                  
  File "/usr/local/lib/python3.11/site-packages/pyproject_hooks/_in_process/_in_process.py", line 373, in main^M
    json_out["return_val"] = hook(**hook_input["kwargs"])^M                                                                                                                          
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^M          
  File "/usr/local/lib/python3.11/site-packages/pyproject_hooks/_in_process/_in_process.py", line 280, in build_wheel^M                                        
    return _build_backend().build_wheel(^M                                                                               
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^M                               
  File "<...>/freebsd-ports/print/py-PyMuPDF/work-py311/pymupdf-1.26.5/pipcl.py", line 721, in build_wheel^M             
    items = self._call_fn_build(config_settings)^M
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^M
  File "<...>/freebsd-ports/print/py-PyMuPDF/work-py311/pymupdf-1.26.5/pipcl.py", line 1017, in _call_fn_build^M             
    ret = self.fn_build()^M                         
          ^^^^^^^^^^^^^^^^M                
  File "<...>/freebsd-ports/print/py-PyMuPDF/work-py311/pymupdf-1.26.5/setup.py", line 634, in build^M             
    path_so_leaf = _build_extension(^M                               
                   ^^^^^^^^^^^^^^^^^^M                           
  File "<...>/freebsd-ports/print/py-PyMuPDF/work-py311/pymupdf-1.26.5/setup.py", line 1108, in _build_extension^M             
    path_so_leaf = pipcl.build_extension(^M                         
                   ^^^^^^^^^^^^^^^^^^^^^^^M
  File "<...>/freebsd-ports/print/py-PyMuPDF/work-py311/pymupdf-1.26.5/pipcl.py", line 1867, in build_extension^M             
    run_if(^M                            
  File "<...>/freebsd-ports/print/py-PyMuPDF/work-py311/pymupdf-1.26.5/pipcl.py", line 2816, in run_if^M             
    run( command, caller=caller+1)^M     
  File "<...>/freebsd-ports/print/py-PyMuPDF/work-py311/pymupdf-1.26.5/pipcl.py", line 2385, in run^M             
    cp = subprocess.run(^M                                                                                            
         ^^^^^^^^^^^^^^^^M                                                                         
  File "/usr/local/lib/python3.11/subprocess.py", line 571, in run^M
    raise CalledProcessError(retcode, process.args,^M
subprocess.CalledProcessError: Command '$CXX \^M
    -fPIC \^M                                         
    -O2 -DNDEBUG \^M                                
    -I/usr/local/include/python3.11 -I/usr/local/include/python3.11 \^M
    -MD -MF <...>/freebsd-ports/print/py-PyMuPDF/work-py311/pymupdf-1.26.5/src/build/extra.i.cpp.o.d \^M
    -c <...>/freebsd-ports/print/py-PyMuPDF/work-py311/pymupdf-1.26.5/src/build/extra.i.cpp \^M
    -o <...>/freebsd-ports/print/py-PyMuPDF/work-py311/pymupdf-1.26.5/src/build/extra.i.cpp.o \^M
     -Wall -Wno-deprecated-declarations -Wno-unused-const-variable -O2 -pipe  -fstack-protector-strong -fno-strict-aliasing  -O2 -pipe -fstack-protector-strong -fno-strict-aliasing \^M
    -DPy_LIMITED_API=0x030b0000' returned non-zero exit status 1.^M                                                                   
^M                                                                                                                                                                                                        
^[[91mERROR^[[0m Backend subprocess exited when trying to invoke build_wheel^M
*** Error code 1^M                                                                                               
^M                                                            
Stop.^M                                                     
make: stopped in <...>/freebsd-ports/print/py-PyMuPDF^M
                                               
Command exit status: 1
Script done on Sun Oct 19 00:02:48 2025