Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install files using CMake, use CMake for Nix #5667

Merged
merged 3 commits into from
May 5, 2024
Merged

Install files using CMake, use CMake for Nix #5667

merged 3 commits into from
May 5, 2024

Conversation

fufexan
Copy link
Member

@fufexan fufexan commented Apr 20, 2024

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:

  • Fix Nix build compiling twice (was due to CONFIGURE_DEPENDS)
  • Check feature parity with the Meson build
  • Nix devshell does not inherit overridden XWayland (you have to build using cmakeConfigurePhase, ninjaBuildPhase and ninjaInstallPhase)

@fufexan fufexan force-pushed the cmake branch 2 times, most recently from 645c6cb to 86234c2 Compare April 20, 2024 20:26
Makefile Outdated Show resolved Hide resolved
Makefile Outdated Show resolved Hide resolved
CMakeLists.txt Outdated Show resolved Hide resolved
Makefile Outdated Show resolved Hide resolved
hyprctl/CMakeLists.txt Outdated Show resolved Hide resolved
CMakeLists.txt Outdated Show resolved Hide resolved
@fufexan fufexan force-pushed the cmake branch 3 times, most recently from 6eee9a0 to d154bb7 Compare May 3, 2024 18:27
@fufexan fufexan marked this pull request as ready for review May 3, 2024 18:51
@fufexan fufexan requested review from vaxerski and jbeich May 3, 2024 22:50
Makefile Outdated Show resolved Hide resolved
Makefile Outdated Show resolved Hide resolved
hyprland.pc.in Show resolved Hide resolved
@fufexan
Copy link
Member Author

fufexan commented May 4, 2024

@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.

@fufexan
Copy link
Member Author

fufexan commented May 4, 2024

@outfoxxed can you test when you have the time?

@outfoxxed
Copy link
Member

Headers seem to work now, hy3 built successfully.

Copy link
Member

@vaxerski vaxerski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

vă mulțumesc pentru munca frate

fufexan added 3 commits May 5, 2024 16:18
Build using submodules instead of patching the build process and using
Nix derivations of the subprojects.

From this commit on, you'll have to change the Hyprland flake url to
`git+https://github.com/hyprwm/Hyprland?submodules=1`
- Clone repo recursively
- Update Nix install action
- Remove wlroots update
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add cmake install target
4 participants