15 inherit (lib) licenses maintainers platforms;
22 version = args.version or srcs.${pname}.version;
23 src = args.src or srcs.${pname}.src;
29 inherit pname version src;
30 patches = (args.patches or [ ]) ++ (patches.${pname} or [ ]);
33 args.buildInputs or [ ]
34 # Per https://doc.qt.io/qt-5/macos.html#supported-versions
35 ++ lib.optionals stdenv.hostPlatform.isDarwin [
40 (args.nativeBuildInputs or [ ])
45 ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [
46 pkgsHostTarget.qt5.qtbase.dev
48 propagatedBuildInputs =
49 (lib.warnIf (args ? qtInputs) "qt5.qtModule's qtInputs argument is deprecated" args.qtInputs or [ ])
50 ++ (args.propagatedBuildInputs or [ ]);
52 // lib.optionalAttrs (stdenv.buildPlatform != stdenv.hostPlatform) {
53 depsBuildBuild = [ buildPackages.stdenv.cc ] ++ (args.depsBuildBuild or [ ]);
62 setOutputFlags = args.setOutputFlags or false;
65 . ${./hooks/move-qt-dev-tools.sh}
66 . ${./hooks/fix-qt-builtin-paths.sh}
71 ${args.preConfigure or ""}
73 fixQtBuiltinPaths . '*.pr?'
76 lib.optionalString (builtins.compareVersions "5.15.0" version <= 0)
77 # Note: We use ${version%%-*} to remove any tag from the end of the version
78 # string. Version tags are added by Nixpkgs maintainers and not reflected in
81 if [[ -z "$dontCheckQtModuleVersion" ]] \
82 && grep -q '^MODULE_VERSION' .qmake.conf 2>/dev/null \
83 && ! grep -q -F "''${version%%-*}" .qmake.conf 2>/dev/null
85 echo >&2 "error: could not find version ''${version%%-*} in .qmake.conf"
86 echo >&2 "hint: check .qmake.conf and update the package version in Nixpkgs"
90 if [[ -z "$dontSyncQt" && -f sync.profile ]]; then
91 syncqt.pl -version "''${version%%-*}"
95 dontWrapQtApps = args.dontWrapQtApps or true;
98 if [ -d "''${!outputDev}/lib/pkgconfig" ]; then
99 find "''${!outputDev}/lib/pkgconfig" -name '*.pc' | while read pc; do
101 -e "/^prefix=/ c prefix=''${!outputLib}" \
102 -e "/^exec_prefix=/ c exec_prefix=''${!outputBin}" \
103 -e "/^includedir=/ c includedir=''${!outputDev}/include"
109 ${args.postFixup or ""}
113 homepage = "https://www.qt.io";
114 description = "Cross-platform application framework for C++";
115 license = with licenses; [
121 maintainers = with maintainers; [
127 platforms = platforms.unix;
128 } // (args.meta or { });