1 { lib, stdenv, fetchFromGitHub, makeWrapper
2 , SDL, ffmpeg_4, frei0r, libjack2, libdv, libsamplerate, libexif
3 , libvorbis, libxml2, movit, pkg-config, sox, fftw, opencv4, SDL2
4 , gtk2, gitUpdater, libebur128
5 , jack2, ladspa-sdk, swig, which, ncurses
6 , enablePython ? false, python3
9 stdenv.mkDerivation rec {
13 src = fetchFromGitHub {
14 owner = "mltframework";
17 sha256 = "FPXROiX7A6oB1VMipw3slyhk7q4fO6m9amohnC67lnA=";
21 SDL ffmpeg_4 frei0r libjack2 libdv libsamplerate libvorbis libxml2.dev
22 movit sox libexif gtk2 fftw libebur128 opencv4 SDL2 jack2
24 ] ++ lib.optional enablePython ncurses;
26 nativeBuildInputs = [ pkg-config makeWrapper which ]
27 ++ lib.optionals enablePython [ python3 swig ];
32 # http://www.kdenlive.org/user-manual/downloading-and-installing-kdenlive/installing-source/installing-mlt-rendering-engine
34 "--avformat-swscale" "--enable-gpl" "--enable-gpl3" "--enable-opengl"
35 ] ++ lib.optional enablePython "--swig-languages=python";
37 enableParallelBuilding = true;
38 outPythonPath = lib.optionalString enablePython "$(toPythonPath $out)";
41 wrapProgram $out/bin/melt --prefix FREI0R_PATH : ${frei0r}/lib/frei0r-1
43 # Remove an unnecessary reference to movit.dev.
44 s=${movit.dev}/include
45 t=$(for ((i = 0; i < ''${#s}; i++)); do echo -n X; done)
46 sed -i $out/lib/mlt/libmltopengl.so -e "s|$s|$t|g"
47 '' + lib.optionalString enablePython ''
48 mkdir -p ${outPythonPath}/mlt
49 cp -a src/swig/python/_mlt.so ${outPythonPath}/mlt/
50 cp -a src/swig/python/mlt.py ${outPythonPath}/mlt/__init__.py
51 sed -i ${outPythonPath}/mlt/__init__.py -e "s|return importlib.import_module('_mlt')|return importlib.import_module('mlt._mlt')|g"
54 passthru.updateScript = gitUpdater {
59 description = "Open source multimedia framework, designed for television broadcasting";
60 homepage = "https://www.mltframework.org";
61 license = with licenses; [ gpl3Only gpl2Only lgpl21Only ];
62 maintainers = with maintainers; [ peti ];
63 platforms = platforms.linux;