summary refs log tree commit diff
path: root/pkgs/tools/misc/codemov/default.nix
blob: f4a88a74bf946ebb5edfea9e4e64df604ff93cbe (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
{ lib
, rustPlatform
, fetchFromGitHub
, makeBinaryWrapper
, pkg-config
, oniguruma
, ffmpeg
, git
}:

rustPlatform.buildRustPackage {
  pname = "codemov";
  version = "unstable-2022-10-24";

  src = fetchFromGitHub {
    owner = "sloganking";
    repo = "codemov";
    rev = "d51e83246eafef32c3a3f54407fe49eb9801f5ea";
    hash = "sha256-4Z3XASFlALCnX1guDqhBfvGNZ0V1XSruJvvSm0xr/t4=";
  };

  cargoLock = {
    lockFile = ./Cargo.lock;
  };

  postPatch = ''
    ln -s ${./Cargo.lock} Cargo.lock
  '';

  nativeBuildInputs = [
    makeBinaryWrapper
    pkg-config
  ];

  buildInputs = [
    oniguruma
  ];

  env = {
    RUSTONIG_SYSTEM_LIBONIG = true;
  };

  postInstall = ''
    wrapProgram $out/bin/codemov \
      --prefix PATH : ${lib.makeBinPath [ ffmpeg git ]}
  '';

  meta = with lib; {
    description = "Create a video of how a git repository's code changes over time";
    homepage = "https://github.com/sloganking/codemov";
    license = licenses.mit;
    maintainers = with maintainers; [ figsoda ];
  };
}