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

72 lines
1.4 KiB
Nix
Raw Normal View History

2021-01-14 12:38:33 +01:00
{ stdenv
, lib
2021-11-14 05:22:23 +01:00
, fetchFromGitLab
, glib
2021-01-14 12:38:33 +01:00
, meson
, ninja
, pkg-config
, wrapGAppsHook
, libepoxy
, gtk4
2021-03-11 17:41:47 +01:00
, zbar
2021-01-14 12:38:33 +01:00
, tiffSupport ? true
, libraw
, jpgSupport ? true
2021-03-11 17:41:47 +01:00
, graphicsmagick
2021-01-14 12:38:33 +01:00
, exiftool
}:
assert jpgSupport -> tiffSupport;
let
inherit (lib) makeBinPath optional optionals optionalString;
runtimePath = makeBinPath (
optional tiffSupport libraw
2021-03-11 17:41:47 +01:00
++ optionals jpgSupport [ graphicsmagick exiftool ]
2021-01-14 12:38:33 +01:00
);
in
stdenv.mkDerivation rec {
pname = "megapixels";
version = "1.4.3";
2021-01-14 12:38:33 +01:00
2021-11-14 05:22:23 +01:00
src = fetchFromGitLab {
owner = "postmarketOS";
2021-04-13 13:01:18 +02:00
repo = "megapixels";
2021-01-14 12:38:33 +01:00
rev = version;
hash = "sha256-UHJ3Fayf+lS3nRuuhHHLN6mbHfHIPssWkghPMPF5ECg=";
2021-01-14 12:38:33 +01:00
};
2021-09-02 23:13:01 +02:00
nativeBuildInputs = [
2021-11-14 05:22:23 +01:00
glib
2021-09-02 23:13:01 +02:00
meson
ninja
pkg-config
wrapGAppsHook
];
2021-01-14 12:38:33 +01:00
buildInputs = [
libepoxy
gtk4
zbar
];
2021-01-14 12:38:33 +01:00
2021-09-02 23:13:01 +02:00
postInstall = ''
glib-compile-schemas $out/share/glib-2.0/schemas
'';
2021-01-14 12:38:33 +01:00
preFixup = optionalString (tiffSupport || jpgSupport) ''
gappsWrapperArgs+=(
--prefix PATH : ${runtimePath}
)
'';
meta = with lib; {
2021-08-05 22:09:01 +02:00
description = "GTK4 camera application that knows how to deal with the media request api";
2021-11-14 05:22:23 +01:00
homepage = "https://gitlab.com/postmarketOS/megapixels";
changelog = "https://gitlab.com/postmarketOS/megapixels/-/tags/${version}";
2021-01-14 12:38:33 +01:00
license = licenses.gpl3Only;
maintainers = with maintainers; [ OPNA2608 dotlambda ];
2021-01-14 12:38:33 +01:00
platforms = platforms.linux;
};
}