2023-07-15 17:15:38 +00:00
|
|
|
{ config
|
|
|
|
, lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, cmake
|
|
|
|
, pkg-config
|
|
|
|
, which
|
|
|
|
, ffmpeg
|
|
|
|
, fftw
|
|
|
|
, frei0r
|
|
|
|
, libdv
|
|
|
|
, libjack2
|
|
|
|
, libsamplerate
|
|
|
|
, libvorbis
|
|
|
|
, libxml2
|
2023-08-04 22:07:22 +00:00
|
|
|
, makeWrapper
|
2023-07-15 17:15:38 +00:00
|
|
|
, movit
|
|
|
|
, opencv4
|
|
|
|
, rtaudio
|
|
|
|
, rubberband
|
|
|
|
, sox
|
|
|
|
, vid-stab
|
|
|
|
, darwin
|
2023-08-04 22:07:22 +00:00
|
|
|
, cudaSupport ? config.cudaSupport
|
2023-07-15 17:15:38 +00:00
|
|
|
, cudaPackages ? { }
|
|
|
|
, enableJackrack ? stdenv.isLinux
|
|
|
|
, ladspa-sdk
|
|
|
|
, ladspaPlugins
|
|
|
|
, enablePython ? false
|
|
|
|
, python3
|
|
|
|
, swig
|
|
|
|
, enableQt ? false
|
|
|
|
, libsForQt5
|
|
|
|
, enableSDL1 ? stdenv.isLinux
|
|
|
|
, SDL
|
|
|
|
, enableSDL2 ? true
|
|
|
|
, SDL2
|
|
|
|
, gitUpdater
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "mlt";
|
2023-08-04 22:07:22 +00:00
|
|
|
version = "7.18.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "mltframework";
|
|
|
|
repo = "mlt";
|
|
|
|
rev = "v${version}";
|
2023-08-04 22:07:22 +00:00
|
|
|
hash = "sha256-3qvMuBr2w/gedTDIjG6ezatleXuQSnKX4SkBShzj6aw=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
pkg-config
|
|
|
|
which
|
2023-08-04 22:07:22 +00:00
|
|
|
makeWrapper
|
2023-07-15 17:15:38 +00:00
|
|
|
] ++ lib.optionals cudaSupport [
|
|
|
|
cudaPackages.cuda_nvcc
|
|
|
|
] ++ lib.optionals enablePython [
|
|
|
|
python3
|
|
|
|
swig
|
|
|
|
] ++ lib.optionals enableQt [
|
|
|
|
libsForQt5.wrapQtAppsHook
|
|
|
|
];
|
2021-08-05 21:33:18 +00:00
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
buildInputs = [
|
|
|
|
ffmpeg
|
|
|
|
fftw
|
|
|
|
frei0r
|
|
|
|
libdv
|
|
|
|
libjack2
|
|
|
|
libsamplerate
|
|
|
|
libvorbis
|
|
|
|
libxml2
|
|
|
|
movit
|
|
|
|
opencv4
|
|
|
|
rtaudio
|
|
|
|
rubberband
|
|
|
|
sox
|
|
|
|
vid-stab
|
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
|
|
|
darwin.apple_sdk_11_0.frameworks.Accelerate
|
|
|
|
] ++ lib.optionals cudaSupport [
|
|
|
|
cudaPackages.cuda_cudart
|
|
|
|
] ++ lib.optionals enableJackrack [
|
|
|
|
ladspa-sdk
|
|
|
|
ladspaPlugins
|
|
|
|
] ++ lib.optionals enableQt [
|
|
|
|
libsForQt5.qtbase
|
|
|
|
libsForQt5.qtsvg
|
|
|
|
] ++ lib.optionals enableSDL1 [
|
|
|
|
SDL
|
|
|
|
] ++ lib.optionals enableSDL2 [
|
|
|
|
SDL2
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
outputs = [ "out" "dev" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
cmakeFlags = [
|
|
|
|
# RPATH of binary /nix/store/.../bin/... contains a forbidden reference to /build/
|
|
|
|
"-DCMAKE_SKIP_BUILD_RPATH=ON"
|
|
|
|
"-DMOD_OPENCV=ON"
|
|
|
|
] ++ lib.optionals enablePython [
|
|
|
|
"-DSWIG_PYTHON=ON"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-08-04 22:07:22 +00:00
|
|
|
preFixup = ''
|
|
|
|
wrapProgram $out/bin/melt \
|
|
|
|
--prefix FREI0R_PATH : ${frei0r}/lib/frei0r-1 \
|
|
|
|
${lib.optionalString enableJackrack "--prefix LADSPA_PATH : ${ladspaPlugins}/lib/ladspa"} \
|
|
|
|
${lib.optionalString enableQt "\${qtWrapperArgs[@]}"}
|
|
|
|
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
postFixup = ''
|
|
|
|
substituteInPlace "$dev"/lib/pkgconfig/mlt-framework-7.pc \
|
|
|
|
--replace '=''${prefix}//' '=/'
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
passthru = {
|
|
|
|
inherit ffmpeg;
|
|
|
|
};
|
|
|
|
|
2022-03-05 16:20:37 +00:00
|
|
|
passthru.updateScript = gitUpdater {
|
2020-10-07 09:15:18 +00:00
|
|
|
rev-prefix = "v";
|
|
|
|
};
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Open source multimedia framework, designed for television broadcasting";
|
2023-07-15 17:15:38 +00:00
|
|
|
homepage = "https://www.mltframework.org/";
|
|
|
|
license = with licenses; [ lgpl21Plus gpl2Plus ];
|
|
|
|
maintainers = [ maintainers.goibhniu ];
|
|
|
|
platforms = platforms.unix;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|