Unverified Commit f5c534ce authored by Matthew Croughan's avatar Matthew Croughan Committed by GitHub
Browse files

wayland-bongocat: packaging fixes (#452723)

parents 63c8d131 67ba706d
Loading
Loading
Loading
Loading
+23 −6
Original line number Diff line number Diff line
{
  lib,
  stdenv,
  bash,
  fetchFromGitHub,
  gitUpdater,
  pkg-config,
  wayland,
  wayland-protocols,
@@ -25,17 +27,21 @@ stdenv.mkDerivation (finalAttrs: {
    wayland-scanner
  ];
  buildInputs = [
    bash
    wayland
    wayland-protocols
  ];

  # Build phases
  # Ensure that the Makefile has the correct directory with the Wayland protocols
  preBuild = ''
    export WAYLAND_PROTOCOLS_DIR="${wayland-protocols}/share/wayland-protocols"
  makeFlags = [
    "WAYLAND_PROTOCOLS_DIR=${wayland-protocols}/share/wayland-protocols"
    "release"
  ];

  postPatch = ''
    substituteInPlace Makefile \
      --replace-fail 'CC = gcc' 'CC ?= gcc'
  '';

  makeFlags = [ "release" ];
  installPhase = ''
    runHook preInstall

@@ -49,7 +55,18 @@ stdenv.mkDerivation (finalAttrs: {
  doInstallCheck = true;
  nativeInstallCheckInputs = [ versionCheckHook ];

  # Package information
  installCheckPhase = ''
    runHook preInstallCheck

    $out/bin/bongocat-find-devices --help

    runHook postInstallCheck
  '';

  passthru.updateScript = gitUpdater {
    rev-prefix = "v";
  };

  meta = {
    description = "Delightful Wayland overlay that displays an animated bongo cat reacting to keyboard input";
    homepage = "https://github.com/saatvik333/wayland-bongocat";