depot/third_party/nixpkgs/pkgs/applications/graphics/megapixels/default.nix
Default email a66bca1520 Project import generated by Copybara.
GitOrigin-RevId: 40f79f003b6377bd2f4ed4027dde1f8f922995dd
2022-12-17 11:02:37 +01:00

75 lines
1.4 KiB
Nix

{ stdenv
, lib
, fetchFromGitLab
, glib
, meson
, ninja
, pkg-config
, wrapGAppsHook4
, feedbackd
, gtk4
, libepoxy
, xorg
, zbar
, tiffSupport ? true
, libraw
, jpgSupport ? true
, graphicsmagick
, exiftool
}:
assert jpgSupport -> tiffSupport;
let
inherit (lib) makeBinPath optional optionals optionalString;
runtimePath = makeBinPath (
optional tiffSupport libraw
++ optionals jpgSupport [ graphicsmagick exiftool ]
);
in
stdenv.mkDerivation rec {
pname = "megapixels";
version = "1.6.0";
src = fetchFromGitLab {
owner = "postmarketOS";
repo = "megapixels";
rev = version;
hash = "sha256-xrO9Xr9DPjlDs4yaKy32yb4X8wFqLKfy8rsjtBuN+Rg=";
};
nativeBuildInputs = [
glib
meson
ninja
pkg-config
wrapGAppsHook4
];
buildInputs = [
feedbackd
gtk4
libepoxy
xorg.libXrandr
zbar
];
postInstall = ''
glib-compile-schemas $out/share/glib-2.0/schemas
'';
preFixup = optionalString (tiffSupport || jpgSupport) ''
gappsWrapperArgs+=(
--prefix PATH : ${lib.escapeShellArg runtimePath}
)
'';
meta = with lib; {
description = "GTK4 camera application that knows how to deal with the media request api";
homepage = "https://gitlab.com/postmarketOS/megapixels";
changelog = "https://gitlab.com/postmarketOS/megapixels/-/tags/${version}";
license = licenses.gpl3Only;
maintainers = with maintainers; [ OPNA2608 dotlambda ];
platforms = platforms.linux;
};
}