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

61 lines
1.3 KiB
Nix
Raw Normal View History

2021-01-14 11:38:33 +00:00
{ stdenv
, lib
2021-04-13 11:01:18 +00:00
, fetchFromSourcehut
2021-01-14 11:38:33 +00:00
, meson
, ninja
, pkg-config
, wrapGAppsHook
, epoxy
, gtk4
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";
version = "1.0.1";
2021-01-14 11:38:33 +00:00
2021-04-13 11:01:18 +00:00
src = fetchFromSourcehut {
owner = "~martijnbraam";
repo = "megapixels";
2021-01-14 11:38:33 +00:00
rev = version;
sha256 = "0k9a5dpr5z0g7ngbhk4j22sbs1ffxiwg8wmbzgggdc9xvwmkgppr";
2021-01-14 11:38:33 +00:00
};
nativeBuildInputs = [ meson ninja pkg-config wrapGAppsHook ];
buildInputs = [
epoxy
gtk4
zbar
];
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";
2021-04-13 11:01:18 +00:00
changelog = "https://git.sr.ht/~martijnbraam/megapixels/refs/${version}";
2021-01-14 11:38:33 +00:00
license = licenses.gpl3Only;
maintainers = with maintainers; [ OPNA2608 dotlambda ];
2021-01-14 11:38:33 +00:00
platforms = platforms.linux;
};
}