2023-06-29 02:31:03 +02:00
|
|
|
{ pkgs ? import <nixpkgs> { }
|
|
|
|
, local ? false
|
|
|
|
, full ? true
|
2023-06-30 02:33:55 +02:00
|
|
|
, withResvg ? false
|
2023-06-29 02:31:03 +02:00
|
|
|
}:
|
|
|
|
pkgs.stdenv.mkDerivation rec {
|
|
|
|
pname = "fiv";
|
|
|
|
version = "master";
|
|
|
|
|
|
|
|
nativeBuildInputs = with pkgs; [
|
2023-06-29 20:32:43 +02:00
|
|
|
wrapGAppsHook
|
2023-06-29 02:31:03 +02:00
|
|
|
meson
|
|
|
|
pkg-config
|
|
|
|
ninja
|
|
|
|
libxml2
|
|
|
|
jq
|
|
|
|
|
|
|
|
# Tests
|
|
|
|
desktop-file-utils
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = with pkgs; [
|
|
|
|
gtk3
|
|
|
|
libwebp
|
|
|
|
libraw
|
|
|
|
|
|
|
|
# WIP
|
|
|
|
libepoxy
|
|
|
|
] ++ lib.optionals full [
|
|
|
|
lcms2
|
|
|
|
librsvg
|
|
|
|
libheif
|
2023-06-30 02:33:55 +02:00
|
|
|
] ++ lib.optionals withResvg [
|
|
|
|
resvg
|
2023-06-29 02:31:03 +02:00
|
|
|
];
|
|
|
|
|
|
|
|
src = if local then
|
|
|
|
builtins.path {
|
|
|
|
path = ../${pname}/git;
|
|
|
|
name = "${pname}";
|
|
|
|
}
|
|
|
|
else
|
|
|
|
fetchGit {
|
|
|
|
url = "https://git.janouch.name/p/${pname}.git";
|
|
|
|
submodules = true;
|
|
|
|
ref = "master";
|
|
|
|
};
|
|
|
|
|
|
|
|
# Up for consideration: don't rely on shebangs at all.
|
|
|
|
patchPhase = ''
|
|
|
|
patchShebangs .
|
2023-06-29 20:32:43 +02:00
|
|
|
|
|
|
|
# https://gitlab.gnome.org/GNOME/glib/-/issues/30240
|
|
|
|
ulimit -n 8192
|
2023-06-29 02:31:03 +02:00
|
|
|
'';
|
|
|
|
|
|
|
|
mesonFlags = [
|
|
|
|
# -Dauto_features=enabled & -Dwrap_mode=nodownload & no network
|
|
|
|
# together form a problem.
|
|
|
|
"-Dlibjpegqs=disabled"
|
|
|
|
"-Dlcms2fastfloat=disabled"
|
|
|
|
|
|
|
|
"-Dtools=enabled"
|
|
|
|
] ++ pkgs.lib.optionals (!full) [
|
|
|
|
"-Dlcms2=disabled"
|
|
|
|
"-Dlibraw=disabled"
|
|
|
|
"-Dresvg=disabled"
|
|
|
|
"-Dlibrsvg=disabled"
|
|
|
|
"-Dxcursor=disabled"
|
|
|
|
"-Dlibheif=disabled"
|
|
|
|
"-Dlibtiff=disabled"
|
|
|
|
"-Dgdk-pixbuf=disabled"
|
2023-06-30 02:33:55 +02:00
|
|
|
] ++ pkgs.lib.optionals withResvg [
|
|
|
|
"-Dresvg=enabled"
|
2023-06-29 02:31:03 +02:00
|
|
|
];
|
|
|
|
|
2023-06-29 20:32:43 +02:00
|
|
|
preFixup = ''
|
|
|
|
gappsWrapperArgs+=(
|
|
|
|
--prefix PATH : $out/bin:${pkgs.lib.makeBinPath [ pkgs.exiftool ]}
|
|
|
|
)
|
|
|
|
'';
|
|
|
|
|
2023-06-29 02:31:03 +02:00
|
|
|
doCheck = true;
|
|
|
|
|
|
|
|
meta = with pkgs.lib; {
|
|
|
|
description = "Image browser and viewer";
|
|
|
|
homepage = "https://git.janouch.name/p/${pname}";
|
|
|
|
platforms = platforms.all;
|
|
|
|
license = with licenses; [ bsd0 asl20 ];
|
|
|
|
};
|
|
|
|
}
|