1{
2 lib,
3 rustPlatform,
4 fetchFromGitHub,
5 makeBinaryWrapper,
6 pkg-config,
7 oniguruma,
8 ffmpeg,
9 git,
10}:
11
12rustPlatform.buildRustPackage {
13 pname = "codemov";
14 version = "0-unstable-2023-08-08";
15
16 src = fetchFromGitHub {
17 owner = "sloganking";
18 repo = "codemov";
19 rev = "8a4d6e50c21010866ca06f845f30c2aa54c09854";
20 hash = "sha256-nOqh8kXS5mx0AM4NvIcwvC0lAZRHsQwrxI0c+9PeroU=";
21 };
22
23 cargoHash = "sha256-lelmkdbqKRjSkJIkF5TWJ6LyCTo2j11hZf9QxIPBoOo=";
24
25 cargoPatches = [
26 # fix build with rust 1.80 by updating time crate version
27 # https://github.com/sloganking/codemov/pull/16
28 ./fix-build-with-rust-1.80.patch
29 ];
30
31 nativeBuildInputs = [
32 makeBinaryWrapper
33 pkg-config
34 ];
35
36 buildInputs = [
37 oniguruma
38 ];
39
40 env = {
41 RUSTONIG_SYSTEM_LIBONIG = true;
42 };
43
44 postInstall = ''
45 wrapProgram $out/bin/codemov \
46 --prefix PATH : ${
47 lib.makeBinPath [
48 ffmpeg
49 git
50 ]
51 }
52 '';
53
54 meta = with lib; {
55 description = "Create a video of how a git repository's code changes over time";
56 homepage = "https://github.com/sloganking/codemov";
57 license = licenses.mit;
58 maintainers = with maintainers; [ figsoda ];
59 mainProgram = "codemov";
60 };
61}