-{ pkgs ? import <nixpkgs> { }, lint ? false }:
-pkgs.python3Packages.callPackage ({ autopep8, buildPythonPackage, ffmpeg-full
- , gobject-introspection, gtk4, lib, makeDesktopItem, makeWrapper, mypy, pylint
- , pygobject3, wrapGAppsHook4, }:
+{
+ pkgs ? import <nixpkgs> { },
+ lint ? false,
+}:
+pkgs.python3Packages.callPackage (
+ {
+ autopep8,
+ buildPythonPackage,
+ ffmpeg-full,
+ gobject-introspection,
+ gtk4,
+ lib,
+ makeDesktopItem,
+ makeWrapper,
+ mypy,
+ setuptools,
+ pylint,
+ pygobject3,
+ wrapGAppsHook4,
+ }:
buildPythonPackage rec {
pname = "srec";
version = "1.0.2";
src = lib.cleanSource ./.;
+ pyproject = true;
+ build-system = [ setuptools ];
+
doCheck = true;
checkPhase = "./test.sh";
- nativeBuildInputs = [ gobject-introspection makeWrapper wrapGAppsHook4 ];
- nativeCheckInputs = [ mypy ] ++ lib.optionals lint [ autopep8 pylint ];
+ nativeBuildInputs = [
+ gobject-introspection
+ makeWrapper
+ wrapGAppsHook4
+ ];
+ nativeCheckInputs = [
+ mypy
+ ]
+ ++ lib.optionals lint [
+ autopep8
+ pylint
+ ];
buildInputs = [ gtk4 ];
pythonPath = [ pygobject3 ];
postInstall = ''
wrapProgram "$out/bin/srec" --prefix PATH : ${ffmpeg-full}/bin
- cp -r $desktopItem/share $out
+
+ install -D ${./srec48.png} $out/share/icons/hicolor/48x48/apps/srec.png
+ install -D ${./srec.png} $out/share/icons/hicolor/256x256/apps/srec.png
+ install -D ${./srec.svg} $out/share/icons/hicolor/scalable/apps/srec.svg
+
+ cp -r $desktopItem/share/* $out/share
'';
desktopItem = makeDesktopItem {
comment = "Record video and audio";
desktopName = "SRec";
genericName = "Record Screen";
- categories = [ "AudioVideo" "Video" ];
+ categories = [
+ "AudioVideo"
+ "Video"
+ ];
};
meta = {
maintainers = with pkgs.lib.maintainers; [ chkno ];
};
- }) { }
+ }
+) { }