2022-07-09 19:08:52 +03:00
|
|
|
{ lib, stdenv, fetchFromGitHub, makeWrapper
|
2022-07-10 23:25:47 +03:00
|
|
|
, xorg, imlib2, libjpeg, libpng
|
2021-02-24 22:53:45 +03:00
|
|
|
, curl, libexif, jpegexiforient, perl
|
2020-10-17 22:43:09 +03:00
|
|
|
, enableAutoreload ? !stdenv.hostPlatform.isDarwin }:
|
2007-03-05 16:44:27 +03:00
|
|
|
|
2013-01-22 17:51:28 +04:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 15:41:18 +03:00
|
|
|
pname = "feh";
|
2022-07-09 19:08:52 +03:00
|
|
|
version = "3.9";
|
2007-03-05 16:44:27 +03:00
|
|
|
|
2022-07-09 19:08:52 +03:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "derf";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
|
|
|
sha256 = "sha256-rgNC4M1TJ5EPeWmVHVzgaxTGLY7CYQf7uOsOn5bkwKE=";
|
2007-03-05 16:44:27 +03:00
|
|
|
};
|
|
|
|
|
2022-07-10 23:25:47 +03: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-09 19:08:52 +03:00
|
|
|
|
2017-06-17 20:06:20 +03:00
|
|
|
outputs = [ "out" "man" "doc" ];
|
2015-10-11 22:38:03 +03:00
|
|
|
|
2023-04-14 00:04:15 +03:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
2010-06-03 18:41:41 +04:00
|
|
|
|
2023-04-14 00:04:15 +03:00
|
|
|
buildInputs = [ xorg.libXt xorg.libX11 xorg.libXinerama imlib2 libjpeg libpng curl libexif ];
|
2016-09-09 15:16:34 +03:00
|
|
|
|
2018-03-04 17:17:12 +03:00
|
|
|
makeFlags = [
|
2019-02-12 04:43:25 +03:00
|
|
|
"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
|
|
|
|
2019-02-12 04:43:25 +03:00
|
|
|
installTargets = [ "install" ];
|
2014-02-16 17:08:48 +04:00
|
|
|
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'
|
|
|
|
'';
|
|
|
|
|
2023-01-21 15:00:00 +03:00
|
|
|
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; {
|
2007-03-05 16:44:27 +03:00
|
|
|
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;
|
2019-12-26 17:13:48 +03:00
|
|
|
maintainers = with maintainers; [ viric willibutz globin ma27 ];
|
2017-03-19 02:10:44 +03:00
|
|
|
platforms = platforms.unix;
|
2007-03-05 16:44:27 +03:00
|
|
|
};
|
|
|
|
}
|