From 2f28dc810c0e1f42763a1f14fb011c4fce6db8be Mon Sep 17 00:00:00 2001 From: outfoxxed Date: Mon, 1 Jan 2024 20:57:46 -0800 Subject: [PATCH] Rewrite installation instructions Add hyprpm, deprecate AUR, prioritize stable releases for Nix. --- README.md | 70 +++++++++++++++++++++++++++++----------- compile_commands_bear.sh | 2 +- hyprload.toml | 2 +- hyprpm.toml | 13 ++++++++ src/main.cpp | 2 +- 5 files changed, 67 insertions(+), 22 deletions(-) create mode 100644 hyprpm.toml diff --git a/README.md b/README.md index 24f04f0..54aed39 100644 --- a/README.md +++ b/README.md @@ -65,12 +65,13 @@ Assuming you use hyprland's home manager module, you can easily integrate hy3 by inputs.nixpkgs.follows = "nixpkgs"; }; - hyprland.url = "github:hyprwm/Hyprland"; - # or "github:hyprwm/Hyprland?ref=v{version}" for a release version of hyprland + hyprland.url = "github:hyprwm/Hyprland?ref=v{version}"; # where {version} is the hyprland release version + # or "github:hyprwm/Hyprland" to follow the development branch hy3 = { - url = "github:outfoxxed/hy3"; - # or "github:outfoxxed/hy3?ref=hl{version}" for a release version of hyprland + url = "github:outfoxxed/hy3?ref=hl{version}"; # where {version} is the hyprland release version + # or "github:outfoxxed/hy3" to follow the development branch. + # (you may encounter issues if you dont do the same for hyprland) inputs.hyprland.follows = "hyprland"; }; }; @@ -108,11 +109,55 @@ wayland.windowManager.hyprland = { }; ``` +### hyprpm +Hyprland now has a dedicated plugin manager, which should be used when your package manager +isn't capable of locking hy3 builds to the correct hyprland version. + +To install hy3 via hyprpm run + +```sh +hyprpm add https://github.com/outfoxxed/hy3 +``` + +To update hy3 (and all other plugins), run + +```sh +hyprpm update +``` + +(See [the wiki](https://wiki.hyprland.org/Plugins/Using-Plugins/) for details.) + +> [!WARNING] +> When you are running a tagged hyprland version hyprpm will build against hy3's +> corrosponding release. However if you are running an untagged build (aka `-git`) hyprpm +> will build against hy3's *latest* commit. This means **if you are running an out of date +> untagged build of hyprland, hyprpm may pick an incompatible revision of hy3**. +> +> To fix this problem you will either need to update hyprland or manually build the correct +> version of hy3. + +### Manual +Install hyprland, including its headers and pkg-config file, then run the following commands: + +```sh +cmake -DCMAKE_BUILD_TYPE=Release -B build +cmake --build build +``` + +The plugin will be located at `build/libhy3.so`, and you can load it normally +(See [the hyprland wiki](https://wiki.hyprland.org/Plugins/Using-Plugins/#installing--using-plugins) for details.) + +Note that the hyprland headers and pkg-config file **MUST be installed correctly, for the target version of hyprland**. + ### Arch (AUR) -> [!IMPORTANT] +> [!NOTE] +> This method of installation is deprecated and you should use *hyprpm* instead, +> as it is simpler and less error prone. + +> [!CAUTION] > Pacman is not very reliable when it comes to building packages in the correct order. -> If hy3 fails to load or build, crashes randomly or behaves oddly (commonly dispatchers stop working) +> If you get a notification saying *hy3 was compiled for a different version of hyprland* > then your packages likely updated in the wrong order, or you have hyprland headers in `/usr/local`. > > To fix this, remove `/usr/include/hyprland`, `/usr/local/include/hyprland`, `/usr/share/pkgconfig/hyprland.pc` and `/usr/local/share/pkgconfig/hyprland.pc`, @@ -131,19 +176,6 @@ You can enable it in your hyprland configuration by adding the following line an plugin = /usr/lib/libhy3.so ``` -### Manual -Install hyprland, including its headers and pkg-config file, then run the following commands: - -```sh -cmake -DCMAKE_BUILD_TYPE=Debug -B build -cmake --build build -``` - -The plugin will be located at `build/libhy3.so`, and you can load it normally -(See [the hyprland wiki](https://wiki.hyprland.org/Plugins/Using-Plugins/#installing--using-plugins) for details.) - -Note that the hyprland headers and pkg-config file **MUST be installed correctly, for the target version of hyprland**. - ## Configuration > [!IMPORTANT] diff --git a/compile_commands_bear.sh b/compile_commands_bear.sh index 83b4946..2466693 100755 --- a/compile_commands_bear.sh +++ b/compile_commands_bear.sh @@ -1,4 +1,4 @@ rm -rf build -bear -- cmake --build build cmake -DCMAKE_BUILD_TYPE=Debug -DHY3_NO_VERSION_CHECK=TRUE -B build +bear -- cmake --build build -j16 sed -i 's/-std=gnu++23/-std=gnu++2b/g' compile_commands.json diff --git a/hyprload.toml b/hyprload.toml index 0d3855c..3ae0569 100644 --- a/hyprload.toml +++ b/hyprload.toml @@ -7,6 +7,6 @@ author = "outfoxxed" output = "build/libhy3.so" steps = [ "rm -rf build", - "cmake -DCMAKE_BUILD_TYPE=Debug -B build", + "cmake -DCMAKE_BUILD_TYPE=Release -B build", "cmake --build build" ] diff --git a/hyprpm.toml b/hyprpm.toml new file mode 100644 index 0000000..5ae6b84 --- /dev/null +++ b/hyprpm.toml @@ -0,0 +1,13 @@ +[repository] +name = "hy3" +authors = ["outfoxxed"] +commit_pins = [] + +[hy3] +description = "i3 like tiling for hyprland" +authors = ["outfoxxed"] +output = "build/libhy3.so" +build = [ + "cmake -DCMAKE_BUILD_TYPE=Release -B build", + "cmake --build build" +] diff --git a/src/main.cpp b/src/main.cpp index aebe592..249e14c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -18,7 +18,7 @@ APICALL EXPORT PLUGIN_DESCRIPTION_INFO PLUGIN_INIT(HANDLE handle) { if (GIT_COMMIT_HASH != std::string(__hyprland_api_get_hash())) { HyprlandAPI::addNotification( PHANDLE, - "[hy3] Hy3 was compiled for a different version of hyprland; refusing to start.", + "[hy3] hy3 was compiled for a different version of hyprland; refusing to load.", CColor {1.0, 0.2, 0.2, 1.0}, 10000 );