nixexprs/fiv-master.nix

99 lines
1.9 KiB
Nix
Raw Normal View History

2023-06-29 02:31:03 +02:00
{ pkgs ? import <nixpkgs> { }
, local ? false
, full ? true
, withResvg ? false
2023-06-29 02:31:03 +02:00
}:
pkgs.stdenv.mkDerivation rec {
pname = "fiv";
version = "master";
nativeBuildInputs = with pkgs; [
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
] ++ 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 .
# 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"
] ++ 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.
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"
--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 ];
};
}