nixpkgs/pkgs/development/libraries/qt-5/mkDerivation.nix

33 lines
678 B
Nix
Raw Normal View History

{ lib, debug, wrapQtAppsHook }:
let inherit (lib) optional; in
mkDerivation:
args:
let
args_ = {
qmakeFlags = [ ("CONFIG+=" + (if debug then "debug" else "release")) ]
++ (args.qmakeFlags or []);
2019-10-30 00:40:49 +00:00
NIX_CFLAGS_COMPILE = toString (
2018-01-19 13:59:17 +00:00
optional (!debug) "-DQT_NO_DEBUG"
2019-10-30 00:40:49 +00:00
++ lib.toList (args.NIX_CFLAGS_COMPILE or []));
cmakeFlags =
(args.cmakeFlags or [])
2018-01-19 13:59:17 +00:00
++ [
("-DCMAKE_BUILD_TYPE=" + (if debug then "Debug" else "Release"))
];
enableParallelBuilding = args.enableParallelBuilding or true;
nativeBuildInputs = (args.nativeBuildInputs or []) ++ [ wrapQtAppsHook ];
};
in
mkDerivation (args // args_)