]> git.scottworley.com Git - srec/blob - default.nix
25.11: Formatting: nixfmt-classic → nixfmt-rfc-style
[srec] / default.nix
1 {
2 pkgs ? import <nixpkgs> { },
3 lint ? false,
4 }:
5 pkgs.python3Packages.callPackage (
6 {
7 autopep8,
8 buildPythonPackage,
9 ffmpeg-full,
10 gobject-introspection,
11 gtk4,
12 lib,
13 makeDesktopItem,
14 makeWrapper,
15 mypy,
16 pylint,
17 pygobject3,
18 wrapGAppsHook4,
19 }:
20 buildPythonPackage rec {
21 pname = "srec";
22 version = "1.0.2";
23
24 src = lib.cleanSource ./.;
25
26 doCheck = true;
27 checkPhase = "./test.sh";
28
29 nativeBuildInputs = [
30 gobject-introspection
31 makeWrapper
32 wrapGAppsHook4
33 ];
34 nativeCheckInputs = [
35 mypy
36 ]
37 ++ lib.optionals lint [
38 autopep8
39 pylint
40 ];
41 buildInputs = [ gtk4 ];
42 pythonPath = [ pygobject3 ];
43
44 postInstall = ''
45 wrapProgram "$out/bin/srec" --prefix PATH : ${ffmpeg-full}/bin
46
47 install -D ${./srec48.png} $out/share/icons/hicolor/48x48/apps/srec.png
48 install -D ${./srec.png} $out/share/icons/hicolor/256x256/apps/srec.png
49 install -D ${./srec.svg} $out/share/icons/hicolor/scalable/apps/srec.svg
50
51 cp -r $desktopItem/share/* $out/share
52 '';
53
54 desktopItem = makeDesktopItem {
55 name = "SRec";
56 exec = "srec";
57 icon = ./srec.png;
58 comment = "Record video and audio";
59 desktopName = "SRec";
60 genericName = "Record Screen";
61 categories = [
62 "AudioVideo"
63 "Video"
64 ];
65 };
66
67 meta = {
68 description = "A simple GUI for screen recording";
69 homepage = "https://git.scottworley.com/srec";
70 license = pkgs.lib.licenses.gpl3;
71 maintainers = with pkgs.lib.maintainers; [ chkno ];
72 };
73
74 }
75 ) { }