1 { lib, stdenv, fetchFromGitHub, makeWrapper, fetchpatch
2 , xorg, imlib2, libjpeg, libpng
3 , curl, libexif, jpegexiforient, perl
4 , enableAutoreload ? !stdenv.hostPlatform.isDarwin }:
6 stdenv.mkDerivation rec {
10 src = fetchFromGitHub {
14 hash = "sha256-1dz04RcaoP79EoE+SsatXm2wMRCbNnmAzMECYk3y3jg=";
18 # upstream PR: https://github.com/derf/feh/pull/723
20 name = "fix-right-click-buffer-overflow.patch";
21 url = "https://github.com/derf/feh/commit/2c31f8863b80030e772a529ade519fc2fee4a991.patch";
22 sha256 = "sha256-sUWS06qt1d1AyGfqKb+1BzZslYxOzur4q0ePEHcTz1g=";
26 outputs = [ "out" "man" "doc" ];
28 nativeBuildInputs = [ makeWrapper ];
30 buildInputs = [ xorg.libXt xorg.libX11 xorg.libXinerama imlib2 libjpeg libpng curl libexif ];
33 "PREFIX=${placeholder "out"}" "exif=1"
34 ] ++ lib.optional stdenv.isDarwin "verscmp=0"
35 ++ lib.optional enableAutoreload "inotify=1";
37 installTargets = [ "install" ];
39 wrapProgram "$out/bin/feh" --prefix PATH : "${lib.makeBinPath [ libjpeg jpegexiforient ]}" \
40 --add-flags '--theme=feh'
43 nativeCheckInputs = lib.singleton (perl.withPackages (p: [ p.TestCommand ]));
47 description = "A light-weight image viewer";
48 homepage = "https://feh.finalrewind.org/";
49 # released under a variant of the MIT license
50 # https://spdx.org/licenses/MIT-feh.html
51 license = licenses.mit-feh;
52 maintainers = with maintainers; [ viric willibutz globin ];
53 platforms = platforms.unix;