nixpkgs/pkgs/by-name/ff/ffmpegthumbnailer/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

64 lines
1.7 KiB
Nix

{
lib,
stdenv,
fetchFromGitHub,
cmake,
pkg-config,
ffmpeg-headless,
libpng,
libjpeg,
}:
stdenv.mkDerivation rec {
pname = "ffmpegthumbnailer";
version = "unstable-2024-01-04";
src = fetchFromGitHub {
owner = "dirkvdb";
repo = "ffmpegthumbnailer";
rev = "1b5a77983240bcf00a4ef7702c07bcd8f4e5f97c";
hash = "sha256-7SPRQMPgdvP7J3HCf7F1eXxZjUH5vCYZ9UOwTUFMLp0=";
};
nativeBuildInputs = [
cmake
pkg-config
];
buildInputs = [
ffmpeg-headless
libpng
libjpeg
];
cmakeFlags = [ "-DENABLE_THUMBNAILER=ON" ];
# https://github.com/dirkvdb/ffmpegthumbnailer/issues/215
postPatch = ''
substituteInPlace libffmpegthumbnailer.pc.in \
--replace '$'{exec_prefix}/@CMAKE_INSTALL_LIBDIR@ @CMAKE_INSTALL_FULL_LIBDIR@
'';
postInstall = ''
substituteInPlace $out/share/thumbnailers/ffmpegthumbnailer.thumbnailer \
--replace-fail '=ffmpegthumbnailer' "=$out/bin/ffmpegthumbnailer"
'';
meta = with lib; {
description = "Lightweight video thumbnailer";
longDescription = "FFmpegthumbnailer is a lightweight video
thumbnailer that can be used by file managers to create thumbnails
for your video files. The thumbnailer uses ffmpeg to decode frames
from the video files, so supported videoformats depend on the
configuration flags of ffmpeg.
This thumbnailer was designed to be as fast and lightweight as possible.
The only dependencies are ffmpeg and libpng/libjpeg.
";
homepage = "https://github.com/dirkvdb/ffmpegthumbnailer";
license = licenses.gpl2Plus;
maintainers = [ maintainers.jagajaga ];
platforms = platforms.unix;
mainProgram = "ffmpegthumbnailer";
};
}