farge: fix dependencies & font issue

This commit is contained in:
justinlime 2023-07-31 17:01:50 -05:00
parent 9f51c70b4f
commit d78c7243b3

View file

@ -1,8 +1,9 @@
{ lib { lib
, stdenv , stdenv
, fetchFromGitHub , fetchFromGitHub
, bash , makeBinaryWrapper
, bc , bc
, libnotify
, feh , feh
, grim , grim
, imagemagick , imagemagick
@ -24,14 +25,24 @@ stdenv.mkDerivation (finalAttrs: {
hash = "sha256-vCMuFMGcI4D4EzbSsXeNGKNS6nBFkfTcAmSzb9UMArc="; hash = "sha256-vCMuFMGcI4D4EzbSsXeNGKNS6nBFkfTcAmSzb9UMArc=";
}; };
buildInputs = [ bash bc feh imagemagick ] nativeBuildInputs = [ makeBinaryWrapper ];
++ lib.optionals waylandSupport [ grim slurp wl-clipboard ]
++ lib.optionals x11Support [ xcolor ]; # 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 = '' installPhase = ''
runHook preInstall runHook preInstall
mkdir -p $out/bin mkdir -p $out/bin
install -m755 farge $out/bin install -m755 farge $out/bin
wrapProgram $out/bin/farge \
--prefix PATH : "${finalAttrs.wrapperPath}"
runHook postInstall runHook postInstall
''; '';
@ -40,7 +51,7 @@ stdenv.mkDerivation (finalAttrs: {
homepage = "https://github.com/sdushantha/farge"; homepage = "https://github.com/sdushantha/farge";
license = licenses.mit; license = licenses.mit;
platforms = platforms.all; platforms = platforms.all;
maintainers = with maintainers; [ jtbx ]; maintainers = with maintainers; [ jtbx justinlime ];
mainProgram = "farge"; mainProgram = "farge";
}; };
}) })