at master 2.1 kB view raw
1{ 2 lib, 3 stdenv, 4 darwinVersionInputs, 5 cmake, 6 ninja, 7 perl, 8 moveBuildTree, 9 srcs, 10 patches ? [ ], 11}: 12 13args: 14 15let 16 inherit (args) pname; 17 version = args.version or srcs.${pname}.version; 18 src = args.src or srcs.${pname}.src; 19in 20stdenv.mkDerivation ( 21 args 22 // { 23 inherit pname version src; 24 patches = args.patches or patches.${pname} or [ ]; 25 26 buildInputs = 27 args.buildInputs or [ ] ++ lib.optionals stdenv.hostPlatform.isDarwin darwinVersionInputs; 28 nativeBuildInputs = 29 (args.nativeBuildInputs or [ ]) 30 ++ [ 31 cmake 32 ninja 33 perl 34 ] 35 ++ lib.optionals stdenv.hostPlatform.isDarwin [ moveBuildTree ]; 36 propagatedBuildInputs = 37 (lib.warnIf (args ? qtInputs) "qt6.qtModule's qtInputs argument is deprecated" args.qtInputs or [ ]) 38 ++ (args.propagatedBuildInputs or [ ]); 39 40 cmakeFlags = 41 # don't leak OS version into the final output 42 # https://bugreports.qt.io/browse/QTBUG-136060 43 [ "-DCMAKE_SYSTEM_VERSION=" ] 44 ++ lib.optionals stdenv.hostPlatform.isDarwin [ 45 "-DQT_NO_XCODE_MIN_VERSION_CHECK=ON" 46 # This is only used for the min version check, which we disabled above. 47 # When this variable is not set, cmake tries to execute xcodebuild 48 # to query the version. 49 "-DQT_INTERNAL_XCODE_VERSION=0.1" 50 ] 51 ++ args.cmakeFlags or [ ]; 52 53 moveToDev = false; 54 55 outputs = 56 args.outputs or [ 57 "out" 58 "dev" 59 ]; 60 separateDebugInfo = args.separateDebugInfo or true; 61 62 dontWrapQtApps = args.dontWrapQtApps or true; 63 } 64) 65// { 66 meta = 67 with lib; 68 let 69 pos = builtins.unsafeGetAttrPos "pname" args; 70 in 71 { 72 homepage = "https://www.qt.io/"; 73 description = "Cross-platform application framework for C++"; 74 license = with licenses; [ 75 fdl13Plus 76 gpl2Plus 77 lgpl21Plus 78 lgpl3Plus 79 ]; 80 maintainers = with maintainers; [ 81 nickcao 82 ]; 83 platforms = platforms.unix; 84 position = "${pos.file}:${toString pos.line}"; 85 } 86 // (args.meta or { }); 87}