diff --git a/pkgs/applications/window-managers/hyprwm/hyprland/plugins.nix b/pkgs/applications/window-managers/hyprwm/hyprland-plugins/default.nix similarity index 77% rename from pkgs/applications/window-managers/hyprwm/hyprland/plugins.nix rename to pkgs/applications/window-managers/hyprwm/hyprland-plugins/default.nix index 413de2576411..859ddf6dcecc 100644 --- a/pkgs/applications/window-managers/hyprwm/hyprland/plugins.nix +++ b/pkgs/applications/window-managers/hyprwm/hyprland-plugins/default.nix @@ -22,27 +22,27 @@ let plugins = { hy3 = { fetchFromGitHub, cmake, hyprland }: - mkHyprlandPlugin hyprland { + mkHyprlandPlugin hyprland rec { pluginName = "hy3"; - version = "0.40.0"; + version = "0.41.0"; src = fetchFromGitHub { owner = "outfoxxed"; repo = "hy3"; - rev = "hl0.40.0"; - hash = "sha256-Y9bIML3C5xyKKv+Yel4LUfSkScwGunOVZkg+Z1dPwHI="; + rev = "hl${version}"; + hash = "sha256-gEEWWlQRvejSR2RRg78Lubz6siIgknqj6CslveyyIP4="; }; nativeBuildInputs = [ cmake ]; dontStrip = true; - meta = with lib; { + meta = { homepage = "https://github.com/outfoxxed/hy3"; description = "Hyprland plugin for an i3 / sway like manual tiling layout"; - license = licenses.gpl3; - platforms = platforms.linux; - maintainers = [ maintainers.aacebedo ]; + license = lib.licenses.gpl3; + platforms = lib.platforms.linux; + maintainers = with lib.maintainers; [ aacebedo ]; }; }; }; diff --git a/pkgs/by-name/hy/hyprland/info.json b/pkgs/by-name/hy/hyprland/info.json new file mode 100644 index 000000000000..ef4aabbe6b03 --- /dev/null +++ b/pkgs/by-name/hy/hyprland/info.json @@ -0,0 +1,7 @@ +{ + "branch": "main", + "commit_hash": "9e781040d9067c2711ec2e9f5b47b76ef70762b3", + "commit_message": "props: bump version to 0.41.1", + "date": "2024-06-13", + "tag": "v0.41.1" +} diff --git a/pkgs/applications/window-managers/hyprwm/hyprland/default.nix b/pkgs/by-name/hy/hyprland/package.nix similarity index 77% rename from pkgs/applications/window-managers/hyprwm/hyprland/default.nix rename to pkgs/by-name/hy/hyprland/package.nix index 958e84ac78f0..ae3e38de9a6c 100644 --- a/pkgs/applications/window-managers/hyprwm/hyprland/default.nix +++ b/pkgs/by-name/hy/hyprland/package.nix @@ -9,21 +9,29 @@ , binutils , cairo , epoll-shim +, expat +, fribidi , git , hyprcursor , hyprland-protocols , hyprlang +, hyprutils , hyprwayland-scanner , jq , libGL , libdrm +, libdatrie , libexecinfo , libinput +, libselinux +, libsepol +, libthai , libuuid , libxkbcommon , mesa , pango , pciutils +, pcre2 , pkgconf , python3 , systemd @@ -47,30 +55,41 @@ , hidpiXWayland ? false , enableNvidiaPatches ? false }: +let + info = builtins.fromJSON (builtins.readFile ./info.json); +in assert lib.assertMsg (!nvidiaPatches) "The option `nvidiaPatches` has been removed."; assert lib.assertMsg (!enableNvidiaPatches) "The option `enableNvidiaPatches` has been removed."; assert lib.assertMsg (!hidpiXWayland) "The option `hidpiXWayland` has been removed. Please refer https://wiki.hyprland.org/Configuring/XWayland"; stdenv.mkDerivation (finalAttrs: { pname = "hyprland" + lib.optionalString debug "-debug"; - version = "0.40.0-unstable-2024-05-05"; + version = "0.41.1"; src = fetchFromGitHub { owner = "hyprwm"; repo = finalAttrs.pname; fetchSubmodules = true; - rev = "f15513309b24790099d42974274eb23f66f7c985"; - hash = "sha256-zKOfgXPTlRqCR+EME4qjN9rgAnC3viI5KWx10dhKszw="; + rev = "refs/tags/v${finalAttrs.version}"; + hash = "sha256-hLnnNBWP1Qjs1I3fndMgp8rbWJruxdnGTq77A4Rv4R4="; }; postPatch = '' # Fix hardcoded paths to /usr installation sed -i "s#/usr#$out#" src/render/OpenGL.cpp + + # Remove extra @PREFIX@ to fix pkg-config paths + sed -i "s#@PREFIX@/##g" hyprland.pc.in ''; - # used by version.sh - DATE = "2024-05-05"; - HASH = finalAttrs.src.rev; + # variables used by generateVersion.sh script, and shown in `hyprctl version` + BRANCH = info.branch; + COMMITS = info.commit_hash; + DATE = info.date; + DIRTY = ""; + HASH = info.commit_hash; + MESSAGE = info.commit_message; + TAG = info.tag; depsBuildBuild = [ # to find wayland-scanner when cross-compiling @@ -98,13 +117,20 @@ stdenv.mkDerivation (finalAttrs: { buildInputs = [ cairo + expat + fribidi git - hyprcursor + hyprcursor.dev hyprland-protocols hyprlang + hyprutils libGL + libdatrie libdrm libinput + libselinux + libsepol + libthai libuuid libxkbcommon mesa @@ -112,6 +138,7 @@ stdenv.mkDerivation (finalAttrs: { wayland-protocols pango pciutils + pcre2 tomlplusplus # for subproject wlroots-hyprland seatd @@ -152,11 +179,16 @@ stdenv.mkDerivation (finalAttrs: { passthru.providedSessions = [ "hyprland" ]; - meta = with lib; { + passthru.updateScript = ./update.sh; + + meta = { homepage = "https://github.com/hyprwm/Hyprland"; description = "Dynamic tiling Wayland compositor that doesn't sacrifice on its looks"; - license = licenses.bsd3; - maintainers = with maintainers; [ wozeparrot fufexan ]; + license = lib.licenses.bsd3; + maintainers = with lib.maintainers; [ + wozeparrot + fufexan + ]; mainProgram = "Hyprland"; platforms = lib.platforms.linux; }; diff --git a/pkgs/by-name/hy/hyprland/update.sh b/pkgs/by-name/hy/hyprland/update.sh new file mode 100755 index 000000000000..c729705f6b1d --- /dev/null +++ b/pkgs/by-name/hy/hyprland/update.sh @@ -0,0 +1,35 @@ +#!/usr/bin/env nix-shell +#! nix-shell -i bash -p common-updater-scripts fd jq + +set -eou pipefail + +latest_release="$(curl --silent 'https://api.github.com/repos/hyprwm/Hyprland/releases/latest')" +latest_tag="$(curl --silent 'https://api.github.com/repos/hyprwm/Hyprland/tags?per_page=1')" +commit_hash="$(jq -r '.[0].commit.sha' <<<"$latest_tag")" +latest_commit="$(curl --silent 'https://api.github.com/repos/hyprwm/Hyprland/commits/'"$commit_hash"'')" +commit_message="$(jq -r '.commit.message' <<<"$latest_commit")" + +tag=$(jq -r '.tag_name' <<<"$latest_release") +# drop 'v' prefix +version="${tag#v}" + +branch=$(jq -r '.target_commitish' <<<"$latest_release") + +date=$(jq -r '.created_at' <<<"$latest_release") +# truncate time +date=${date%T*} + +# update version; otherwise fail +update-source-version hyprland "$version" --ignore-same-hash + +# find hyprland dir +files="$(fd --full-path /hyprland/ | head -1)" +dir="${files%/*}" + +echo -e '{ + "branch": "'"$branch"'", + "commit_hash": "'"$commit_hash"'", + "commit_message": "'"$commit_message"'", + "date": "'"$date"'", + "tag": "'"$tag"'" +}' >"$dir/info.json" diff --git a/pkgs/by-name/hy/hyprutils/package.nix b/pkgs/by-name/hy/hyprutils/package.nix new file mode 100644 index 000000000000..f29cb3665fbd --- /dev/null +++ b/pkgs/by-name/hy/hyprutils/package.nix @@ -0,0 +1,35 @@ +{ + lib, + stdenv, + cmake, + fetchFromGitHub, +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "hyprutils"; + version = "0.1.2"; + + src = fetchFromGitHub { + owner = "hyprwm"; + repo = "hyprutils"; + rev = "v${finalAttrs.version}"; + hash = "sha256-8KvVqtApNt4FWTdn1TqVvw00rpqyG9UuUPA2ilPVD1U="; + }; + + nativeBuildInputs = [ cmake ]; + + outputs = [ "out" "dev" ]; + + doCheck = false; + + meta = { + homepage = "https://github.com/hyprwm/hyprutils"; + description = "Small C++ library for utilities used across the Hypr* ecosystem"; + license = lib.licenses.bsd3; + platforms = lib.platforms.linux; + maintainers = with lib.maintainers; [ + donovanglover + johnrtitor + ]; + }; +}) diff --git a/pkgs/by-name/hy/hyprwayland-scanner/package.nix b/pkgs/by-name/hy/hyprwayland-scanner/package.nix index 1aebc8b62600..ec295b2d7285 100644 --- a/pkgs/by-name/hy/hyprwayland-scanner/package.nix +++ b/pkgs/by-name/hy/hyprwayland-scanner/package.nix @@ -4,17 +4,18 @@ , cmake , pkg-config , pugixml +, nix-update-script , }: stdenv.mkDerivation (finalAttrs: { pname = "hyprwayland-scanner"; - version = "0.3.4"; + version = "0.3.10"; src = fetchFromGitHub { owner = "hyprwm"; repo = "hyprwayland-scanner"; rev = "v${finalAttrs.version}"; - hash = "sha256-D0pg+ZRwrt4lavZ97Ca8clsgbPA3duLj8iEM7riaIFY="; + hash = "sha256-YxmfxHfWed1fosaa7fC1u7XoKp1anEZU+7Lh/ojRKoM="; }; nativeBuildInputs = [ @@ -28,12 +29,15 @@ stdenv.mkDerivation (finalAttrs: { doCheck = true; - meta = with lib; { + passthru.updateScript = nix-update-script { }; + + meta = { homepage = "https://github.com/hyprwm/hyprwayland-scanner"; description = "Hyprland version of wayland-scanner in and for C++"; - license = licenses.bsd3; - maintainers = with maintainers; [ fufexan ]; + changelog = "https://github.com/hyprwm/hyprwayland-scanner/releases/tag/${finalAttrs.version}"; + license = lib.licenses.bsd3; + maintainers = with lib.maintainers; [ fufexan ]; mainProgram = "hyprwayland-scanner"; - platforms = platforms.linux; + platforms = lib.platforms.linux; }; }) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 1b34af551f4b..ef7386329408 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -5502,8 +5502,6 @@ with pkgs; hypr = callPackage ../applications/window-managers/hyprwm/hypr { cairo = cairo.override { xcbSupport = true; }; }; - hyprland = callPackage ../applications/window-managers/hyprwm/hyprland { }; - hyprland-autoname-workspaces = callPackage ../applications/misc/hyprland-autoname-workspaces { }; hyprland-per-window-layout = callPackage ../tools/wayland/hyprland-per-window-layout { }; @@ -5516,7 +5514,7 @@ with pkgs; hyprshade = python311Packages.callPackage ../applications/window-managers/hyprwm/hyprshade { }; - hyprlandPlugins = recurseIntoAttrs (callPackage ../applications/window-managers/hyprwm/hyprland/plugins.nix { }); + hyprlandPlugins = recurseIntoAttrs (callPackage ../applications/window-managers/hyprwm/hyprland-plugins { }); hysteria = callPackage ../tools/networking/hysteria { };