nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 cmake,
6 pkg-config,
7 ffmpeg-headless,
8 libpng,
9 libjpeg,
10}:
11
12stdenv.mkDerivation (finalAttrs: {
13 pname = "ffmpegthumbnailer";
14 version = "2.3.0";
15
16 src = fetchFromGitHub {
17 owner = "dirkvdb";
18 repo = "ffmpegthumbnailer";
19 tag = "v${finalAttrs.version}";
20 hash = "sha256-h8B12FItvSrYgy6t78A02DL96Az4BxtW8brFKkZLH9o=";
21 };
22
23 nativeBuildInputs = [
24 cmake
25 pkg-config
26 ];
27
28 buildInputs = [
29 ffmpeg-headless
30 libpng
31 libjpeg
32 ];
33
34 cmakeFlags = [
35 "-DENABLE_THUMBNAILER=ON"
36 "-DENABLE_AUDIO_THUMBNAILER=ON"
37 ];
38
39 # https://github.com/dirkvdb/ffmpegthumbnailer/issues/215
40 postPatch = ''
41 substituteInPlace libffmpegthumbnailer.pc.in \
42 --replace '$'{exec_prefix}/@CMAKE_INSTALL_LIBDIR@ @CMAKE_INSTALL_FULL_LIBDIR@
43 '';
44
45 postInstall = ''
46 substituteInPlace $out/share/thumbnailers/ffmpegthumbnailer.thumbnailer \
47 --replace-fail '=ffmpegthumbnailer' "=$out/bin/ffmpegthumbnailer"
48 '';
49
50 meta = {
51 description = "Lightweight video thumbnailer";
52 longDescription = "FFmpegthumbnailer is a lightweight video
53 thumbnailer that can be used by file managers to create thumbnails
54 for your video files. The thumbnailer uses ffmpeg to decode frames
55 from the video files, so supported videoformats depend on the
56 configuration flags of ffmpeg.
57 This thumbnailer was designed to be as fast and lightweight as possible.
58 The only dependencies are ffmpeg and libpng/libjpeg.
59 ";
60 homepage = "https://github.com/dirkvdb/ffmpegthumbnailer";
61 license = lib.licenses.gpl2Plus;
62 platforms = lib.platforms.unix;
63 mainProgram = "ffmpegthumbnailer";
64 };
65})