Hyprland
Hyprland copied to clipboard
Install files using CMake, use CMake for Nix
Describe your PR, what does it fix/add?
CMake now installs files directly (through cmake --install ./build). The Makefile commands have a warning that directs users to the appropriate commands.
Nix now uses CMake for building. We also no longer patch the build process to avoid building subprojects. This simplifies things on the building part, but complicates them a bit on the UX part.
In order to test these changes, you will have to do so with the following command:
$ nix build 'git+https://github.com/hyprwm/Hyprland?ref=cmake&submodules=1'
Closes #4956. Closes #2313.
[!IMPORTANT] I may revert back to patching the build process and using derivations for subprojects instead, if this method proves to be too unergonomic.
Is there anything you want to mention? (unchecked code, possible bugs, found problems, breaking compatibility, etc.)
CMake run from the command line seems to build fine, but when built with Nix it seems to build twice for some reason. Will have to look into the CMake and Ninja setup hooks.
Another thing to note is, in Nix at least, the XWayland package contains a pkg-config file that exposes includedir and Cflags, which are useless due to XWayland not including headers in the package. They have to be patched out.
Is it ready for merging, or does it need work?
No. Please test it and report back.
TODO:
- [x] Fix Nix build compiling twice (was due to
CONFIGURE_DEPENDS) - [x] Check feature parity with the Meson build
- [x] Nix devshell does not inherit overridden XWayland (you have to build using
cmakeConfigurePhase,ninjaBuildPhaseandninjaInstallPhase)
@vaxerski I've also removed all occurrences of -j, as per https://stackoverflow.com/questions/70541788/how-to-build-a-cmake-project-in-parallel-on-all-available-cores.
@outfoxxed can you test when you have the time?
Headers seem to work now, hy3 built successfully.