1{ fetchFromGitHub, lib, stdenv, ffmpeg-headless, cmake, libpng, pkg-config, libjpeg
2}:
3
4stdenv.mkDerivation rec {
5 pname = "ffmpegthumbnailer";
6 version = "unstable-2022-02-18";
7
8 src = fetchFromGitHub {
9 owner = "dirkvdb";
10 repo = "ffmpegthumbnailer";
11 rev = "3db9fe895b2fa656bb40ddb7a62e27604a688171";
12 sha256 = "0606pbg391l4s8mpyyalm9zrcnm75fwqdlrxy2gif9n21i2fm3rc";
13 };
14
15 nativeBuildInputs = [ cmake pkg-config ];
16 buildInputs = [ ffmpeg-headless libpng libjpeg ];
17 cmakeFlags = [ "-DENABLE_THUMBNAILER=ON" ];
18
19 # https://github.com/dirkvdb/ffmpegthumbnailer/issues/215
20 postPatch = ''
21 substituteInPlace libffmpegthumbnailer.pc.in \
22 --replace '$'{exec_prefix}/@CMAKE_INSTALL_LIBDIR@ @CMAKE_INSTALL_FULL_LIBDIR@
23 '';
24
25 meta = with lib; {
26 homepage = "https://github.com/dirkvdb/ffmpegthumbnailer";
27 description = "A lightweight video thumbnailer";
28 longDescription = "FFmpegthumbnailer is a lightweight video
29 thumbnailer that can be used by file managers to create thumbnails
30 for your video files. The thumbnailer uses ffmpeg o decode frames
31 from the video files, so supported videoformats depend on the
32 configuration flags of ffmpeg.
33 This thumbnailer was designed to be as fast and lightweight as possible.
34 The only dependencies are ffmpeg and libpng.
35 ";
36 platforms = platforms.unix;
37 license = licenses.gpl2Plus;
38 maintainers = [ maintainers.jagajaga ];
39 };
40
41}