nixpkgs/pkgs/applications/graphics/feh/default.nix
Andy Tockman 612b7f71a0 feh: add enableAutoreload option
This change enables the inotify-based auto-reload feature of feh, which
causes images to be refreshed when the image file changes.
2020-06-16 19:48:50 -05:00

52 lines
1.4 KiB
Nix

{ stdenv, fetchurl, makeWrapper
, xorg, imlib2, libjpeg, libpng
, curl, libexif, jpegexiforient, perlPackages
, enableAutoreload ? true }:
with stdenv.lib;
stdenv.mkDerivation rec {
pname = "feh";
version = "3.4.1";
src = fetchurl {
url = "https://feh.finalrewind.org/${pname}-${version}.tar.bz2";
sha256 = "0yvvj1s7ayn0lwils582smwkmckdk0gij5c58g45n4xh981n693q";
};
outputs = [ "out" "man" "doc" ];
nativeBuildInputs = [ makeWrapper xorg.libXt ];
buildInputs = [ xorg.libX11 xorg.libXinerama imlib2 libjpeg libpng curl libexif ];
makeFlags = [
"PREFIX=${placeholder "out"}" "exif=1"
] ++ optional stdenv.isDarwin "verscmp=0"
++ optional enableAutoreload "inotify=1";
installTargets = [ "install" ];
postInstall = ''
wrapProgram "$out/bin/feh" --prefix PATH : "${makeBinPath [ libjpeg jpegexiforient ]}" \
--add-flags '--theme=feh'
'';
checkInputs = [ perlPackages.perl perlPackages.TestCommand ];
preCheck = ''
export PERL5LIB="${perlPackages.TestCommand}/${perlPackages.perl.libPrefix}"
'';
postCheck = ''
unset PERL5LIB
'';
doCheck = true;
meta = {
description = "A light-weight image viewer";
homepage = "https://feh.finalrewind.org/";
license = licenses.mit;
maintainers = with maintainers; [ viric willibutz globin ma27 ];
platforms = platforms.unix;
};
}