nixpkgs/pkgs/applications/graphics/megapixels/default.nix

57 lines
1.2 KiB
Nix
Raw Normal View History

2021-01-14 11:38:33 +00:00
{ stdenv
, lib
, fetchgit
, meson
, ninja
, pkg-config
, wrapGAppsHook
, gtk3
, gnome3
2021-03-11 16:41:47 +00:00
, zbar
2021-01-14 11:38:33 +00:00
, tiffSupport ? true
, libraw
, jpgSupport ? true
2021-03-11 16:41:47 +00:00
, graphicsmagick
2021-01-14 11:38:33 +00:00
, exiftool
}:
assert jpgSupport -> tiffSupport;
let
inherit (lib) makeBinPath optional optionals optionalString;
runtimePath = makeBinPath (
optional tiffSupport libraw
2021-03-11 16:41:47 +00:00
++ optionals jpgSupport [ graphicsmagick exiftool ]
2021-01-14 11:38:33 +00:00
);
in
stdenv.mkDerivation rec {
pname = "megapixels";
2021-03-11 16:41:47 +00:00
version = "0.15.0";
2021-01-14 11:38:33 +00:00
src = fetchgit {
url = "https://git.sr.ht/~martijnbraam/megapixels";
rev = version;
2021-03-11 16:41:47 +00:00
sha256 = "1y8irwi8lbjs948j90gpic96dx5wjmwacd41hb3d9vzhkyni2dvb";
2021-01-14 11:38:33 +00:00
};
nativeBuildInputs = [ meson ninja pkg-config wrapGAppsHook ];
2021-03-11 16:41:47 +00:00
buildInputs = [ gtk3 gnome3.adwaita-icon-theme zbar ]
2021-01-14 11:38:33 +00:00
++ optional tiffSupport libraw
2021-03-11 16:41:47 +00:00
++ optional jpgSupport graphicsmagick;
2021-01-14 11:38:33 +00:00
preFixup = optionalString (tiffSupport || jpgSupport) ''
gappsWrapperArgs+=(
--prefix PATH : ${runtimePath}
)
'';
meta = with lib; {
description = "GTK3 camera application using raw v4l2 and media-requests";
homepage = "https://sr.ht/~martijnbraam/Megapixels";
license = licenses.gpl3Only;
maintainers = with maintainers; [ OPNA2608 ];
platforms = platforms.linux;
};
}