depot/third_party/nixpkgs/pkgs/development/libraries/qt-5/mkDerivation.nix
Default email 8ac5e011d6 Project import generated by Copybara.
GitOrigin-RevId: 2c3273caa153ee8eb5786bc8141b85b859e7efd7
2020-04-24 19:36:52 -04:00

32 lines
678 B
Nix

{ lib, debug, wrapQtAppsHook }:
let inherit (lib) optional; in
mkDerivation:
args:
let
args_ = {
qmakeFlags = [ ("CONFIG+=" + (if debug then "debug" else "release")) ]
++ (args.qmakeFlags or []);
NIX_CFLAGS_COMPILE = toString (
optional (!debug) "-DQT_NO_DEBUG"
++ lib.toList (args.NIX_CFLAGS_COMPILE or []));
cmakeFlags =
(args.cmakeFlags or [])
++ [
("-DCMAKE_BUILD_TYPE=" + (if debug then "Debug" else "Release"))
];
enableParallelBuilding = args.enableParallelBuilding or true;
nativeBuildInputs = (args.nativeBuildInputs or []) ++ [ wrapQtAppsHook ];
};
in
mkDerivation (args // args_)