Browse Source

test(itest): disable gif rendering

Refs: #147, https://github.com/charmbracelet/vhs/pull/364
Signed-off-by: Christina Sørensen <christina@cafkafk.com>
Christina Sørensen 2 years ago
parent
commit
fff4f62ffa
4 changed files with 43 additions and 1 deletions
  1. 37 1
      flake.nix
  2. 2 0
      tests/tapes/eza-blocksize.tape
  3. 2 0
      tests/tapes/eza-long.tape
  4. 2 0
      tests/tapes/main.tape

+ 37 - 1
flake.nix

@@ -108,11 +108,47 @@
             mode = "clippy";
             inherit buildInputs;
           };
+
+          vhs = pkgs.buildGoModule rec {
+            pname = "vhs";
+            version = "0.6.0";
+
+            src = pkgs.fetchFromGitHub {
+              owner = "PThorpe92";
+              repo = pname;
+              rev = "70ff84c3b192a2f3379adf56dd873c63bc8163ac";
+              hash = "sha256-QgE9XpJKZSJDjY2Z2GC1ndWgwXOJaB1fzvGUGFFf5XM=";
+            };
+
+            vendorHash = "sha256-zugGnhLrqqqVjMFZrO4rrSj3UzyHWpLra1rxyGG2ga4=";
+
+            nativeBuildInputs = with pkgs; [installShellFiles makeWrapper];
+
+            ldflags = ["-s" "-w" "-X=main.Version=${version}"];
+
+            postInstall = ''
+              wrapProgram $out/bin/vhs --prefix PATH : ${pkgs.lib.makeBinPath (pkgs.lib.optionals pkgs.stdenv.isLinux [pkgs.chromium] ++ [pkgs.ffmpeg pkgs.ttyd])}
+              $out/bin/vhs man > vhs.1
+              installManPage vhs.1
+              installShellCompletion --cmd vhs \
+                --bash <($out/bin/vhs completion bash) \
+                --fish <($out/bin/vhs completion fish) \
+                --zsh <($out/bin/vhs completion zsh)
+            '';
+
+            meta = with pkgs.lib; {
+              description = "A tool for generating terminal GIFs with code";
+              homepage = "https://github.com/charmbracelet/vhs";
+              changelog = "https://github.com/charmbracelet/vhs/releases/tag/v${version}";
+              license = licenses.mit;
+              maintainers = with maintainers; [cafkafk];
+            };
+          };
         };
 
         # For `nix develop`:
         devShells.default = pkgs.mkShell {
-          nativeBuildInputs = with pkgs; [toolchain just pandoc vhs convco];
+          nativeBuildInputs = with pkgs; [toolchain just pandoc packages.vhs convco];
         };
 
         # For `nix flake check`

+ 2 - 0
tests/tapes/eza-blocksize.tape

@@ -1,5 +1,7 @@
 Output outfile
 
+Set DisableRender true
+
 Set Shell fish
 Sleep 2s
 

+ 2 - 0
tests/tapes/eza-long.tape

@@ -1,5 +1,7 @@
 Output outfile
 
+Set DisableRender true
+
 Set Shell fish
 Sleep 2s
 

+ 2 - 0
tests/tapes/main.tape

@@ -1,5 +1,7 @@
 Output outfile
 
+Set DisableRender true
+
 Set Shell fish
 Sleep 2s
 Type "cargo run -q -- -l --no-user --no-time --no-filesize"