2021-02-05 17:12:51 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
2021-12-06 16:07:01 +00:00
|
|
|
, fetchFromGitLab
|
|
|
|
, glib
|
2021-02-05 17:12:51 +00:00
|
|
|
, meson
|
|
|
|
, ninja
|
|
|
|
, pkg-config
|
2022-06-16 17:23:12 +00:00
|
|
|
, wrapGAppsHook4
|
2021-12-06 16:07:01 +00:00
|
|
|
, libepoxy
|
2021-05-20 23:08:51 +00:00
|
|
|
, gtk4
|
2021-03-12 07:09:13 +00:00
|
|
|
, zbar
|
2021-02-05 17:12:51 +00:00
|
|
|
, tiffSupport ? true
|
|
|
|
, libraw
|
|
|
|
, jpgSupport ? true
|
2021-03-12 07:09:13 +00:00
|
|
|
, graphicsmagick
|
2021-02-05 17:12:51 +00:00
|
|
|
, exiftool
|
|
|
|
}:
|
|
|
|
|
|
|
|
assert jpgSupport -> tiffSupport;
|
|
|
|
|
|
|
|
let
|
|
|
|
inherit (lib) makeBinPath optional optionals optionalString;
|
|
|
|
runtimePath = makeBinPath (
|
|
|
|
optional tiffSupport libraw
|
2021-03-12 07:09:13 +00:00
|
|
|
++ optionals jpgSupport [ graphicsmagick exiftool ]
|
2021-02-05 17:12:51 +00:00
|
|
|
);
|
|
|
|
in
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "megapixels";
|
2022-08-12 12:06:08 +00:00
|
|
|
version = "1.5.2";
|
2021-02-05 17:12:51 +00:00
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
src = fetchFromGitLab {
|
|
|
|
owner = "postmarketOS";
|
2021-04-13 19:44:15 +00:00
|
|
|
repo = "megapixels";
|
2021-02-05 17:12:51 +00:00
|
|
|
rev = version;
|
2022-08-12 12:06:08 +00:00
|
|
|
hash = "sha256-UH3NQdMlZTi4hc8HNSbCcQSm0rxI78RMCRYll1NCBO8=";
|
2021-02-05 17:12:51 +00:00
|
|
|
};
|
|
|
|
|
2021-09-18 10:52:07 +00:00
|
|
|
nativeBuildInputs = [
|
2021-12-06 16:07:01 +00:00
|
|
|
glib
|
2021-09-18 10:52:07 +00:00
|
|
|
meson
|
|
|
|
ninja
|
|
|
|
pkg-config
|
2022-06-16 17:23:12 +00:00
|
|
|
wrapGAppsHook4
|
2021-09-18 10:52:07 +00:00
|
|
|
];
|
2021-02-05 17:12:51 +00:00
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
buildInputs = [
|
2021-12-06 16:07:01 +00:00
|
|
|
libepoxy
|
2021-05-20 23:08:51 +00:00
|
|
|
gtk4
|
|
|
|
zbar
|
|
|
|
];
|
2021-02-05 17:12:51 +00:00
|
|
|
|
2021-09-18 10:52:07 +00:00
|
|
|
postInstall = ''
|
|
|
|
glib-compile-schemas $out/share/glib-2.0/schemas
|
|
|
|
'';
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
preFixup = optionalString (tiffSupport || jpgSupport) ''
|
|
|
|
gappsWrapperArgs+=(
|
2022-05-18 14:49:53 +00:00
|
|
|
--prefix PATH : ${lib.escapeShellArg runtimePath}
|
2021-02-05 17:12:51 +00:00
|
|
|
)
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
2021-08-06 21:57:35 +00:00
|
|
|
description = "GTK4 camera application that knows how to deal with the media request api";
|
2021-12-06 16:07:01 +00:00
|
|
|
homepage = "https://gitlab.com/postmarketOS/megapixels";
|
|
|
|
changelog = "https://gitlab.com/postmarketOS/megapixels/-/tags/${version}";
|
2021-02-05 17:12:51 +00:00
|
|
|
license = licenses.gpl3Only;
|
2021-05-20 23:08:51 +00:00
|
|
|
maintainers = with maintainers; [ OPNA2608 dotlambda ];
|
2021-02-05 17:12:51 +00:00
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|