Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at flake-libs 82 lines 1.9 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 [ ] 28 ++ lib.optionals stdenv.hostPlatform.isDarwin darwinVersionInputs; 29 nativeBuildInputs = 30 (args.nativeBuildInputs or [ ]) 31 ++ [ 32 cmake 33 ninja 34 perl 35 ] 36 ++ lib.optionals stdenv.hostPlatform.isDarwin [ moveBuildTree ]; 37 propagatedBuildInputs = 38 (lib.warnIf (args ? qtInputs) "qt6.qtModule's qtInputs argument is deprecated" args.qtInputs or [ ]) 39 ++ (args.propagatedBuildInputs or [ ]); 40 41 cmakeFlags = 42 # don't leak OS version into the final output 43 # https://bugreports.qt.io/browse/QTBUG-136060 44 [ "-DCMAKE_SYSTEM_VERSION=" ] 45 ++ lib.optional stdenv.hostPlatform.isDarwin "-DQT_NO_XCODE_MIN_VERSION_CHECK=ON" 46 ++ args.cmakeFlags or [ ]; 47 48 moveToDev = false; 49 50 outputs = 51 args.outputs or [ 52 "out" 53 "dev" 54 ]; 55 separateDebugInfo = args.separateDebugInfo or true; 56 57 dontWrapQtApps = args.dontWrapQtApps or true; 58 } 59) 60// { 61 meta = 62 with lib; 63 let 64 pos = builtins.unsafeGetAttrPos "pname" args; 65 in 66 { 67 homepage = "https://www.qt.io/"; 68 description = "Cross-platform application framework for C++"; 69 license = with licenses; [ 70 fdl13Plus 71 gpl2Plus 72 lgpl21Plus 73 lgpl3Plus 74 ]; 75 maintainers = with maintainers; [ 76 nickcao 77 ]; 78 platforms = platforms.unix; 79 position = "${pos.file}:${toString pos.line}"; 80 } 81 // (args.meta or { }); 82}