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