about summary refs log tree commit diff
path: root/pkgs/by-name/ha/harvid/package.nix
blob: efbe45d667c044a66ae72d6a2ded6db736446605 (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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
{
  lib,
  stdenv,
  fetchFromGitHub,
  pkg-config,
  which,
  unixtools,
  cctools,
  ffmpeg,
  libjpeg,
  libpng,
  nix-update-script,
}:

stdenv.mkDerivation (finalAttrs: {
  pname = "harvid";
  version = "0.9.1";

  src = fetchFromGitHub {
    owner = "x42";
    repo = "harvid";
    rev = "v${finalAttrs.version}";
    hash = "sha256-p0W+rKHH/iuGOcRjl6b4s6jQYkm7bqWCz849SDI/7fQ=";
  };

  nativeBuildInputs =
    [ pkg-config ]
    ++ lib.optionals stdenv.hostPlatform.isDarwin [
      which
      unixtools.xxd
    ];

  buildInputs = [
    ffmpeg
    libjpeg
    libpng
  ];

  postPatch = lib.optionalString stdenv.hostPlatform.isDarwin ''
    substituteInPlace libharvid/Makefile \
      --replace-fail /usr/bin/libtool ${cctools}/bin/libtool
  '';

  makeFlags = [
    "PREFIX=$(out)"
    "VERSION=v${finalAttrs.version}"
  ];

  enableParallelBuilding = true;

  passthru.updateScript = nix-update-script { };

  meta = {
    description = "Decodes still images from movie files and serves them via HTTP";
    longDescription = ''
      harvid's intended use-case is to efficiently provide frame-accurate data
      and act as second level cache for rendering the video-timeline in Ardour,
      but it is not limited to that: it has applications for any task that
      requires a high-performance frame-accurate online image extraction
      processor.
    '';
    homepage = "http://x42.github.io/harvid";
    license = lib.licenses.gpl2Plus;
    platforms = lib.platforms.unix;
    maintainers = [ lib.maintainers.mitchmindtree ];
    mainProgram = "harvid";
  };
})