1{
2 lib,
3 stdenv,
4 fetchFromGitLab,
5 fetchpatch,
6 glib,
7 meson,
8 ninja,
9 pkg-config,
10 rustc,
11 libbsd,
12 libcamera,
13 gtk3,
14 libtiff,
15 zbar,
16 libjpeg,
17 libexif,
18 libraw,
19 libpulseaudio,
20 ffmpeg-headless,
21 v4l-utils,
22 makeWrapper,
23 python3,
24}:
25
26stdenv.mkDerivation rec {
27 pname = "millipixels";
28 version = "0.22.0";
29
30 src = fetchFromGitLab {
31 owner = "Librem5";
32 repo = "millipixels";
33 rev = "v${version}";
34 domain = "source.puri.sm";
35 hash = "sha256-pRREQRYyD9+dpRvcfsNiNthFy08Yeup9xDn+x+RWDrE=";
36 };
37 patches = [
38 # fix for https://source.puri.sm/Librem5/millipixels/-/issues/87, can be removed with the next release (if there ever will be one)
39 (fetchpatch {
40 url = "https://source.puri.sm/Librem5/millipixels/-/commit/5a0776993051a0af54c148702f36dbbf1064b917.patch?merge_request_iid=105";
41 hash = "sha256-OdjTFHMx64eb94/kSCaxeM/Ju/JxOPoorw2ogwTPP3s=";
42 })
43 ];
44
45 nativeBuildInputs = [
46 glib
47 meson
48 ninja
49 pkg-config
50 rustc
51 makeWrapper
52 ];
53
54 buildInputs = [
55 libbsd
56 libcamera
57 gtk3
58 libtiff
59 zbar
60 libpulseaudio
61 libraw
62 libexif
63 libjpeg
64 python3
65 ];
66
67 postInstall = ''
68 wrapProgram $out/bin/millipixels \
69 --prefix PATH : ${
70 lib.makeBinPath [
71 v4l-utils
72 ffmpeg-headless
73 ]
74 }
75 '';
76
77 meta = with lib; {
78 description = "Camera application for the Librem 5";
79 homepage = "https://source.puri.sm/Librem5/millipixels";
80 license = licenses.gpl3Only;
81 maintainers = with maintainers; [ _999eagle ];
82 platforms = platforms.linux;
83 };
84}