Unverified Commit 9fd89c03 authored by Masum Reza's avatar Masum Reza Committed by GitHub
Browse files

hyprland: 0.43.0 -> 0.44.0, hyprpicker: 0.3.0 -> 0.4.1 (#346906)

parents eb9f4a34 95bdf20d
Loading
Loading
Loading
Loading
+28 −36
Original line number Diff line number Diff line
{ lib
, stdenv
, fetchFromGitHub
, pkg-config
, cmake
, ninja
, cairo
, fribidi
, libGL
, libdatrie
, libjpeg
, libselinux
, libsepol
, libthai
, libxkbcommon
, pango
, pcre
, util-linux
, wayland
, wayland-protocols
, wayland-scanner
, libXdmcp
, debug ? false
{
  lib,
  stdenv,
  fetchFromGitHub,
  nix-update-script,
  pkg-config,
  cmake,
  cairo,
  hyprutils,
  hyprwayland-scanner,
  libGL,
  libjpeg,
  libxkbcommon,
  pango,
  wayland,
  wayland-protocols,
  wayland-scanner,
  libXdmcp,
  debug ? false,
}:
stdenv.mkDerivation (finalAttrs: {
  pname = "hyprpicker" + lib.optionalString debug "-debug";
  version = "0.3.0";
  version = "0.4.1";

  src = fetchFromGitHub {
    owner = "hyprwm";
    repo = "hyprpicker";
    rev = "v${finalAttrs.version}";
    hash = "sha256-BYQF1zM6bJ44ag9FJ0aTSkhOTY9U7uRdp3SmRCs5fJM=";
    hash = "sha256-gu26MSYbTlRLMUpZ9PeYXtqqhzPDQXxEDkjiJgwzIIc=";
  };

  cmakeBuildType = if debug then "Debug" else "Release";

  nativeBuildInputs = [
    cmake
    ninja
    hyprwayland-scanner
    pkg-config
  ];

  buildInputs = [
    cairo
    fribidi
    hyprutils
    libGL
    libdatrie
    libjpeg
    libselinux
    libsepol
    libthai
    libxkbcommon
    pango
    pcre
    wayland
    wayland-protocols
    wayland-scanner
    libXdmcp
    util-linux
  ];

  postInstall = ''
@@ -65,11 +55,13 @@ stdenv.mkDerivation (finalAttrs: {
    install -Dm644 $src/LICENSE -t $out/share/licenses/hyprpicker
  '';

  meta = with lib; {
  passthru.updateScript = nix-update-script { };

  meta = {
    description = "Wlroots-compatible Wayland color picker that does not suck";
    homepage = "https://github.com/hyprwm/hyprpicker";
    license = licenses.bsd3;
    maintainers = with maintainers; [ fufexan ];
    license = lib.licenses.bsd3;
    maintainers = with lib.maintainers; [ fufexan ];
    platforms = wayland.meta.platforms;
    mainProgram = "hyprpicker";
  };
+66 −33
Original line number Diff line number Diff line
{
  lib,
  stdenv,
  stdenvAdapters,
  fetchFromGitHub,
  pkg-config,
  makeWrapper,
  cmake,
  meson,
  ninja,
  aquamarine,
  binutils,
@@ -15,7 +17,6 @@
  hyprlang,
  hyprutils,
  hyprwayland-scanner,
  jq,
  libGL,
  libdrm,
  libexecinfo,
@@ -45,30 +46,52 @@
  enableNvidiaPatches ? false,
}:
let
  info = builtins.fromJSON (builtins.readFile ./info.json);
  inherit (builtins)
    foldl'
    ;
  inherit (lib.asserts) assertMsg;
  inherit (lib.attrsets) mapAttrsToList;
  inherit (lib.lists)
    concatLists
    optionals
    ;
  inherit (lib.strings)
    makeBinPath
    optionalString
    mesonBool
    mesonEnable
    ;
  inherit (lib.trivial)
    importJSON
    ;

  info = importJSON ./info.json;

  # possibility to add more adapters in the future, such as keepDebugInfo,
  # which would be controlled by the `debug` flag
  adapters = [
    stdenvAdapters.useMoldLinker
  ];

  customStdenv = foldl' (acc: adapter: adapter acc) stdenv adapters;
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)
assert assertMsg (!nvidiaPatches) "The option `nvidiaPatches` has been removed.";
assert assertMsg (!enableNvidiaPatches) "The option `enableNvidiaPatches` has been removed.";
assert 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.43.0";
customStdenv.mkDerivation (finalAttrs: {
  pname = "hyprland" + optionalString debug "-debug";
  version = "0.44.0";

  src = fetchFromGitHub {
    owner = "hyprwm";
    repo = "hyprland";
    fetchSubmodules = true;
    rev = "refs/tags/v${finalAttrs.version}";
    hash = "sha256-+wE97utoDfhQP6AMdZHUmBeL8grbce/Jv2i5M+6AbaE=";
    hash = "sha256-XgDhPx+tKs+2lyWM/ZqIHnMArd/c0LGmwAwu0EG1uJM=";
  };

  patches = [
    # forces GCC to use -std=c++26 on CMake < 3.30
    "${finalAttrs.src}/nix/stdcxx.patch"
  ];

  postPatch = ''
    # Fix hardcoded paths to /usr installation
    sed -i "s#/usr#$out#" src/render/OpenGL.cpp
@@ -93,13 +116,14 @@ stdenv.mkDerivation (finalAttrs: {

  nativeBuildInputs = [
    hyprwayland-scanner
    jq
    makeWrapper
    cmake
    meson
    ninja
    pkg-config
    python3 # for udis86
    wayland-scanner
    # for udis86
    cmake
    python3
  ];

  outputs = [
@@ -108,7 +132,7 @@ stdenv.mkDerivation (finalAttrs: {
    "dev"
  ];

  buildInputs =
  buildInputs = concatLists [
    [
      aquamarine
      cairo
@@ -129,32 +153,40 @@ stdenv.mkDerivation (finalAttrs: {
      wayland-protocols
      xorg.libXcursor
    ]
    ++ lib.optionals stdenv.hostPlatform.isBSD [ epoll-shim ]
    ++ lib.optionals stdenv.hostPlatform.isMusl [ libexecinfo ]
    ++ lib.optionals enableXWayland [
    (optionals customStdenv.hostPlatform.isBSD [ epoll-shim ])
    (optionals customStdenv.hostPlatform.isMusl [ libexecinfo ])
    (optionals enableXWayland [
      xorg.libxcb
      xorg.libXdmcp
      xorg.xcbutilerrors
      xorg.xcbutilwm
      xwayland
    ]
    ++ lib.optionals withSystemd [ systemd ];
    ])
    (optionals withSystemd [ systemd ])
  ];

  cmakeBuildType = if debug then "Debug" else "RelWithDebInfo";
  mesonBuildType = if debug then "debugoptimized" else "release";

  dontStrip = debug;

  cmakeFlags = [
    (lib.cmakeBool "NO_XWAYLAND" (!enableXWayland))
    (lib.cmakeBool "LEGACY_RENDERER" legacyRenderer)
    (lib.cmakeBool "NO_SYSTEMD" (!withSystemd))
  mesonFlags = concatLists [
    (mapAttrsToList mesonEnable {
      "xwayland" = enableXWayland;
      "legacy_renderer" = legacyRenderer;
      "systemd" = withSystemd;
    })
    (mapAttrsToList mesonBool {
      # PCH provides no benefits when building with Nix
      "b_pch" = false;
      "tracy_enable" = false;
    })
  ];

  postInstall = ''
    ${lib.optionalString wrapRuntimeDeps ''
    ${optionalString wrapRuntimeDeps ''
      wrapProgram $out/bin/Hyprland \
        --suffix PATH : ${
          lib.makeBinPath [
          makeBinPath [
            binutils
            pciutils
            pkgconf
@@ -163,9 +195,10 @@ stdenv.mkDerivation (finalAttrs: {
    ''}
  '';

  passthru.providedSessions = [ "hyprland" ];

  passthru.updateScript = ./update.sh;
  passthru = {
    providedSessions = [ "hyprland" ];
    updateScript = ./update.sh;
  };

  meta = {
    homepage = "https://github.com/hyprwm/Hyprland";