summary refs log tree commit diff
path: root/pkgs/desktops/plasma-5.2/default.nix
blob: ed89384e26ac87171b473c42be558066b7e192f9 (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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
# Maintainer's Notes:
#
# Minor updates:
#  1. Edit ./manifest.sh to point to the updated URL. Upstream sometimes
#     releases updates that include only the changed packages; in this case,
#     multiple URLs can be provided and the results will be merged.
#  2. Run ./manifest.sh and ./dependencies.sh.
#  3. Build and enjoy.
#
# Major updates:
#  We prefer not to immediately overwrite older versions with major updates, so
#  make a copy of this directory first. After copying, be sure to delete ./tmp
#  if it exists. Then follow the minor update instructions.

{ autonix, kf5, pkgs, qt5, stdenv, debug ? false }:

with stdenv.lib; with autonix;

let kf5Orig = kf5; in

let

  kf5 = kf5Orig.override { inherit debug qt5; };

  mirror = "mirror://kde";

  renames =
    builtins.removeAttrs
      (import ./renames.nix {})
      ["Backend" "CTest"];

  scope =
    # packages in this collection
    (mapAttrs (dep: name: plasma5."${name}") renames) //
    # packages from KDE Frameworks 5
    kf5.scope //
    # packages pinned to this version of Qt 5
    {
      LibBlueDevil = pkgs.libbluedevil;
      PolkitQt5-1 = pkgs.polkit_qt5.override { inherit qt5; };
      PopplerQt5 = pkgs.poppler_qt5.override { inherit qt5; };
    } //
    # packages from nixpkgs
    (with pkgs;
      {
        inherit epoxy;
        Epub = ebook_tools;
        Exiv2 = exiv2;
        FFmpeg = ffmpeg;
        FONTFORGE_EXECUTABLE = fontforge;
        Freetype = freetype;
        GTK2 = gtk2;
        GTK3 = gtk3;
        Libinput = libinput;
        LibSSH = libssh;
        PulseAudio = pulseaudio;
        Taglib = taglib;
        USB = libusb;
        Wayland = wayland;
        Xapian = xapian;
      }
    );

  preResolve = super:
    fold (f: x: f x) super
      [
        (userEnvPkg "SharedMimeInfo")
        (userEnvPkg "SharedDesktopOntologies")
        (blacklist ["bluedevil"])
      ];

  postResolve = super:
    (builtins.removeAttrs super ["breeze"]) // {

      breeze-qt4 = with pkgs; super.breeze // {
        name = "breeze-qt4-" + (builtins.parseDrvName super.breeze.name).version;
        buildInputs = [ xlibs.xproto kde4.kdelibs qt4 ];
        nativeBuildInputs = [ cmake pkgconfig ];
        cmakeFlags =
          [
            "-DUSE_KDE4=ON"
            "-DQT_QMAKE_EXECUTABLE=${qt4}/bin/qmake"
          ];
      };

      breeze-qt5 = with pkgs; super.breeze // {
        name = "breeze-qt5-" + (builtins.parseDrvName super.breeze.name).version;
        buildInputs = with kf5; with plasma5;
          [
            kcompletion kconfig kconfigwidgets kcoreaddons kdecoration kguiaddons
            frameworkintegration ki18n kwindowsystem qt5.base qt5.x11extras
          ];
        nativeBuildInputs = [ cmake kf5.extra-cmake-modules pkgconfig ];
        cmakeFlags = [ "-DUSE_KDE4=OFF" ];
      };

      kde-gtk-config = with pkgs; super.kde-gtk-config // {
        NIX_CFLAGS_COMPILE =
          (super.kde-gtk-config.NIX_CFLAGS_COMPILE or "")
          + " -I${cairo}/include/cairo"
          + " -I${gtk2}/include/gtk-2.0 -I${gtk2}/lib/gtk-2.0/include"
          + " -I${glib}/include/glib-2.0 -I${glib}/lib/glib-2.0/include"
          + " -I${pango}/include/pango-1.0";
      };

      kwin = with pkgs; super.kwin // {
        buildInputs = with xlibs;
          super.kwin.buildInputs ++ [ libICE libSM libXcursor ];
        patches = [ ./kwin/kwin-import-plugin-follow-symlinks.patch ];
      };

      libkscreen = with pkgs; super.libkscreen // {
        buildInputs = with xlibs; super.libkscreen.buildInputs ++ [libXrandr];
      };

      plasma-desktop = with pkgs; super.plasma-desktop // {
        buildInputs = with xlibs;
          super.plasma-desktop.buildInputs ++
          [ pkgs.libcanberra libxkbfile libXcursor libXft ];
        patches = [
          ./plasma-desktop/plasma-desktop-hwclock.patch
          ./plasma-desktop/plasma-desktop-zoneinfo.patch
        ];
        preConfigure = ''
          substituteInPlace kcms/dateandtime/helper.cpp \
            --subst-var-by hwclock "${utillinux}/sbin/hwclock"
        '';
      };

      plasma-workspace = with pkgs; super.plasma-workspace // {
        buildInputs = with xlibs;
          super.plasma-workspace.buildInputs ++ [ libSM libXcursor pam ];
        postPatch = ''
          substituteInPlace startkde/kstartupconfig/kstartupconfig.cpp \
            --replace kdostartupconfig5 $out/bin/kdostartupconfig5
        '';
        postInstall = ''
          # We use a custom startkde script
          rm $out/bin/startkde
        '';
      };

      powerdevil = with pkgs; super.powerdevil // {
        buildInputs = with xlibs; super.powerdevil.buildInputs ++ [libXrandr];
      };

      sddm-kcm = with pkgs; super.sddm-kcm // {
        buildInputs = with xlibs; super.sddm-kcm.buildInputs ++ [libXcursor];
      };

    };

  plasma5 = generateCollection ./. {
    inherit (kf5) mkDerivation;
    inherit mirror preResolve postResolve renames scope;
  };

in
  plasma5 // {
    inherit kf5 scope;
    startkde = pkgs.callPackage ./startkde {
      inherit (kf5) kconfig kinit kservice;
      inherit (plasma5) plasma-desktop plasma-workspace;
      inherit qt5;
    };
  }