Regression: cmake install error for man page

System Information
Operating system: Alpine Linux

Blender Version
Broken: 4.0.0
Worked: 3.6.5

Short description of error
When trying to build and install blender using unconventional directories, it gives a cmake error:

CMake Error at build-full/source/creator/cmake_install.cmake:2103 (file):
  file INSTALL cannot find
  "/builds/lmarz/aports/community/blender/src/blender-4.0.0/build-full/source/creator/blender.1":
  No such file or directory.
Call Stack (most recent call first):
  build-full/cmake_install.cmake:51 (include)

My guess is that it couldn’t find the blender executable to generate the man page and it probably quietly failed until the step where the file is copied to the target directory. Some cmake variables were changed between version 3.6 and 4.0.

Exact steps for others to reproduce the error
Here is the cmake command:

cmake -B build-full \
    -C build_files/cmake/config/blender_full.cmake \
    -G Ninja -Wno-dev \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DCMAKE_BUILD_TYPE=Release \
    -DWITH_PYTHON_INSTALL=OFF \
    -DWITH_INSTALL_PORTABLE=OFF \
    -DWITH_LIBS_PRECOMPILED=OFF \
    -DWITH_SYSTEM_EIGEN3=ON \
    -DWITH_SYSTEM_GLOG=ON \
    -DWITH_SYSTEM_LZO=ON \
    -DLLVM_VERSION=15 \
    -DPYTHON_VERSION=3.12

cmake --build build-full
DESTDIR="$pkgdir" cmake --install build-full

Here is the full log: man_page_fail.txt
Warning: The log is quite verbose as it builds three different versions of blender

try reverting f6931a9ead56400cdea4cdd4252476ee34ce5901

Thanks for the reply, but this doesn’t work because the script blender.1.py has changed. According to it, you now invoke it with

./blender.bin -b --python doc/manpage/blender.1.py -- --output <output-filename>

So I’ve tried to change execute_process:

set(BLENDER_BIN \"${EXECUTABLE_OUTPUT_PATH}/blender\")\n\
...
execute_process(COMMAND $\{BLENDER_BIN\} --background --factory-startup --python $\{MANPAGE_GEN\} -- --output $\{MANPAGE_OUT\})\n\

but this only gives

Color management: using fallback mode for management
blf_load_font_default: 'fonts' data path not found for 'Inter.woff2', will not be able to display text
blf_load_font_default: 'fonts' data path not found for 'DejaVuSansMono.woff2', will not be able to display text
blf_load_font_default: 'fonts' data path not found for 'DejaVuSansMono.woff2', will not be able to display text
blf_load_font_default: 'fonts' data path not found for 'Inter.woff2', will not be able to display text
blf_load_font_default: 'fonts' data path not found for 'DejaVuSansMono.woff2', will not be able to display text
Font data directory "fonts/" could not be detected!
Blender 4.0.1 (hash unknown built 2023-11-17 17:59:40)
BLT_lang_init: 'locale' data path for translations not found, continuing
Color management: scene view "AgX" not found, setting default "Standard".
bpy: couldn't find 'scripts/modules', blender probably won't start.
Freestyle: couldn't find 'scripts/freestyle/modules', Freestyle won't work properly.
ModuleNotFoundError: No module named 'bpy_types'
ModuleNotFoundError: No module named 'bpy_types'
ERROR (bpy.rna): source/blender/python/intern/bpy_rna.cc:7288 pyrna_srna_ExternalType: failed to find 'bpy_types' module
ModuleNotFoundError: No module named 'bpy_types'
ModuleNotFoundError: No module named 'bpy_types'
ERROR (bpy.rna): source/blender/python/intern/bpy_rna.cc:7288 pyrna_srna_ExternalType: failed to find 'bpy_types' module
ModuleNotFoundError: No module named 'bpy_types'
ERROR (bpy.rna): source/blender/python/intern/bpy_rna.cc:7288 pyrna_srna_ExternalType: failed to find 'bpy_types' module
ModuleNotFoundError: No module named 'bpy_types'
ERROR (bpy.rna): source/blender/python/intern/bpy_rna.cc:7288 pyrna_srna_ExternalType: failed to find 'bpy_types' module
ModuleNotFoundError: No module named 'bpy_types'
ERROR (bpy.rna): source/blender/python/intern/bpy_rna.cc:7288 pyrna_srna_ExternalType: failed to find 'bpy_types' module
ModuleNotFoundError: No module named 'bpy_types'
ERROR (bpy.rna): source/blender/python/intern/bpy_rna.cc:7288 pyrna_srna_ExternalType: failed to find 'bpy_types' module
ModuleNotFoundError: No module named 'bpy_types'
ERROR (bpy.rna): source/blender/python/intern/bpy_rna.cc:7288 pyrna_srna_ExternalType: failed to find 'bpy_types' module
ModuleNotFoundError: No module named 'bpy_types'
ERROR (bpy.rna): source/blender/python/intern/bpy_rna.cc:7288 pyrna_srna_ExternalType: failed to find 'bpy_types' module
ModuleNotFoundError: No module named 'bpy_types'
ERROR (bpy.rna): source/blender/python/intern/bpy_rna.cc:7288 pyrna_srna_ExternalType: failed to find 'bpy_types' module
ModuleNotFoundError: No module named 'bpy'
Error: dropbox with unknown operator: WM_OT_drop_blend_file
Error: Python: Traceback (most recent call last):
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1140, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'bpy'
Error: Python: Traceback (most recent call last):
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1140, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'bpy'
terminate called after throwing an instance of 'std::logic_error'
  what():  basic_string: construction from null is not valid
CMake Error at build-full/source/creator/cmake_install.cmake:2093 (file):
  file INSTALL cannot find
  "/builds/lmarz/aports/community/blender/src/blender-4.0.1/build-full/source/creator/blender.1":
  No such file or directory.
Call Stack (most recent call first):
  build-full/cmake_install.cmake:51 (include)

See #115127 - Manpage: python script byte to string to fix blender.1.py - blender - Blender Projects