Unverified Commit 82d8a960 authored by Pol Dellaiera's avatar Pol Dellaiera Committed by GitHub
Browse files

projecteur: add `versionCheckHook` (#459438)

parents 1dbfbb2d a0e4d5fa
Loading
Loading
Loading
Loading
+9 −10
Original line number Diff line number Diff line
{
  lib,
  mkDerivation,
  stdenv,
  fetchFromGitHub,
  cmake,
  pkg-config,
@@ -8,24 +8,21 @@
  qtgraphicaleffects,
  wrapQtAppsHook,
  udevCheckHook,
  versionCheckHook,
}:

mkDerivation rec {
stdenv.mkDerivation (finalAttrs: {
  pname = "projecteur";
  version = "0.10";

  src = fetchFromGitHub {
    owner = "jahnf";
    repo = "Projecteur";
    rev = "v${version}";
    tag = "v${finalAttrs.version}";
    fetchSubmodules = false;
    hash = "sha256-F7o93rBjrDTmArTIz8RB/uGBOYE6ny/U7ppk+jEhM5A=";
  };

  postPatch = ''
    sed '1i#include <array>' -i src/device.h # gcc12
  '';

  buildInputs = [
    qtbase
    qtgraphicaleffects
@@ -38,14 +35,16 @@ mkDerivation rec {
    udevCheckHook
  ];

  doInstallCheck = true;

  cmakeFlags = [
    "-DCMAKE_INSTALL_PREFIX:PATH=${placeholder "out"}"
    "-DPACKAGE_TARGETS=OFF"
    "-DCMAKE_INSTALL_UDEVRULESDIR=${placeholder "out"}/lib/udev/rules.d"
  ];

  doInstallCheck = true;
  nativeInstallCheckInputs = [ versionCheckHook ];
  versionCheckProgramArg = "--version";

  meta = {
    description = "Linux/X11 application for the Logitech Spotlight device (and similar devices)";
    homepage = "https://github.com/jahnf/Projecteur";
@@ -56,4 +55,4 @@ mkDerivation rec {
    ];
    platforms = lib.platforms.linux;
  };
}
})