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; [
|
2024-01-11 18:26:06 +01:00
|
|
|
gnome.adwaita-icon-theme
|
2023-06-29 02:31:03 +02:00
|
|
|
gtk3
|
|
|
|
libwebp
|
|
|
|
libraw
|
2024-01-11 19:02:24 +01:00
|
|
|
shared-mime-info
|
2023-06-29 02:31:03 +02:00
|
|
|
|
|
|
|
# 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
|
|
|
];
|
|
|
|
|
2024-01-11 18:26:06 +01:00
|
|
|
# See nixpkgs commit b1e73fa2e086f1033a33d93524ae2a1781d12b95 about icons.
|
2024-01-11 19:02:24 +01:00
|
|
|
# It might make sense to name {hicolor,gnome.adwaita}-icon-theme/share
|
|
|
|
# explicitly, to limit undesired dependencies.
|
2023-06-29 20:32:43 +02:00
|
|
|
preFixup = ''
|
|
|
|
gappsWrapperArgs+=(
|
2024-01-11 18:26:06 +01:00
|
|
|
--prefix XDG_DATA_DIRS : "$XDG_ICON_DIRS"
|
2024-01-11 19:02:24 +01:00
|
|
|
--prefix XDG_DATA_DIRS : "${pkgs.shared-mime-info}/share"
|
2023-06-29 20:32:43 +02:00
|
|
|
--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 ];
|
|
|
|
};
|
|
|
|
}
|