mirror of
https://github.com/Trensa-Organization/hy3.git
synced 2025-03-15 18:53:40 +01:00
Improve build process and nix scripts
This commit is contained in:
parent
3924816ba2
commit
c880e0f009
5 changed files with 103 additions and 43 deletions
20
.gitignore
vendored
20
.gitignore
vendored
|
@ -1,4 +1,16 @@
|
||||||
build/
|
# build
|
||||||
compile_commands.json
|
/result
|
||||||
.vscode/
|
/build/
|
||||||
*.log
|
/compile_commands.json
|
||||||
|
|
||||||
|
# clangd
|
||||||
|
/.cache
|
||||||
|
|
||||||
|
# direnv
|
||||||
|
/.envrc
|
||||||
|
/.direnv/
|
||||||
|
|
||||||
|
# vscode
|
||||||
|
/.vscode/
|
||||||
|
|
||||||
|
/*.log
|
||||||
|
|
51
default.nix
Normal file
51
default.nix
Normal file
|
@ -0,0 +1,51 @@
|
||||||
|
{
|
||||||
|
hyprland,
|
||||||
|
|
||||||
|
lib,
|
||||||
|
nix-gitignore,
|
||||||
|
keepDebugInfo,
|
||||||
|
stdenv ? (keepDebugInfo hyprland.stdenv),
|
||||||
|
|
||||||
|
cmake,
|
||||||
|
ninja,
|
||||||
|
pkg-config,
|
||||||
|
pango,
|
||||||
|
cairo,
|
||||||
|
|
||||||
|
debug ? false,
|
||||||
|
hlversion ? "git",
|
||||||
|
versionCheck ? true,
|
||||||
|
}: stdenv.mkDerivation {
|
||||||
|
pname = "hy3";
|
||||||
|
version = "hl${hlversion}${lib.optionalString debug "-debug"}";
|
||||||
|
src = nix-gitignore.gitignoreSource [] ./.;
|
||||||
|
|
||||||
|
nativeBuildInputs = [
|
||||||
|
cmake
|
||||||
|
ninja
|
||||||
|
pkg-config
|
||||||
|
];
|
||||||
|
|
||||||
|
buildInputs = [
|
||||||
|
hyprland.dev
|
||||||
|
pango
|
||||||
|
cairo
|
||||||
|
] ++ hyprland.buildInputs;
|
||||||
|
|
||||||
|
cmakeFlags = lib.optional (!versionCheck) "-DHY3_NO_VERSION_CHECK=ON";
|
||||||
|
|
||||||
|
cmakeBuildType = if debug
|
||||||
|
then "Debug"
|
||||||
|
else "RelWithDebInfo";
|
||||||
|
|
||||||
|
buildPhase = "ninjaBuildPhase";
|
||||||
|
enableParallelBuilding = true;
|
||||||
|
dontStrip = true;
|
||||||
|
|
||||||
|
meta = with lib; {
|
||||||
|
homepage = "https://github.com/outfoxxed/hy3";
|
||||||
|
description = "Hyprland plugin for an i3 like manual tiling layout";
|
||||||
|
license = licenses.gpl3;
|
||||||
|
platforms = platforms.linux;
|
||||||
|
};
|
||||||
|
}
|
57
flake.nix
57
flake.nix
|
@ -5,51 +5,32 @@
|
||||||
|
|
||||||
outputs = { self, hyprland, ... }: let
|
outputs = { self, hyprland, ... }: let
|
||||||
inherit (hyprland.inputs) nixpkgs;
|
inherit (hyprland.inputs) nixpkgs;
|
||||||
hyprlandSystems = fn: nixpkgs.lib.genAttrs (builtins.attrNames hyprland.packages) (system: fn system nixpkgs.legacyPackages.${system});
|
|
||||||
|
hyprlandSystems = fn: nixpkgs.lib.genAttrs
|
||||||
|
(builtins.attrNames hyprland.packages)
|
||||||
|
(system: fn system nixpkgs.legacyPackages.${system});
|
||||||
|
|
||||||
|
props = builtins.fromJSON (builtins.readFile "${hyprland}/props.json");
|
||||||
in {
|
in {
|
||||||
packages = hyprlandSystems (system: pkgs: let
|
packages = hyprlandSystems (system: pkgs: rec {
|
||||||
hyprlandPackage = hyprland.packages.${system}.hyprland;
|
hy3 = pkgs.callPackage ./default.nix {
|
||||||
in rec {
|
hyprland = hyprland.packages.${system}.hyprland;
|
||||||
hy3 = hyprlandPackage.stdenv.mkDerivation {
|
hlversion = props.version;
|
||||||
pname = "hy3";
|
|
||||||
version = "0.1";
|
|
||||||
src = ./.;
|
|
||||||
|
|
||||||
nativeBuildInputs = with pkgs; [ cmake pkg-config ];
|
|
||||||
|
|
||||||
buildInputs = with pkgs; [
|
|
||||||
hyprlandPackage.dev
|
|
||||||
pango
|
|
||||||
cairo
|
|
||||||
] ++ hyprlandPackage.buildInputs;
|
|
||||||
|
|
||||||
# no noticeable impact on performance and greatly assists debugging
|
|
||||||
cmakeBuildType = "Debug";
|
|
||||||
dontStrip = true;
|
|
||||||
|
|
||||||
meta = with pkgs.lib; {
|
|
||||||
homepage = "https://github.com/outfoxxed/hy3";
|
|
||||||
description = "Hyprland plugin for an i3 / sway like manual tiling layout";
|
|
||||||
license = licenses.gpl3;
|
|
||||||
platforms = platforms.linux;
|
|
||||||
};
|
};
|
||||||
};
|
|
||||||
|
|
||||||
default = hy3;
|
default = hy3;
|
||||||
});
|
});
|
||||||
|
|
||||||
devShells = hyprlandSystems (system: pkgs: {
|
devShells = hyprlandSystems (system: pkgs: {
|
||||||
default = pkgs.mkShell.override {
|
default = import ./shell.nix {
|
||||||
stdenv = pkgs.gcc13Stdenv;
|
inherit pkgs;
|
||||||
} {
|
hlversion = props.version;
|
||||||
name = "hy3";
|
hyprland = hyprland.packages.${system}.hyprland-debug;
|
||||||
|
};
|
||||||
|
|
||||||
nativeBuildInputs = with pkgs; [
|
impure = import ./shell.nix {
|
||||||
clang-tools_17
|
pkgs = import <nixpkgs> {};
|
||||||
bear
|
hlversion = props.version;
|
||||||
];
|
hyprland = (pkgs.appendOverlays [ hyprland.overlays.hyprland-packages ]).hyprland-debug;
|
||||||
|
|
||||||
inputsFrom = [ self.packages.${system}.hy3 ];
|
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
|
@ -11,6 +11,6 @@ description = "i3 like tiling for hyprland"
|
||||||
authors = ["outfoxxed"]
|
authors = ["outfoxxed"]
|
||||||
output = "build/libhy3.so"
|
output = "build/libhy3.so"
|
||||||
build = [
|
build = [
|
||||||
"cmake -DCMAKE_BUILD_TYPE=Release -B build",
|
"cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -B build",
|
||||||
"cmake --build build"
|
"cmake --build build"
|
||||||
]
|
]
|
||||||
|
|
16
shell.nix
Normal file
16
shell.nix
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
{
|
||||||
|
hyprland,
|
||||||
|
pkgs,
|
||||||
|
hlversion ? "git",
|
||||||
|
hy3 ? pkgs.callPackage ./default.nix {
|
||||||
|
inherit hyprland hlversion;
|
||||||
|
versionCheck = false;
|
||||||
|
},
|
||||||
|
}: pkgs.mkShell {
|
||||||
|
inputsFrom = [ hy3 ];
|
||||||
|
|
||||||
|
nativeBuildInputs = with pkgs; [
|
||||||
|
clang-tools_17
|
||||||
|
bear
|
||||||
|
];
|
||||||
|
}
|
Loading…
Add table
Reference in a new issue