about summary refs log tree commit diff
path: root/nixpkgs/pkgs/misc/t-rec/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/misc/t-rec/default.nix')
-rw-r--r--nixpkgs/pkgs/misc/t-rec/default.nix37
1 files changed, 37 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/misc/t-rec/default.nix b/nixpkgs/pkgs/misc/t-rec/default.nix
new file mode 100644
index 000000000000..b9663cee5c33
--- /dev/null
+++ b/nixpkgs/pkgs/misc/t-rec/default.nix
@@ -0,0 +1,37 @@
+{ lib, stdenv, imagemagick, ffmpeg, rustPlatform, fetchFromGitHub, makeWrapper
+, libiconv, Foundation }:
+
+let
+  binPath = lib.makeBinPath [
+    imagemagick
+    ffmpeg
+  ];
+in
+rustPlatform.buildRustPackage rec {
+  pname = "t-rec";
+  version = "0.6.0";
+
+  src = fetchFromGitHub {
+    owner = "sassman";
+    repo = "t-rec-rs";
+    rev = "v${version}";
+    sha256 = "InArrBqfhDrsonjmCIPTBVOA/s2vYml9Ay6cdrKLd7c=";
+  };
+
+  nativeBuildInputs = [ makeWrapper ];
+  buildInputs = [ imagemagick ]
+    ++ lib.optionals stdenv.isDarwin [ libiconv Foundation ];
+
+  postInstall = ''
+    wrapProgram "$out/bin/t-rec" --prefix PATH : "${binPath}"
+  '';
+
+  cargoSha256 = "4gwfrC65YlXV6Wu2ninK1TvMNUkY1GstVYPr0FK+xLU=";
+
+  meta = with lib; {
+    description = "Blazingly fast terminal recorder that generates animated gif images for the web written in rust";
+    homepage = "https://github.com/sassman/t-rec-rs";
+    license = with licenses; [ gpl3Only ];
+    maintainers = [ maintainers.hoverbear ];
+  };
+}