2017-10-24 12:39:54 +01:00
|
|
|
{ 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");
|
|
|
|
|
2018-01-19 13:50:54 +00:00
|
|
|
NIX_CFLAGS_COMPILE =
|
|
|
|
let arg = args.NIX_CFLAGS_COMPILE or []; in
|
|
|
|
optional (debug == true) "-DQT_NO_DEBUG"
|
|
|
|
++ (if builtins.isList arg then arg else [arg]);
|
2018-01-02 13:16:38 +00:00
|
|
|
|
2017-10-24 12:39:54 +01:00
|
|
|
cmakeFlags =
|
|
|
|
(args.cmakeFlags or [])
|
|
|
|
++ [ "-DBUILD_TESTING=OFF" ]
|
|
|
|
++ optional (debug != null)
|
|
|
|
(if debug then "-DCMAKE_BUILD_TYPE=Debug"
|
|
|
|
else "-DCMAKE_BUILD_TYPE=Release");
|
|
|
|
|
2017-11-10 15:23:13 +00:00
|
|
|
enableParallelBuilding = args.enableParallelBuilding or true;
|
2017-10-24 12:39:54 +01:00
|
|
|
|
|
|
|
};
|
|
|
|
in
|
|
|
|
|
|
|
|
stdenv.mkDerivation (args // args_)
|