about summary refs log tree commit diff
path: root/pkgs/development/libraries/qt-5/5.5/default.nix
blob: b7e8fb33387ed4a4cddb9c59990edb67c98f4f32 (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
/*

# Minor Updates

1. Edit ./fetchsrcs.sh to point to the updated URL.
2. Run ./fetchsrcs.sh.
3. Build and enjoy.

# Major Updates

1. Make a copy of this directory. (We like to keep the old version around
   for a short time after major updates.)
2. Delete the tmp/ subdirectory of the copy.
3. Follow the minor update instructions above.
4. Package any new Qt modules, if necessary.

*/

{
  newScope,
  stdenv, fetchurl, makeSetupHook, makeWrapper,
  bison, cups ? null, harfbuzz, mesa, perl,
  libgnomeui, GConf, gnome_vfs,
  gstreamer, gst-plugins-base,

  # options
  developerBuild ? false,
  decryptSslTraffic ? false,
}:

with stdenv.lib;

let

  mirror = "http://download.qt.io";
  srcs = import ./srcs.nix { inherit mirror; inherit fetchurl; };

  qtSubmodule = args:
    let
      inherit (args) name;
      inherit (srcs."${args.name}") version src;
      inherit (stdenv) mkDerivation;
    in mkDerivation (args // {
      name = "${name}-${version}";
      inherit src;

      propagatedBuildInputs = args.qtInputs ++ (args.propagatedBuildInputs or []);
      nativeBuildInputs = (args.nativeBuildInputs or []) ++ [ self.qmakeHook ];

      NIX_QT_SUBMODULE = args.NIX_QT_SUBMODULE or true;

      outputs = args.outputs or [ "out" "dev" ];
      setOutputFlags = args.setOutputFlags or false;

      setupHook = ../qtsubmodule-setup-hook.sh;

      enableParallelBuilding = args.enableParallelBuilding or true;

      meta = self.qtbase.meta // (args.meta or {});
    });

  addPackages = self: with self;
    let
      callPackage = self.newScope { inherit qtSubmodule srcs; };
    in {

      qtbase = callPackage ./qtbase {
        inherit bison cups harfbuzz mesa;
        # GNOME dependencies are not used unless gtkStyle == true
        inherit libgnomeui GConf gnome_vfs;
        inherit developerBuild decryptSslTraffic;
      };

      /* qt3d = not packaged */
      /* qtactiveqt = not packaged */
      /* qtandroidextras = not packaged */
      /* qtcanvas3d = not packaged */
      qtconnectivity = callPackage ./qtconnectivity.nix {};
      qtdeclarative = callPackage ./qtdeclarative {};
      qtdoc = callPackage ./qtdoc.nix {};
      qtenginio = callPackage ./qtenginio.nix {};
      qtgraphicaleffects = callPackage ./qtgraphicaleffects.nix {};
      qtimageformats = callPackage ./qtimageformats.nix {};
      qtlocation = callPackage ./qtlocation.nix {};
      /* qtmacextras = not packaged */
      qtmultimedia = callPackage ./qtmultimedia.nix {
        inherit gstreamer gst-plugins-base;
      };
      qtquick1 = callPackage ./qtquick1 {};
      qtquickcontrols = callPackage ./qtquickcontrols.nix {};
      qtquickcontrols2 = null;
      qtscript = callPackage ./qtscript {};
      qtsensors = callPackage ./qtsensors.nix {};
      qtserialport = callPackage ./qtserialport {};
      qtsvg = callPackage ./qtsvg.nix {};
      qttools = callPackage ./qttools {};
      qttranslations = callPackage ./qttranslations.nix {};
      /* qtwayland = not packaged */
      /* qtwebchannel = not packaged */
      /* qtwebengine = not packaged */
      qtwebkit = callPackage ./qtwebkit {};
      qtwebkit-examples = callPackage ./qtwebkit-examples.nix {};
      qtwebsockets = callPackage ./qtwebsockets.nix {};
      /* qtwinextras = not packaged */
      qtx11extras = callPackage ./qtx11extras.nix {};
      qtxmlpatterns = callPackage ./qtxmlpatterns.nix {};

      env = callPackage ../qt-env.nix {};
      full = env "qt-${qtbase.version}" [
        qtconnectivity qtdeclarative qtdoc qtenginio qtgraphicaleffects qtimageformats
        qtlocation qtmultimedia qtquick1 qtquickcontrols qtscript qtsensors qtserialport
        qtsvg qttools qttranslations qtwebkit qtwebkit-examples qtwebsockets qtx11extras
        qtxmlpatterns
      ];

      makeQtWrapper =
        makeSetupHook
        { deps = [ makeWrapper ]; }
        ../make-qt-wrapper.sh;

      qmakeHook =
        makeSetupHook
        { deps = [ self.qtbase.dev ]; }
        ../qmake-hook.sh;

    };

   self = makeScope newScope addPackages;

in self