2019-07-05 18:41:41 +03:00
|
|
|
{ lib, debug, wrapQtAppsHook }:
|
2017-10-24 14:39:54 +03:00
|
|
|
|
|
|
|
let inherit (lib) optional; in
|
|
|
|
|
2019-07-05 18:41:41 +03:00
|
|
|
mkDerivation:
|
2017-10-24 14:39:54 +03:00
|
|
|
|
|
|
|
args:
|
|
|
|
|
|
|
|
let
|
|
|
|
args_ = {
|
|
|
|
|
2018-04-25 07:18:35 +03:00
|
|
|
qmakeFlags = [ ("CONFIG+=" + (if debug then "debug" else "release")) ]
|
|
|
|
++ (args.qmakeFlags or []);
|
2017-10-24 14:39:54 +03:00
|
|
|
|
2019-10-30 03:40:49 +03:00
|
|
|
NIX_CFLAGS_COMPILE = toString (
|
2018-01-19 16:59:17 +03:00
|
|
|
optional (!debug) "-DQT_NO_DEBUG"
|
2019-10-30 03:40:49 +03:00
|
|
|
++ lib.toList (args.NIX_CFLAGS_COMPILE or []));
|
2018-01-02 16:16:38 +03:00
|
|
|
|
2017-10-24 14:39:54 +03:00
|
|
|
cmakeFlags =
|
|
|
|
(args.cmakeFlags or [])
|
2018-01-19 16:59:17 +03:00
|
|
|
++ [
|
|
|
|
("-DCMAKE_BUILD_TYPE=" + (if debug then "Debug" else "Release"))
|
|
|
|
];
|
2017-10-24 14:39:54 +03:00
|
|
|
|
2017-11-10 18:23:13 +03:00
|
|
|
enableParallelBuilding = args.enableParallelBuilding or true;
|
2017-10-24 14:39:54 +03:00
|
|
|
|
2019-07-05 18:41:41 +03:00
|
|
|
nativeBuildInputs = (args.nativeBuildInputs or []) ++ [ wrapQtAppsHook ];
|
|
|
|
|
2017-10-24 14:39:54 +03:00
|
|
|
};
|
|
|
|
in
|
|
|
|
|
2019-07-05 18:41:41 +03:00
|
|
|
mkDerivation (args // args_)
|