Rewrite installation instructions

Add hyprpm, deprecate AUR, prioritize stable releases for Nix.
This commit is contained in:
outfoxxed 2024-01-01 20:57:46 -08:00
parent a92314b57a
commit 2f28dc810c
No known key found for this signature in database
GPG key ID: 4C88A185FB89301E
5 changed files with 67 additions and 22 deletions

View file

@ -65,12 +65,13 @@ Assuming you use hyprland's home manager module, you can easily integrate hy3 by
inputs.nixpkgs.follows = "nixpkgs"; inputs.nixpkgs.follows = "nixpkgs";
}; };
hyprland.url = "github:hyprwm/Hyprland"; hyprland.url = "github:hyprwm/Hyprland?ref=v{version}"; # where {version} is the hyprland release version
# or "github:hyprwm/Hyprland?ref=v{version}" for a release version of hyprland # or "github:hyprwm/Hyprland" to follow the development branch
hy3 = { hy3 = {
url = "github:outfoxxed/hy3"; url = "github:outfoxxed/hy3?ref=hl{version}"; # where {version} is the hyprland release version
# or "github:outfoxxed/hy3?ref=hl{version}" for a release version of hyprland # 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"; 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) ### 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. > 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`. > 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`, > 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 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 ## Configuration
> [!IMPORTANT] > [!IMPORTANT]

View file

@ -1,4 +1,4 @@
rm -rf build rm -rf build
bear -- cmake --build build
cmake -DCMAKE_BUILD_TYPE=Debug -DHY3_NO_VERSION_CHECK=TRUE -B 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 sed -i 's/-std=gnu++23/-std=gnu++2b/g' compile_commands.json

View file

@ -7,6 +7,6 @@ author = "outfoxxed"
output = "build/libhy3.so" output = "build/libhy3.so"
steps = [ steps = [
"rm -rf build", "rm -rf build",
"cmake -DCMAKE_BUILD_TYPE=Debug -B build", "cmake -DCMAKE_BUILD_TYPE=Release -B build",
"cmake --build build" "cmake --build build"
] ]

13
hyprpm.toml Normal file
View file

@ -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"
]

View file

@ -18,7 +18,7 @@ APICALL EXPORT PLUGIN_DESCRIPTION_INFO PLUGIN_INIT(HANDLE handle) {
if (GIT_COMMIT_HASH != std::string(__hyprland_api_get_hash())) { if (GIT_COMMIT_HASH != std::string(__hyprland_api_get_hash())) {
HyprlandAPI::addNotification( HyprlandAPI::addNotification(
PHANDLE, 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}, CColor {1.0, 0.2, 0.2, 1.0},
10000 10000
); );