about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/qt-5/mkDerivation.nix
blob: 2c6333cb02045a30a57df4450d72b552465818f7 (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
{ lib, debug, wrapQtAppsHook }:

let inherit (lib) optional; in

mkDerivation:

args:

let
  args_ = {

    qmakeFlags = [ ("CONFIG+=" + (if debug then "debug" else "release")) ]
              ++ (args.qmakeFlags or []);

    NIX_CFLAGS_COMPILE = toString (
      optional (!debug) "-DQT_NO_DEBUG"
      ++ lib.toList (args.NIX_CFLAGS_COMPILE or []));

    cmakeFlags =
      (args.cmakeFlags or [])
      ++ [
        ("-DCMAKE_BUILD_TYPE=" + (if debug then "Debug" else "Release"))
      ];

    enableParallelBuilding = args.enableParallelBuilding or true;

    nativeBuildInputs = (args.nativeBuildInputs or []) ++ [ wrapQtAppsHook ];

  };
in

mkDerivation (args // args_)