about summary refs log tree commit diff
path: root/pkgs/by-name/hy
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/by-name/hy')
-rw-r--r--pkgs/by-name/hy/hyprland/info.json7
-rw-r--r--pkgs/by-name/hy/hyprland/package.nix195
-rwxr-xr-xpkgs/by-name/hy/hyprland/update.sh35
-rw-r--r--pkgs/by-name/hy/hyprutils/package.nix35
-rw-r--r--pkgs/by-name/hy/hyprwayland-scanner/package.nix16
5 files changed, 282 insertions, 6 deletions
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/by-name/hy/hyprland/package.nix b/pkgs/by-name/hy/hyprland/package.nix
new file mode 100644
index 000000000000..ae3e38de9a6c
--- /dev/null
+++ b/pkgs/by-name/hy/hyprland/package.nix
@@ -0,0 +1,195 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, pkg-config
+, makeWrapper
+, meson
+, cmake
+, ninja
+, 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
+, tomlplusplus
+, wayland
+, wayland-protocols
+, wayland-scanner
+, xwayland
+, hwdata
+, seatd
+, libdisplay-info
+, libliftoff
+, xorg
+, debug ? false
+, enableXWayland ? true
+, legacyRenderer ? false
+, withSystemd ? lib.meta.availableOn stdenv.hostPlatform systemd
+, wrapRuntimeDeps ? true
+  # deprecated flags
+, nvidiaPatches ? false
+, 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.41.1";
+
+  src = fetchFromGitHub {
+    owner = "hyprwm";
+    repo = finalAttrs.pname;
+    fetchSubmodules = true;
+    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
+  '';
+
+  # 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
+    pkg-config
+  ];
+
+  nativeBuildInputs = [
+    hwdata
+    hyprwayland-scanner
+    jq
+    makeWrapper
+    cmake
+    meson # for wlroots
+    ninja
+    pkg-config
+    wayland-scanner
+    python3 # for udis86
+  ];
+
+  outputs = [
+    "out"
+    "man"
+    "dev"
+  ];
+
+  buildInputs = [
+    cairo
+    expat
+    fribidi
+    git
+    hyprcursor.dev
+    hyprland-protocols
+    hyprlang
+    hyprutils
+    libGL
+    libdatrie
+    libdrm
+    libinput
+    libselinux
+    libsepol
+    libthai
+    libuuid
+    libxkbcommon
+    mesa
+    wayland
+    wayland-protocols
+    pango
+    pciutils
+    pcre2
+    tomlplusplus
+    # for subproject wlroots-hyprland
+    seatd
+    libliftoff
+    libdisplay-info
+    xorg.xcbutilerrors
+    xorg.xcbutilrenderutil
+  ]
+  ++ lib.optionals stdenv.hostPlatform.isBSD [ epoll-shim ]
+  ++ lib.optionals stdenv.hostPlatform.isMusl [ libexecinfo ]
+  ++ lib.optionals enableXWayland [
+    xorg.libxcb
+    xorg.libXdmcp
+    xorg.xcbutil
+    xorg.xcbutilwm
+    xwayland
+  ]
+  ++ lib.optionals withSystemd [ systemd ];
+
+  cmakeBuildType =
+    if debug
+    then "Debug"
+    else "RelWithDebInfo";
+
+
+  cmakeFlags = [
+    (lib.cmakeBool "NO_XWAYLAND" (!enableXWayland))
+    (lib.cmakeBool "LEGACY_RENDERER" legacyRenderer)
+    (lib.cmakeBool "NO_SYSTEMD" (!withSystemd))
+  ];
+
+  postInstall = ''
+    ${lib.optionalString wrapRuntimeDeps ''
+      wrapProgram $out/bin/Hyprland \
+        --suffix PATH : ${lib.makeBinPath [binutils pciutils pkgconf]}
+    ''}
+  '';
+
+  passthru.providedSessions = [ "hyprland" ];
+
+  passthru.updateScript = ./update.sh;
+
+  meta = {
+    homepage = "https://github.com/hyprwm/Hyprland";
+    description = "Dynamic tiling Wayland compositor that doesn't sacrifice on its looks";
+    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;
   };
 })