Unverified Commit 0c045f66 authored by Pol Dellaiera's avatar Pol Dellaiera Committed by GitHub
Browse files

Merge pull request #246444 from justinlime/farge-fix

farge: fix dependencies & font issue
parents 8767a672 d78c7243
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -8460,6 +8460,12 @@
    githubId = 662666;
    name = "Justinas Stankevičius";
  };
  justinlime = {
    email = "justinlime1999@gmail.com";
    github = "justinlime";
    githubId = 119710965;
    name = "Justin Fields";
  };
  justinlovinger = {
    email = "git@justinlovinger.com";
    github = "JustinLovinger";
+16 −5
Original line number Diff line number Diff line
{ lib
, stdenv
, fetchFromGitHub
, bash
, makeBinaryWrapper
, bc
, libnotify
, feh
, grim
, imagemagick
@@ -24,14 +25,24 @@ stdenv.mkDerivation (finalAttrs: {
    hash = "sha256-vCMuFMGcI4D4EzbSsXeNGKNS6nBFkfTcAmSzb9UMArc=";
  };

  buildInputs = [ bash bc feh imagemagick ]
    ++ lib.optionals waylandSupport [ grim slurp wl-clipboard ]
    ++ lib.optionals x11Support [ xcolor ];
  nativeBuildInputs = [ makeBinaryWrapper ];

  # Ensure the following programs are found within $PATH
  wrapperPath = lib.makeBinPath ([
    bc
    feh
    #Needed to fix convert: unable to read font `(null)' @ error/annotate.c/RenderFreetype issue
    (imagemagick.override { ghostscriptSupport = true;})
    libnotify #Needed for the notify-send function call from the script
  ] ++ lib.optionals waylandSupport [ grim slurp wl-clipboard ]
    ++ lib.optionals x11Support [ xcolor ]);

  installPhase = ''
    runHook preInstall
    mkdir -p $out/bin
    install -m755 farge $out/bin
    wrapProgram $out/bin/farge \
        --prefix PATH : "${finalAttrs.wrapperPath}"
    runHook postInstall
  '';

@@ -40,7 +51,7 @@ stdenv.mkDerivation (finalAttrs: {
    homepage = "https://github.com/sdushantha/farge";
    license = licenses.mit;
    platforms = platforms.all;
    maintainers = with maintainers; [ jtbx ];
    maintainers = with maintainers; [ jtbx justinlime ];
    mainProgram = "farge";
  };
})