1{ lib, stdenv, fetchFromGitHub, fetchpatch, ffmpeg_4, libjpeg, libpng, pkg-config }:
2
3stdenv.mkDerivation rec {
4 pname = "harvid";
5 version = "0.9.0";
6
7 src = fetchFromGitHub {
8 owner = "x42";
9 repo = "harvid";
10 rev = "v${version}";
11 sha256 = "sha256-qt6aep7iMF8/lnlT2wLqu6LkFDqzdfsGLZvrOlXttG8=";
12 };
13
14 patches = [
15 # Fix pending upstream inclusion to support parallel builds:
16 # https://github.com/x42/harvid/pull/10
17 (fetchpatch {
18 name = "parallel-build.patch";
19 url = "https://github.com/x42/harvid/commit/a3f85c57ad2559558706d9b22989de36452704d9.patch";
20 sha256 = "sha256-0aBfM/4XEqM7C1nFw996IVwaeL0tNgMUQ1C3kblOobI=";
21 })
22 ];
23
24 nativeBuildInputs = [ pkg-config ];
25
26 buildInputs = [ ffmpeg_4 libjpeg libpng ];
27
28 makeFlags = [ "DESTDIR=$(out)" "libdir=\"/lib\"" ];
29
30 postInstall = ''
31 mkdir -p $out/bin
32 mv $out/usr/local/bin/* $out/bin
33 mv $out/usr/local/share $out/
34 rm -r $out/usr
35 '';
36
37 meta = with lib; {
38 description =
39 "Decodes still images from movie files and serves them via HTTP";
40 longDescription = ''
41 harvid's intended use-case is to efficiently provide frame-accurate data
42 and act as second level cache for rendering the video-timeline in Ardour,
43 but it is not limited to that: it has applications for any task that
44 requires a high-performance frame-accurate online image extraction
45 processor.
46 '';
47 homepage = "http://x42.github.io/harvid";
48 license = licenses.gpl2Plus;
49 platforms = platforms.linux;
50 maintainers = with maintainers; [ mitchmindtree ];
51 };
52}