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