summary refs log blame commit diff
path: root/pkgs/development/libraries/qt-5/mkDerivation.nix
blob: 97bd09c327b265e859eec8505c073c80a4b22dcd (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16















                                                                 

                                                                  






                                                       
                                                                 




                                   
{ stdenv, lib }:

let inherit (lib) optional; in

{ debug }:

args:

let
  args_ = {

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

    NIX_CFLAGS_COMPILE = optional (debug != null) "-DQT_NO_DEBUG";

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

    enableParallelBuilding = args.enableParallelBuilding or true;

  };
in

stdenv.mkDerivation (args // args_)