Ladybird: Please document "make install" equivalent
Normally one can install software with a compiled-in prefix (/usr) to a custom directory (for further packaging, e.g., binary_root) using something like
./configure --prefix=/usr
make -j$(nproc)
make install DESTDIR=$(readlink -f binary_root)
or
cmake . -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr
make -j$(nproc)
make DESTDIR=binary_root -j$(nproc) install
As a result, one would get the following filesystem structure:
% find binary_root/
binary_root/usr/bin/ladybird
binary_root/usr/lib/liblagom-filesystem.so.0
binary_root/usr/lib/liblagom-regex.so.0
...
Packaging tools could then turn the contents of binary_root into a package, the contents of which at installation time would be installed at /.
Unfortunately Ladybird does not use normal CMake commands for building and installing, and https://github.com/SerenityOS/serenity/blob/master/Documentation/BuildInstructionsLadybird.md does not describe how to install Ladybird.
How can this be done?
The Arch PKGBUILD does seem to use the build system's install target. Have you tried that?
Thanks for the pointers.
cmake -GNinja -S . -B Build/ -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX='/usr' -Wno-dev
ninja -C Build
DESTDIR="../binary_root/" ninja -C Build install
seems to do the job. (Note the .. because it is relative to ./Build which might be surprising).
Would be good to have it documented in https://github.com/SerenityOS/serenity/blob/master/Documentation/BuildInstructionsLadybird.md.
Unfortunately Ladybird does not use normal CMake commands for building and installing, and master/Documentation/BuildInstructionsLadybird.md does not describe how to install Ladybird.
This is not really true. We have had install rules even since the time this issue was opened (last July).
The section 'Custom CMake Build Directory' here states:
The install rules in Ladybird/cmake/InstallRules.cmake define which binaries and libraries will be installed into the configured CMAKE_PREFIX_PATH or path passed to cmake --install.
This is exactly describing "the normal CMake commands for installing". If there's something that's not clear about that, PRs to improve the documentation are welcome!