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












                              
                                                                   
 
                        

                                                    
 

                             



                                                                        
 
                                                                 




                                   
{ stdenv, lib }:

let inherit (lib) optional; in

{ debug }:

args:

let
  args_ = {

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

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

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

    enableParallelBuilding = args.enableParallelBuilding or true;

  };
in

stdenv.mkDerivation (args // args_)