nixpkgs/pkgs/applications/graphics/feh/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

53 lines
1.6 KiB
Nix
Raw Normal View History

{ lib, stdenv, fetchFromGitHub, makeWrapper
, xorg, imlib2, libjpeg, libpng
, curl, libexif, jpegexiforient, perl
, enableAutoreload ? !stdenv.hostPlatform.isDarwin }:
stdenv.mkDerivation rec {
pname = "feh";
version = "3.9";
src = fetchFromGitHub {
owner = "derf";
repo = pname;
rev = version;
sha256 = "sha256-rgNC4M1TJ5EPeWmVHVzgaxTGLY7CYQf7uOsOn5bkwKE=";
};
postPatch = ''
substituteInPlace test/feh.t \
--replace "WARNING:" "WARNING: While loading" \
--replace "Does not look like an image \(magic bytes missing\)" "Unknown error \(15\)"
'';
2017-06-17 20:06:20 +03:00
outputs = [ "out" "man" "doc" ];
nativeBuildInputs = [ makeWrapper ];
buildInputs = [ xorg.libXt xorg.libX11 xorg.libXinerama imlib2 libjpeg libpng curl libexif ];
2018-03-04 17:17:12 +03:00
makeFlags = [
"PREFIX=${placeholder "out"}" "exif=1"
2022-01-28 17:23:25 +03:00
] ++ lib.optional stdenv.isDarwin "verscmp=0"
++ lib.optional enableAutoreload "inotify=1";
2017-06-17 20:06:20 +03:00
installTargets = [ "install" ];
postInstall = ''
2022-01-28 17:23:25 +03:00
wrapProgram "$out/bin/feh" --prefix PATH : "${lib.makeBinPath [ libjpeg jpegexiforient ]}" \
2017-06-17 20:06:20 +03:00
--add-flags '--theme=feh'
'';
nativeCheckInputs = lib.singleton (perl.withPackages (p: [ p.TestCommand ]));
2016-05-31 14:48:40 +03:00
doCheck = true;
2022-01-28 17:23:25 +03:00
meta = with lib; {
description = "A light-weight image viewer";
2017-09-10 22:25:26 +03:00
homepage = "https://feh.finalrewind.org/";
2022-01-28 17:23:25 +03:00
# released under a variant of the MIT license
# https://spdx.org/licenses/MIT-feh.html
license = licenses.mit-feh;
maintainers = with maintainers; [ viric willibutz globin ma27 ];
2017-03-19 02:10:44 +03:00
platforms = platforms.unix;
};
}