]> git.scottworley.com Git - srec/blobdiff - default.nix
Don't hang if ffmpeg exits on its own
[srec] / default.nix
index 97b5048f9e2ad9e60d7e94186ae8bbc135c11032..6fef4371c6864c17881907af4401d65d7dcc5e6e 100644 (file)
@@ -1,7 +1,7 @@
 { pkgs ? import <nixpkgs> { }, lint ? false }:
-pkgs.python3Packages.callPackage ({ autopep8, buildPythonPackage
-  , gobject-introspection, gtk4, lib, makeDesktopItem, mypy, pylint, pygobject3
-  , wrapGAppsHook4, }:
+pkgs.python3Packages.callPackage ({ autopep8, buildPythonPackage, ffmpeg-full
+  , gobject-introspection, gtk4, lib, makeDesktopItem, makeWrapper, mypy, pylint
+  , pygobject3, wrapGAppsHook4, }:
   buildPythonPackage rec {
     pname = "srec";
     version = "1.0.2";
@@ -11,13 +11,19 @@ pkgs.python3Packages.callPackage ({ autopep8, buildPythonPackage
     doCheck = true;
     checkPhase = "./test.sh";
 
-    nativeBuildInputs = [ gobject-introspection wrapGAppsHook4 ];
+    nativeBuildInputs = [ gobject-introspection makeWrapper wrapGAppsHook4 ];
     nativeCheckInputs = [ mypy ] ++ lib.optionals lint [ autopep8 pylint ];
     buildInputs = [ gtk4 ];
     pythonPath = [ pygobject3 ];
 
     postInstall = ''
-      cp -r $desktopItem/share $out
+      wrapProgram "$out/bin/srec" --prefix PATH : ${ffmpeg-full}/bin
+
+      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 {