about summary refs log tree commit diff
path: root/pkgs/applications/kde/kdenlive/default.nix
blob: 00330b76b3a00b94f9eabf7b22140fb2ce76bfdd (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
{ mkDerivation
, lib
, extra-cmake-modules
, breeze-icons
, breeze-qt5
, kdoctools
, kconfig
, kcrash
, kguiaddons
, kiconthemes
, ki18n
, kinit
, kdbusaddons
, knotifications
, knewstuff
, karchive
, knotifyconfig
, kplotting
, ktextwidgets
, mediainfo
, mlt
, shared-mime-info
, libv4l
, kfilemetadata
, ffmpeg-full
, frei0r
, phonon-backend-gstreamer
, qtdeclarative
, qtmultimedia
, qtnetworkauth
, qtquickcontrols2
, qtscript
, rttr
, kpurpose
, kdeclarative
, wrapGAppsHook
}:

let
  mlt-full = mlt.override {
    ffmpeg = ffmpeg-full;
  };
in
mkDerivation {
  pname = "kdenlive";
  nativeBuildInputs = [
    extra-cmake-modules
    kdoctools
  ];
  buildInputs = [
    breeze-icons
    breeze-qt5
    kconfig
    kcrash
    kdbusaddons
    kfilemetadata
    kguiaddons
    ki18n
    kiconthemes
    kinit
    knotifications
    knewstuff
    karchive
    knotifyconfig
    kplotting
    ktextwidgets
    mediainfo
    mlt-full
    phonon-backend-gstreamer
    qtdeclarative
    qtmultimedia
    qtnetworkauth
    qtquickcontrols2
    qtscript
    shared-mime-info
    libv4l
    ffmpeg-full
    frei0r
    rttr
    kpurpose
    kdeclarative
    wrapGAppsHook
  ];
  # Both MLT and FFMpeg paths must be set or Kdenlive will complain that it
  # doesn't find them. See:
  # https://github.com/NixOS/nixpkgs/issues/83885
  patches = [ ./dependency-paths.patch ];

  inherit mediainfo;
  ffmpeg = ffmpeg-full;
  mlt = mlt-full;

  postPatch =
    # Module Qt5::Concurrent must be included in `find_package` before it is used.
    ''
      sed -i CMakeLists.txt -e '/find_package(Qt5 REQUIRED/ s|)| Concurrent)|'
      substituteAllInPlace src/kdenlivesettings.kcfg
    '';

  dontWrapGApps = true;

  # Frei0r path needs to be set too or Kdenlive will complain. See:
  # https://github.com/NixOS/nixpkgs/issues/83885
  # https://github.com/NixOS/nixpkgs/issues/29614#issuecomment-488849325
  qtWrapperArgs = [
    "--set FREI0R_PATH ${frei0r}/lib/frei0r-1"
  ];

  preFixup = ''
    qtWrapperArgs+=("''${gappsWrapperArgs[@]}")
  '';

  meta = {
    homepage = "https://apps.kde.org/kdenlive/";
    description = "Video editor";
    license = with lib.licenses; [ gpl2Plus ];
    maintainers = with lib.maintainers; [ turion ];
  };
}